File:
src/image.hppLines 4523–4549 /**
* @brief Implements a normalization step on tensors, where each channel is normalized given
* mean and standard deviation parameters for that channel.
*
* `x_norm = (x / 255 - mean) / stdev(x)`
*
* @tparam InShape The input tensor shape.
* @tparam OutShape The output tensor shape.
* @tparam ChannelInfoShape The tensor shape of mean and stdDev info.
* @tparam OcmAllocatorType
* @param tensorIn The input tensor.
* @param tensorOut The output tensor.
* @param means The tensor containing the mean info for each channel.
* @param stdDevs The tensor containing the standard deviation info for each channel.
* @param ocmMemAlloc OCM memory allocator.
* @return void
*/
template <typename InShape,
typename OutShape,
typename ChannelInfoShape,
typename OcmAllocatorType,
std::enable_if_t<isTensorT<ChannelInfoShape>::value == 1, int> = 0>
INLINE void channelNorm(InShape& tensorIn,
OutShape& tensorOut,
ChannelInfoShape& means,
ChannelInfoShape& stdDevs,
OcmAllocatorType& ocmMemAlloc) {