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: Data dependent initialization.
docstr_tok: ["Data","dependent","initialization","."]
code: def _data_dep_init(self, inputs):
      """Data dependent initialization."""
      with tf.name_scope("data_dep_init"):
          # Generate data dependent init values
          x_init = self._naked_clone_layer(inputs)
          data_norm_axes = list(range(x_init.shape.rank - 1))
          m_init, v_init = tf.nn.moments(x_init, data_norm_axes)
          scale_init = 1.0 / tf.math.sqrt(v_init + 1e-10)
  
          # RNNs have fused kernels that are tiled
          # Repeat scale_init to match the shape of fused kernel
          # Note: This is only to support the operation,
          # the paper advises against RNN+data_dep_init
          if scale_init.shape[0] != self.g.shape[0]:
              rep = int(self.g.shape[0] / scale_init.shape[0])
              scale_init = tf.tile(scale_init, [rep])
  
          # Assign data dependent init values
          g_tensor = self.g.assign(self.g * scale_init)
          if (
              hasattr(self.layer, "bias")
              and self.layer.bias is not None
          ):
              bias_tensor = self.layer.bias.assign(-m_init * scale_init)
              return [g_tensor, bias_tensor]
          else:
              return [g_tensor]
  
file_path: addons/tensorflow_addons/layers/wrappers.py
imports: import logging
  import tensorflow
  from typeguard import typechecked
label_desc: Use image node_id 7 for calling the WeightNormalization obj's underlying member method code with example usage: obj._data_dep_init(inputs) and returns: list, list