code: def test_batch_norm_model(tmpdir):
      pytest.skip(
          "Needs to be fixed after removal of batch axis change."
      )
      image_height = 32
      image_width = 32
      num_channels = 3
      num_classes = 10
  
      input_var = C.input_variable(
          (num_channels, image_height, image_width)
      )
      label_var = C.input_variable((num_classes))
  
      def create_basic_model_with_batch_normalization(input, out_dims):
          with C.layers.default_options(
              activation=C.relu, init=C.glorot_uniform()
          ):
              model = C.layers.Sequential(
                  [
                      C.layers.For(
                          range(3),
                          lambda i: [
                              C.layers.Convolution(
                                  (5, 5),
                                  [image_width, image_height, 64][i],
                                  pad=True,
                              ),
                              C.layers.BatchNormalization(map_rank=1),
                              C.layers.MaxPooling(
                                  (3, 3), strides=(2, 2)
                              ),
                          ],
                      ),
                      C.layers.Dense(64),
                      C.layers.BatchNormalization(map_rank=1),
                      C.layers.Dense(out_dims, activation=None),
                  ]
              )
  
          return model(input)
  
      feature_scale = 1.0 / 256.0
  
      # TODO: ONNX only do right hand-side broadcast. This test fails
      # if input_var, feature_scale is swapped.
      input_var_norm = C.element_times(input_var, feature_scale)
  
      # apply model to input
      z = create_basic_model_with_batch_normalization(
          input_var_norm, out_dims=10
      )
  
      filename = os.path.join(str(tmpdir), R"bn_model.onnx")
      z.save(filename, format=C.ModelFormat.ONNX)
  
      loaded_node = C.Function.load(filename, format=C.ModelFormat.ONNX)
      assert z.shape == loaded_node.shape
  
      img_shape = (num_channels, image_width, image_height)
      img = np.asarray(
          np.random.uniform(-1, 1, img_shape), dtype=np.float32
      )
  
      x = z.arguments[0]
      x_ = loaded_node.arguments[0]
      assert np.allclose(loaded_node.eval({x_: img}), z.eval({x: img}))
  
file_path: CNTK/bindings/python/cntk/tests/onnx_format_test.py
imports: import os
  import numpy
  import cntk
  from cntk.ops.tests.ops_test_utils import cntk_device
  import pytest
label_desc: Use image node_id 7 for calling a global function with example usage: test_batch_norm_model(tmpdir) and returns: model