class_docstr: Scale layer (2018).
  
  Scale the activations of the previous layer at each batch.
  
  # Arguments
      axis: Integer, the axis that should be normalized
          (typically the features axis).
          For instance, after a `Conv2D` layer with
          `data_format="channels_first"`,
          set `axis=1` in `BatchNormalization`.
      center: If True, add offset of `beta` to normalized tensor.
          If False, `beta` is ignored.
      scale: If True, multiply by `gamma`.
          If False, `gamma` is not used.
          When the next layer is linear (also e.g. `nn.relu`),
          this can be disabled since the scaling
          will be done by the next layer.
      beta_initializer: Initializer for the beta weight.
      gamma_initializer: Initializer for the gamma weight.
  
  # Input shape
      Arbitrary. Use the keyword argument `input_shape`
      (tuple of integers, does not include the samples axis)
      when using this layer as the first layer in a model.
  
  # Output shape
      Same shape as input.
class_docstr_tok: ["Scale","layer","(","2018",")",".","Scale","the","activations","of","the","previous","layer","at","each","batch",".","#","Arguments","axis",":","Integer",",","the","axis","that","should","be","normalized","(","typically","the","features","axis",")",".","For","instance",",","after","a","`","Conv2D","`","layer","with","`","data_format=","''","channels_first","''","`",",","set","`","axis=1","`","in","`","BatchNormalization","`",".","center",":","If","True",",","add","offset","of","`","beta","`","to","normalized","tensor",".","If","False",",","`","beta","`","is","ignored",".","scale",":","If","True",",","multiply","by","`","gamma","`",".","If","False",",","`","gamma","`","is","not","used",".","When","the","next","layer","is","linear","(","also","e.g",".","`","nn.relu","`",")",",","this","can","be","disabled","since","the","scaling","will","be","done","by","the","next","layer",".","beta_initializer",":","Initializer","for","the","beta","weight",".","gamma_initializer",":","Initializer","for","the","gamma","weight",".","#","Input","shape","Arbitrary",".","Use","the","keyword","argument","`","input_shape","`","(","tuple","of","integers",",","does","not","include","the","samples","axis",")","when","using","this","layer","as","the","first","layer","in","a","model",".","#","Output","shape","Same","shape","as","input","."]
code: def build(self, input_shape):
      dim = input_shape[self.axis]
      if dim is None:
          raise ValueError(
              "Axis " + str(self.axis) + " of "
              "input tensor should have a defined dimension "
              "but the layer received an input with shape "
              + str(input_shape)
              + "."
          )
      self.input_spec = InputSpec(
          ndim=len(input_shape), axes={self.axis: dim}
      )
      shape = (dim,)
  
      if self.scale:
          self.gamma = self.add_weight(
              shape=shape,
              name="gamma",
              initializer=self.gamma_initializer,
          )
      else:
          self.gamma = None
      if self.center:
          self.beta = self.add_weight(
              shape=shape,
              name="beta",
              initializer=self.beta_initializer,
          )
      else:
          self.beta = None
  
      self.built = True
  
file_path: MMdnn/mmdnn/conversion/keras/extra_layers.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from keras.engine import Layer, InputSpec
  from keras import initializers
  from keras import backend
label_desc: Use image node_id 2 for calling the Scale obj's underlying member method code with example usage: obj.build(input_shape) without return types