(code262) mean, var = tf.nn.moments(inputs, self.axes)
When calculating the mean and variance of inputs, keepdims is set to False by default, returning a one-dimensional tensor. This tensor will be broadcasted along with the last dimension of inputs when doing batch_normalization, which is not suitable for channels first version.
InstanceNorm
The previous version of class InstanceNorm only supports InstanceNorm2d and static mode.
Description
Bug fixing of BatchNorm
A new version of InstanceNorm
Add *1d/2d/3d
Checklist
Motivation and Context
BatchNorm:
(code262)
mean, var = tf.nn.moments(inputs, self.axes)
When calculating the mean and variance of inputs,keepdims
is set toFalse
by default, returning a one-dimensional tensor. This tensor will be broadcasted along with the last dimension of inputs when doingbatch_normalization
, which is not suitable forchannels first
version.InstanceNorm
The previous version of class
InstanceNorm
only supports InstanceNorm2d and static mode.Description
Bug fixing of BatchNorm A new version of InstanceNorm Add *1d/2d/3d