class_docstr: The :class:`GroupNorm` layer is for Group Normalization.
  See `tf.contrib.layers.group_norm <https://www.tensorflow.org/api_docs/python/tf/contrib/layers/group_norm>`__.
  
  Parameters
  -----------
  # prev_layer : :class:`Layer`
  #     The previous layer.
  groups : int
      The number of groups
  act : activation function
      The activation function of this layer.
  epsilon : float
      Eplison.
  data_format : str
      channels_last 'channel_last' (default) or channels_first.
  name : None or str
      A unique layer name
class_docstr_tok: ["The",":","class",":","`","GroupNorm","`","layer","is","for","Group","Normalization",".","See","`","tf.contrib.layers.group_norm","<","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/contrib\/layers\/group_norm",">","`","__",".","Parameters","--","--","--","--","--","-","#","prev_layer",":",":","class",":","`","Layer","`","#","The","previous","layer",".","groups",":","int","The","number","of","groups","act",":","activation","function","The","activation","function","of","this","layer",".","epsilon",":","float","Eplison",".","data_format",":","str","channels_last","'channel_last","'","(","default",")","or","channels_first",".","name",":","None","or","str","A","unique","layer","name"]
code: def build(self, inputs_shape):
      # shape = inputs.get_shape().as_list()
      if len(inputs_shape) != 4:
          raise Exception("This GroupNorm only supports 2D images.")
  
      if self.data_format == "channels_last":
          channels = inputs_shape[-1]
          self.int_shape = tf.concat(
              [  # tf.shape(input=self.inputs)[0:3],
                  inputs_shape[0:3],
                  tf.convert_to_tensor(
                      value=[self.groups, channels // self.groups]
                  ),
              ],
              axis=0,
          )
      elif self.data_format == "channels_first":
          channels = inputs_shape[1]
          self.int_shape = tf.concat(
              [
                  # tf.shape(input=self.inputs)[0:1],
                  inputs_shape[0:1],
                  tf.convert_to_tensor(
                      value=[self.groups, channels // self.groups]
                  ),
                  # tf.shape(input=self.inputs)[2:4]
                  inputs_shape[2:4],
              ],
              axis=0,
          )
      else:
          raise ValueError(
              "data_format must be 'channels_last' or 'channels_first'."
          )
  
      if self.groups > channels:
          raise ValueError(
              "Invalid groups %d for %d channels."
              % (self.groups, channels)
          )
      if channels % self.groups != 0:
          raise ValueError(
              "%d channels is not commensurate with %d groups."
              % (channels, self.groups)
          )
  
      if self.data_format == "channels_last":
          # mean, var = tf.nn.moments(x, [1, 2, 4], keep_dims=True)
          self.gamma = self._get_weights(
              "gamma", shape=channels, init=tl.initializers.ones()
          )
          # self.gamma = tf.compat.v1.get_variable('gamma', channels, initializer=tf.compat.v1.initializers.ones())
          self.beta = self._get_weights(
              "beta", shape=channels, init=tl.initializers.zeros()
          )
          # self.beta = tf.compat.v1.get_variable('beta', channels, initializer=tf.compat.v1.initializers.zeros())
      elif self.data_format == "channels_first":
          # mean, var = tf.nn.moments(x, [2, 3, 4], keep_dims=True)
          self.gamma = self._get_weights(
              "gamma",
              shape=[1, channels, 1, 1],
              init=tl.initializers.ones(),
          )
          # self.gamma = tf.compat.v1.get_variable('gamma', [1, channels, 1, 1], initializer=tf.compat.v1.initializers.ones())
          self.beta = self._get_weights(
              "beta",
              shape=[1, channels, 1, 1],
              init=tl.initializers.zeros(),
          )
  
imports: import tensorflow
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.training import moving_averages
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.layers.core import Layer
label_desc: Use image node_id 2 for calling the GroupNorm obj's underlying member method code with example usage: obj.build(inputs_shape) without return types