code: def BNBiRecurrence(
      fwd, bwd, test_dual=True
  ):  # special version that calls one shared BN instance at two places, for testing BN param tying
      F = Recurrence(fwd)
      G = Recurrence(fwd, go_backwards=True)
      BN = BatchNormalization(normalization_time_constant=-1)
      x = placeholder()
      # The following code applies the same BN function object twice.
      # When running whole-corpus estimation of means/vars, this must lead to the same estimate
      # although it is estimated on twice the amount of data (each sample is used twice).
      # Hence, this is the test that proves that the parameter sharing works.
      x1 = BN(x)
      x2 = BN(x) if test_dual else x1
      # In double precision with corpus aggregation, these lead to the same result.
      apply_x = splice(F(x1), G(x2))
      return apply_x
  
file_path: CNTK/Tests/EndToEndTests/CNTKv2Python/Examples/language_understanding_test.py
imports: from __future__ import print_function
  import os, sys
  import numpy
  import shutil
  from cntk import DeviceDescriptor
  from cntk import placeholder
  from cntk.layers import *
  from cntk.internal.utils import *
  from cntk.logging import *
  from cntk.ops import splice
  from LanguageUnderstanding import data_dir, create_reader, create_model_function, train, evaluate, emb_dim, hidden_dim, num_labels
label_desc: Use image node_id 5 for calling a global function with example usage: BNBiRecurrence(fwd, bwd, test_dual) and returns: apply_x