class_docstr: Performs weight normalization.
  
  This wrapper reparameterizes a layer by decoupling the weight's
  magnitude and direction.
  This speeds up convergence by improving the
  conditioning of the optimization problem.
  
  See [Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks](https://arxiv.org/abs/1602.07868).
  
  Wrap `tf.keras.layers.Conv2D`:
  
  >>> x = np.random.rand(1, 10, 10, 1)
  >>> conv2d = WeightNormalization(tf.keras.layers.Conv2D(2, 2), data_init=False)
  >>> y = conv2d(x)
  >>> y.shape
  TensorShape([1, 9, 9, 2])
  
  Wrap `tf.keras.layers.Dense`:
  
  >>> x = np.random.rand(1, 10, 10, 1)
  >>> dense = WeightNormalization(tf.keras.layers.Dense(10), data_init=False)
  >>> y = dense(x)
  >>> y.shape
  TensorShape([1, 10, 10, 10])
  
  Args:
    layer: A `tf.keras.layers.Layer` instance.
    data_init: If `True` use data dependent variable initialization.
  Raises:
    ValueError: If not initialized with a `Layer` instance.
    ValueError: If `Layer` does not contain a `kernel` of weights.
    NotImplementedError: If `data_init` is True and running graph execution.
docstr: Initialize weight g.
  
  The initial value of g could either from the initial value in v,
  or by the input value if self.data_init is True.
docstr_tok: ["Initialize","weight","g.","The","initial","value","of","g","could","either","from","the","initial","value","in","v",",","or","by","the","input","value","if","self.data_init","is","True","."]
code: def _initialize_weights(self, inputs):
      """Initialize weight g.
  
      The initial value of g could either from the initial value in v,
      or by the input value if self.data_init is True.
      """
      with tf.control_dependencies(
          [
              tf.debugging.assert_equal(  # pylint: disable=bad-continuation
                  self._initialized,
                  False,
                  message="The layer has been initialized.",
              )
          ]
      ):
          if self.data_init:
              assign_tensors = self._data_dep_init(inputs)
          else:
              assign_tensors = self._init_norm()
          assign_tensors.append(self._initialized.assign(True))
          return assign_tensors
  
file_path: addons/tensorflow_addons/layers/wrappers.py
imports: import logging
  import tensorflow
  from typeguard import typechecked
label_desc: Use image node_id 5 for calling the WeightNormalization obj's underlying member method code with example usage: obj._initialize_weights(inputs) and returns: assign_tensors