From c0a3320522c8d83ec28eb5daba3c8f0ea2602b38 Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Fri, 26 Jun 2020 00:31:21 +0000 Subject: [PATCH] Merged PR 4851009: move clamp_cast under OperatorHelper namespace move clamp_cast under OperatorHelper namespace This PR is to fix the duplicated definition of clamp_cast in "WindowsAI\dml\Common\Algorithms.h" --- .../core/providers/dml/OperatorAuthorHelper/Common.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/onnxruntime/core/providers/dml/OperatorAuthorHelper/Common.h b/onnxruntime/core/providers/dml/OperatorAuthorHelper/Common.h index 34f60e1f6f..c85c1d7e52 100644 --- a/onnxruntime/core/providers/dml/OperatorAuthorHelper/Common.h +++ b/onnxruntime/core/providers/dml/OperatorAuthorHelper/Common.h @@ -20,13 +20,12 @@ }\ } -template T clamp_cast(I input) -{ - return static_cast(std::clamp(input, std::numeric_limits::lowest(), std::numeric_limits::max())); -} - namespace OperatorHelper { + template T clamp_cast(I input) + { + return static_cast(std::clamp(input, std::numeric_limits::lowest(), std::numeric_limits::max())); + } enum TensorAxis { N, C, H, W, DoNotCoerce = UINT_MAX, LeftAligned = INT_MAX, RightAligned = INT_MIN, NoPlacementAdjustment = 0 }; enum BroadcastMode { NoBroadcast, UnidirectionalBroadcast, MultidirectionalBroadcast };