class_docstr: The :class:`SwitchNorm` is a switchable normalization.
  
  Parameters
  ----------
  act : activation function
      The activation function of this layer.
  epsilon : float
      Eplison.
  beta_init : initializer or None
      The initializer for initializing beta, if None, skip beta.
      Usually you should not skip beta unless you know what happened.
  gamma_init : initializer or None
      The initializer for initializing gamma, if None, skip gamma.
      When the batch normalization layer is use instead of 'biases', or the next layer is linear, this can be
      disabled since the scaling can be done by the next layer. see `Inception-ResNet-v2 <https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_resnet_v2.py>`__
  moving_mean_init : initializer or None
      The initializer for initializing moving mean, if None, skip moving mean.
  data_format : str
      channels_last 'channel_last' (default) or channels_first.
  name : None or str
      A unique layer name.
  
  References
  ----------
  - `Differentiable Learning-to-Normalize via Switchable Normalization <https://arxiv.org/abs/1806.10779>`__
  - `Zhihu (CN) <https://zhuanlan.zhihu.com/p/39296570?utm_source=wechat_session&utm_medium=social&utm_oi=984862267107651584>`__
class_docstr_tok: ["The",":","class",":","`","SwitchNorm","`","is","a","switchable","normalization",".","Parameters","--","--","--","--","--","act",":","activation","function","The","activation","function","of","this","layer",".","epsilon",":","float","Eplison",".","beta_init",":","initializer","or","None","The","initializer","for","initializing","beta",",","if","None",",","skip","beta",".","Usually","you","should","not","skip","beta","unless","you","know","what","happened",".","gamma_init",":","initializer","or","None","The","initializer","for","initializing","gamma",",","if","None",",","skip","gamma",".","When","the","batch","normalization","layer","is","use","instead","of","'biases","'",",","or","the","next","layer","is","linear",",","this","can","be","disabled","since","the","scaling","can","be","done","by","the","next","layer",".","see","`","Inception-ResNet-v2","<","https",":","\/\/github.com\/tensorflow\/models\/blob\/master\/research\/slim\/nets\/inception_resnet_v2.py",">","`","__","moving_mean_init",":","initializer","or","None","The","initializer","for","initializing","moving","mean",",","if","None",",","skip","moving","mean",".","data_format",":","str","channels_last","'channel_last","'","(","default",")","or","channels_first",".","name",":","None","or","str","A","unique","layer","name",".","References","--","--","--","--","--","-","`","Differentiable","Learning-to-Normalize","via","Switchable","Normalization","<","https",":","\/\/arxiv.org\/abs\/1806.10779",">","`","__","-","`","Zhihu","(","CN",")","<","https",":","\/\/zhuanlan.zhihu.com\/p\/39296570","?","utm_source=wechat_session","&","utm_medium=social","&","utm_oi=984862267107651584",">","`","__"]
code: def __init__(
      self,
      act=None,
      epsilon=1e-5,
      beta_init=tl.initializers.constant(0.0),
      gamma_init=tl.initializers.constant(1.0),
      moving_mean_init=tl.initializers.zeros(),
      # beta_init=tf.compat.v1.initializers.constant(0.0),
      # gamma_init=tf.compat.v1.initializers.constant(1.0),
      # moving_mean_init=tf.compat.v1.initializers.zeros(),
      data_format="channels_last",
      name=None,  #'switchnorm',
  ):
      # super(SwitchNorm, self).__init__(prev_layer=prev_layer, act=act, name=name)
      super().__init__(name, act=act)
      self.epsilon = epsilon
      self.beta_init = beta_init
      self.gamma_init = gamma_init
      self.moving_mean_init = moving_mean_init
      self.data_format = data_format
  
      logging.info(
          "SwitchNorm %s: epsilon: %f act: %s"
          % (
              self.name,
              epsilon,
              self.act.__name__
              if self.act is not None
              else "No Activation",
          )
      )
  
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 1 to create a new SwitchNorm object from inherited base classes: Layer with example: obj = SwitchNorm(act, epsilon, beta_init, gamma_init, moving_mean_init, data_format, name)