diff --git a/orttraining/orttraining/core/graph/training_op_defs.cc b/orttraining/orttraining/core/graph/training_op_defs.cc index 7af242a848..6ec1b4d3e4 100644 --- a/orttraining/orttraining/core/graph/training_op_defs.cc +++ b/orttraining/orttraining/core/graph/training_op_defs.cc @@ -446,7 +446,7 @@ void RegisterTrainingOpSchemas() { "Constrain input shape to integer tensors.") .TypeConstraint( "T", - OpSchema::all_tensor_types_with_bfloat(), + {"tensor(float16)", "tensor(float)", "tensor(double)"}, "Constrain input and output types to float tensors.") .TypeConstraint( "Tind", diff --git a/orttraining/orttraining/training_ops/cpu/tensor/gather_grad.cc b/orttraining/orttraining/training_ops/cpu/tensor/gather_grad.cc index 5f37bf35ce..7607b13788 100644 --- a/orttraining/orttraining/training_ops/cpu/tensor/gather_grad.cc +++ b/orttraining/orttraining/training_ops/cpu/tensor/gather_grad.cc @@ -15,7 +15,8 @@ ONNX_OPERATOR_KERNEL_EX( kCpuExecutionProvider, KernelDefBuilder() .TypeConstraint("I", DataTypeImpl::GetTensorType()) - .TypeConstraint("T", DataTypeImpl::AllTensorTypes()) + .TypeConstraint("T", {DataTypeImpl::GetTensorType(), + DataTypeImpl::GetTensorType()}) .TypeConstraint("Tind", std::vector{ DataTypeImpl::GetTensorType(), DataTypeImpl::GetTensorType()}), diff --git a/orttraining/orttraining/training_ops/cuda/tensor/gather_grad.cc b/orttraining/orttraining/training_ops/cuda/tensor/gather_grad.cc index 1c2a6a662d..ac2049f9ba 100644 --- a/orttraining/orttraining/training_ops/cuda/tensor/gather_grad.cc +++ b/orttraining/orttraining/training_ops/cuda/tensor/gather_grad.cc @@ -16,7 +16,8 @@ ONNX_OPERATOR_KERNEL_EX( KernelDefBuilder() .InputMemoryType(0) .TypeConstraint("I", DataTypeImpl::GetTensorType()) - .TypeConstraint("T", DataTypeImpl::AllFixedSizeTensorTypes()) + .TypeConstraint("T", {DataTypeImpl::GetTensorType(), + DataTypeImpl::GetTensorType()}) .TypeConstraint("Tind", std::vector{ DataTypeImpl::GetTensorType(), DataTypeImpl::GetTensorType()}),