https://mxnet.apache.org/versions/1.8.0/api/python/docs/_modules/mxnet/initializer.html#Xavier
if len(shape) < 2:
raise ValueError('Xavier initializer cannot be applied to vector {0}. It requires at'
' least 2D.'.format(name))
if len(shape) > 2:
hw_scale = np.prod(shape[2:])
fan_in, fan_out = shape[1] * hw_scale, shape[0] * hw_scale
It seems that this fan calculation only works when layout is NCHW. When layout is NHWC, this calculation is completely wrong.