code: def _conv2d_getter(sess):
      def _get(pd, attr):
          W = _trainable_getter(sess)(pd.W)
          # handling input with sequence axis:
          W_rank = len(W.shape)
          # the transpose from tf [H, W, C] to cntk's [C, H, W] happens at the tailing axes excluding the leading dynamic
          # axes (batch and sequence axes) in the data format:
          axis_perm = (
              list(range(W_rank - 3)) if W_rank > 3 else []
          ) + [i + W_rank - 3 for i in [2, 0, 1]]
          if pd.b:
              b = _trainable_getter(sess)(pd.b)
          else:
              b = None
          return cstk.Conv2DArgs(
              W=W.transpose(axis_perm),
              b=b.reshape(
                  attr.num_filters,
              ),
          )
  
      return _get
  
imports: import tensorflow
  import numpy
  from cntk.contrib import crosstalk
label_desc: Use image node_id 7 for calling a global function with example usage: _conv2d_getter(sess) and returns: _get, cstk