docstr: Data dependent initialization.
code: def _data_dep_init(self, inputs):
      """Data dependent initialization."""
      # Normalize kernel first so that calling the layer calculates
      # `tf.dot(v, x)/tf.norm(v)` as in (5) in ([Salimans and Kingma, 2016][1]).
      self._compute_weights()
  
      activation = self.layer.activation
      self.layer.activation = None
  
      use_bias = self.layer.bias is not None
      if use_bias:
          bias = self.layer.bias
          self.layer.bias = tf.zeros_like(bias)
  
      # Since the bias is initialized as zero, setting the activation to zero and
      # calling the initialized layer (with normalized kernel) yields the correct
      # computation ((5) in Salimans and Kingma (2016))
      x_init = self.layer(inputs)
      norm_axes_out = list(range(x_init.shape.rank - 1))
      m_init, v_init = tf.nn.moments(x_init, norm_axes_out)
      scale_init = 1.0 / tf.sqrt(v_init + 1e-10)
  
      self.g.assign(self.g * scale_init)
      if use_bias:
          self.layer.bias = bias
          self.layer.bias.assign(-m_init * scale_init)
      self.layer.activation = activation
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import warnings
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import quantized_distribution
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 4 for calling the WeightNorm obj's underlying member method code with example usage: obj._data_dep_init(inputs) without return types