From ceb8f1c1a257bf43615e94c272fa6e21e68df18f Mon Sep 17 00:00:00 2001 From: Hariharan Seshadri Date: Mon, 5 Aug 2019 13:21:04 -0700 Subject: [PATCH] Modify the kernel declaration for Shrink op (#1554) * Add capability for the input and output of Shrink op to share a commong buffer * Cosmetic change --- onnxruntime/core/providers/cpu/nn/shrink.cc | 4 +++- onnxruntime/core/providers/cuda/nn/shrink.cc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cpu/nn/shrink.cc b/onnxruntime/core/providers/cpu/nn/shrink.cc index e89b437a2f..6af09fba42 100644 --- a/onnxruntime/core/providers/cpu/nn/shrink.cc +++ b/onnxruntime/core/providers/cpu/nn/shrink.cc @@ -11,7 +11,9 @@ namespace onnxruntime { ONNX_CPU_OPERATOR_KERNEL( Shrink, 9, - KernelDefBuilder().TypeConstraint("T", DataTypeImpl::AllNumericTensorTypes()), + KernelDefBuilder() + .MayInplace(0, 0) + .TypeConstraint("T", DataTypeImpl::AllNumericTensorTypes()), Shrink); namespace shrink_internal { diff --git a/onnxruntime/core/providers/cuda/nn/shrink.cc b/onnxruntime/core/providers/cuda/nn/shrink.cc index 90d0e86387..09eb264b74 100644 --- a/onnxruntime/core/providers/cuda/nn/shrink.cc +++ b/onnxruntime/core/providers/cuda/nn/shrink.cc @@ -17,6 +17,7 @@ namespace cuda { T, \ kCudaExecutionProvider, \ KernelDefBuilder() \ + .MayInplace(0, 0) \ .TypeConstraint("T", DataTypeImpl::GetTensorType()), \ Shrink);