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"
This commit is contained in:
Xiang Zhang 2020-06-26 00:31:21 +00:00
parent 5ebdf76aa3
commit c0a3320522

View file

@ -20,13 +20,12 @@
}\
}
template<typename T, typename I> T clamp_cast(I input)
{
return static_cast<T>(std::clamp<I>(input, std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max()));
}
namespace OperatorHelper
{
template<typename T, typename I> T clamp_cast(I input)
{
return static_cast<T>(std::clamp<I>(input, std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max()));
}
enum TensorAxis { N, C, H, W, DoNotCoerce = UINT_MAX, LeftAligned = INT_MAX, RightAligned = INT_MIN, NoPlacementAdjustment = 0 };
enum BroadcastMode { NoBroadcast, UnidirectionalBroadcast, MultidirectionalBroadcast };