class_docstr: Layer that performs batch normalization.
  
  In training, batch normalization keeps smoothed cumulative statistics across
  batches of input data and modifies each new batch so that its components are
  normally distributed. In eval or inference, a `BatchNorm` instance uses its
  stored mean and variance to approximately normalize each new batch of data.
  
  See https://arxiv.org/abs/1502.03167 for original presentation and motivation
  of batch normalization).
class_docstr_tok: ["Layer","that","performs","batch","normalization",".","In","training",",","batch","normalization","keeps","smoothed","cumulative","statistics","across","batches","of","input","data","and","modifies","each","new","batch","so","that","its","components","are","normally","distributed",".","In","eval","or","inference",",","a","`","BatchNorm","`","instance","uses","its","stored","mean","and","variance","to","approximately","normalize","each","new","batch","of","data",".","See","https",":","\/\/arxiv.org\/abs\/1502.03167","for","original","presentation","and","motivation","of","batch","normalization",")","."]
code: def _beta_gamma_with_correct_axes(self, x, weights):
      # Expand the parameters to have the right axes.
      beta, gamma = weights
      # TODO(phawkins): jnp.expand_dims should accept an axis tuple.
      # (https://github.com/numpy/numpy/issues/12290)
      ed = tuple(
          None if i in self._axis else slice(None)
          for i in range(jnp.ndim(x))
      )
      beta = beta[ed]
      gamma = gamma[ed]
      return beta, gamma
  
imports: from trax.fastmath import numpy
  from trax.layers import base
label_desc: Use image node_id 6 for calling the BatchNorm obj's underlying member method code with example usage: obj._beta_gamma_with_correct_axes(x, weights) and returns: beta,  gamma