code: def test_cntk_cudnn():
      try:
          import tensorflow
  
          has_tensorflow = True
      except:
          has_tensorflow = False
  
      if has_tensorflow:
          tf_baseline_lstm()
      else:
          cntk_baseline_lstm()
  
      import cntk as C
      import cntk.contrib.crosstalk.crosstalk_cntk as crct
  
      ci = crct.instance
  
      input_var = C.sequence.input_variable(shape=(in_dim))
      data = {input_var: data_cntk}
      ci.set_data(data)
      ci.set_workdir(workdir)
  
      W = C.parameter(
          (
              -1,
              dim,
          ),
          init=C.glorot_uniform(),
      )
      cudnn_fwbw = C.optimized_rnnstack(
          input_var, W, dim, 1, bidirectional=True, recurrent_op="lstm"
      )
      ci.watch(
          cudnn_fwbw,
          "cntk_birnn_cudnn",
          var_type=cstk.RnnAttr,
          attr=cstk.RnnAttr(
              bidirectional=True,
              op_type="lstm",
              input_dim=in_dim,
              hidden_dim=dim,
              forget_bias=0,
          ),
      )
      ci.watch(cudnn_fwbw, "cntk_birnn_cudnn_out")
  
      ci.assign("cntk_birnn_cudnn", load=True, load_name="birnn")
      assert ci.compare(
          "cntk_birnn_cudnn_out",
          compare_name="birnn_out",
          rtol=1e-4,
          atol=1e-6,
      )
  
      ci.fetch("cntk_birnn_cudnn", save=True)
      ci.assign("cntk_birnn_cudnn", load=True)
      assert ci.compare(
          "cntk_birnn_cudnn_out",
          compare_name="birnn_out",
          rtol=1e-4,
          atol=1e-6,
      )
  
      # test assign with value
      num_gates = 4
      ci.assign(
          "cntk_birnn_cudnn",
          value=cstk.RnnArgs(
              fw_W=np.random.random((in_dim, num_gates * dim)).astype(
                  np.float32
              ),
              fw_H=np.random.random((dim, num_gates * dim)).astype(
                  np.float32
              ),
              fw_b=np.random.random((num_gates * dim,)).astype(
                  np.float32
              ),
              bw_W=np.random.random((in_dim, num_gates * dim)).astype(
                  np.float32
              ),
              bw_H=np.random.random((dim, num_gates * dim)).astype(
                  np.float32
              ),
              bw_b=np.random.random((num_gates * dim,)).astype(
                  np.float32
              ),
          ),
      )
  
      ci.reset()
  
imports: import numpy
  from cntk.contrib import crosstalk
  import tempfile
label_desc: Use image node_id 3 for calling a global function with example usage: test_cntk_cudnn() without return types