code: def test_batch_normalization_broadcastable():
      # check if the broadcastable pattern is preserved by the optimizations
      x, dy, scale, bias, mean, var = (
          T.scalar(n).dimshuffle(["x"] * 5)
          for n in ("x", "dy", "scale", "bias", "mean", "var")
      )
  
      # forward pass
      out_train, x_mean, x_invstd = bn.batch_normalization_train(
          x, scale, bias, "spatial"
      )
      out_test = bn.batch_normalization_test(
          x, scale, bias, mean, var, "spatial"
      )
      # backward pass
      grads_train = T.grad(
          None, wrt=[x, scale, bias], known_grads={out_train: dy}
      )
      grads_test = T.grad(
          None, wrt=[x, scale, bias], known_grads={out_test: dy}
      )
      # compile
      f = theano.function(
          [x, scale, bias, mean, var, dy],
          [out_train, x_mean, x_invstd, out_test]
          + grads_train
          + grads_test,
      )
      assert not any(
          [
              isinstance(
                  n.op,
                  (
                      bn.AbstractBatchNormTrain,
                      bn.AbstractBatchNormInference,
                      bn.AbstractBatchNormTrainGrad,
                  ),
              )
              for n in f.maker.fgraph.toposort()
          ]
      )
  
file_path: Theano/theano/tensor/nnet/tests/test_bn.py
imports: from __future__ import absolute_import, print_function, division
  import theano
  import theano.tensor
  from theano.tests import unittest_tools
  import numpy
  from collections import OrderedDict
  from theano.tensor.nnet import bn
label_desc: Use image node_id 9 for calling a global function with example usage: test_batch_normalization_broadcastable() without return types