class_docstr: Broadcasted elementwise product with learnable parameters.
  
  Computes a elementwise product as :func:`~chainer.functions.scale`
  function does except that its second input is a learnable weight parameter
  :math:`W` the link has.
  
  Args:
      axis (int): The first axis of the first input of
          :func:`~chainer.functions.scale` function along which its second
          input is applied.
      W_shape (tuple of ints): Shape of learnable weight parameter. If
          ``None``, this link does not have learnable weight parameter so an
          explicit weight needs to be given to its ``forward`` method's
          second input.
      bias_term (bool): Whether to also learn a bias (equivalent to Scale
          link + Bias link).
      bias_shape (tuple of ints): Shape of learnable bias. If ``W_shape`` is
          ``None``, this should be given to determine the shape. Otherwise,
          the bias has the same shape ``W_shape`` with the weight parameter
          and ``bias_shape`` is ignored.
  
  .. seealso:: See :func:`~chainer.functions.scale` for details.
  
  Attributes:
      W (~chainer.Parameter): Weight parameter if ``W_shape`` is given.
          Otherwise, no W attribute.
      bias (~chainer.links.Bias): Bias term if ``bias_term`` is ``True``.
          Otherwise, no bias attribute.
code: def __init__(
      self, axis=1, W_shape=None, bias_term=False, bias_shape=None
  ):
      super(Scale, self).__init__()
      self.axis = axis
  
      with self.init_scope():
          # Add W parameter and/or bias term.
          if W_shape is not None:
              self.W = variable.Parameter(1, W_shape)
              if bias_term:
                  self.bias = bias.Bias(axis, W_shape)
          else:
              if bias_term:
                  if bias_shape is None:
                      raise ValueError(
                          "bias_shape should be given if W is not "
                          "learnt parameter and bias_term is True."
                      )
                  self.bias = bias.Bias(axis, bias_shape)
  
file_path: chainer/chainer/links/connection/scale.py
imports: import chainer
  from chainer.functions.math import scale
  from chainer import link
  from chainer.links.connection import bias
  from chainer import variable
label_desc: Use image node_id 1 to create a new Scale object from inherited base classes: link with example: obj = Scale(axis, W_shape, bias_term, bias_shape)