channelNormfunction
File:
/src/image.hppLines 4564–4605Implements 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)
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)Template Parameters
| Name | Type | Default | Description |
|---|---|---|---|
InShape | typename | The input tensor shape. | |
OutShape | typename | The output tensor shape. | |
ChannelInfoShape | typename | The tensor shape of mean and stdDev info. | |
OcmAllocatorType | typename |
Parameters
| Name | Type | Description |
|---|---|---|
tensorIn | InShape& | The input tensor. |
tensorOut | OutShape& | The output tensor. |
means | ChannelInfoShape& | The tensor containing the mean info for each channel. |
stdDevs | ChannelInfoShape& | The tensor containing the standard deviation info for each channel. |
ocmMemAlloc | OcmAllocatorType& | OCM memory allocator. |
Returns
INLINE void — void
