From 3be554c2fbde8eb2951b231c6067d69325029668 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Wed, 20 Nov 2019 06:48:14 +1000 Subject: [PATCH] Fix the type constraints on CUDA If operator to exclude strings. (#2431) --- onnxruntime/core/providers/cuda/controlflow/if.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 {