class_docstr: Implement ChannelNorm.
  
  Based on this paper and keras' InstanceNorm layer:
    Ba, Jimmy Lei, Jamie Ryan Kiros, and Geoffrey E. Hinton.
    "Layer normalization."
    arXiv preprint arXiv:1607.06450 (2016).
class_docstr_tok: ["Implement","ChannelNorm",".","Based","on","this","paper","and","keras","'","InstanceNorm","layer",":","Ba",",","Jimmy","Lei",",","Jamie","Ryan","Kiros",",","and","Geoffrey","E.","Hinton",".","``","Layer","normalization",".","''","arXiv","preprint","arXiv:1607.06450","(","2016",")","."]
code: def _get_moments(self, inputs):
      # Like tf.nn.moments but unbiased sample std. deviation.
      # Reduce over channels only.
      mean = tf.reduce_mean(
          inputs, [self.axis], keepdims=True, name="mean"
      )
      variance = tf.reduce_sum(
          tf.squared_difference(inputs, tf.stop_gradient(mean)),
          [self.axis],
          keepdims=True,
          name="variance_sum",
      )
      # Divide by N-1
      inputs_shape = tf.shape(inputs)
      counts = tf.reduce_prod([inputs_shape[ax] for ax in [self.axis]])
      variance /= tf.cast(counts, tf.float32) - 1
      return mean, variance
  
imports: import collections
  from compare_gan.architectures import abstract_arch
  from compare_gan.architectures import arch_ops
  import numpy
  import tensorflow.compat.v1
  import tensorflow_compression
  from hific.helpers import ModelMode
label_desc: Use image node_id 4 for calling the ChannelNorm obj's underlying member method code with example usage: obj._get_moments(inputs) and returns: mean,  variance