code: def batch_normalization(
      inputs, gamma, beta, mean, std, mode="low_mem"
  ):
      """
      This function will build the symbolic graph for applying batch normalization
      to a set of activations.
      Also works on GPUs, but is not optimized using cuDNN.
  
      .. versionadded:: 0.7.1
  
      Parameters
      ----------
      inputs : symbolic tensor
          Mini-batch of activations
      gamma: symbolic tensor
          BN scale parameter, must be of same dimensionality as
          inputs and broadcastable against it
      beta: symbolic tensor
          BN shift parameter, must be of same dimensionality as
          inputs and broadcastable against it
      mean: symbolic tensor
          inputs means, must be of same dimensionality as
          inputs and broadcastable against it
      std: symbolic tensor
          inputs standard deviation, must be of same dimensionality as
          inputs and broadcastable against it
      mode: 'low_mem' or 'high_mem'
          Specify which batch_normalization implementation that will be
          used.
          As no intermediate representations are stored for the back-propagation,
          'low_mem' implementation lower the memory usage, however,
          it is 5-10% slower than 'high_mem' implementation. Note that 5-10% computation
          time difference compare the batch_normalization operation only, time difference
          between implementation is likely to be less important on the full model fprop/bprop.
      """
      if mode == "low_mem":
          elm_bn = theano.tensor.elemwise.Elemwise(
              scalar_op=BNComposite(dtype=inputs.dtype)
          )
          rval = elm_bn(inputs, mean, std, gamma, beta)
      elif mode == "high_mem":
          rval = (inputs - mean) * (gamma / std) + beta
      else:
          raise ValueError('mode must be either "low_mem", "high_mem"')
      return rval
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import theano
  from theano import Apply, Op
  from theano.gof import local_optimizer
  from theano.gof.opt import copy_stack_trace
  from theano.tensor import as_tensor_variable, TensorType
  from theano.tensor import basic
  from theano.tensor.opt import register_specialize_device
  from theano.scalar import Composite, as_common_dtype
  from theano.scalar import add, sub, true_div, mul
label_desc: Use image node_id 1 for calling a global function with example usage: batch_normalization(inputs, gamma, beta, mean, std, mode) and returns: rval