diff --git a/onnxruntime/core/providers/cuda/controlflow/if.cc b/onnxruntime/core/providers/cuda/controlflow/if.cc index 4a79145588..5898fe8d6a 100644 --- a/onnxruntime/core/providers/cuda/controlflow/if.cc +++ b/onnxruntime/core/providers/cuda/controlflow/if.cc @@ -18,7 +18,7 @@ ONNX_OPERATOR_VERSIONED_KERNEL_EX(If, KernelDefBuilder() .InputMemoryType(0) // 'cond' needs to be on CPU .TypeConstraint("B", DataTypeImpl::GetTensorType()) - .TypeConstraint("V", DataTypeImpl::AllTensorTypes()), + .TypeConstraint("V", DataTypeImpl::AllFixedSizeTensorTypes()), If); // output shape rules requiring the output shapes of the 'THEN' and 'ELSE' @@ -30,7 +30,7 @@ ONNX_OPERATOR_KERNEL_EX(If, KernelDefBuilder() .InputMemoryType(0) // 'cond' needs to be on CPU .TypeConstraint("B", DataTypeImpl::GetTensorType()) - .TypeConstraint("V", DataTypeImpl::AllTensorTypes()), + .TypeConstraint("V", DataTypeImpl::AllFixedSizeTensorTypes()), If); Status If::Compute(OpKernelContext* ctx) const {