Unlock this feature

This feature isn’t part of your plan yet

Contact sales to get upgraded to the full DevStudio experience.

Unlock this feature

This feature isn't part of your plan yet.

Channel Normalization

File: src/image.hppLines 4484–4510
    /**
     * @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) {

Sign in to your account

Don't have an account? 
By signing in, you are agreeing to our Terms of Use and Privacy Policy.
Quadric // One architecture. Every algorithm.

Develop.

Simulate.

Profile.

Collaborate.