code: def test_transpose_backward():
      shape = (2, 3, 4)
      p = (2, 0, 1)
      x0 = np.arange(np.prod(shape), dtype=np.float32).reshape(*shape)
      shapet = tuple(shape[i] for i in p)
      x = C.input_variable(shape, needs_gradient=True)
      y = C.reduce_sum(C.cos(C.transpose(x, p)))
      xt = C.input_variable(shapet, needs_gradient=True)
      yt = C.reduce_sum(C.cos(xt))
      g = np.squeeze(y.grad({x: x0}))
      gt = np.squeeze(yt.grad({xt: np.transpose(x0, p)}))
      assert np.allclose(np.transpose(g, p), gt)
  
imports: from __future__ import division
  import numpy
  import cntk
  import pytest
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  import cntk
  from cntk import Value
  from cntk.axis import Axis
  from cntk.internal import sanitize_dtype_cntk
  from ..None import constant
label_desc: Use image node_id 11 for calling a global function with example usage: test_transpose_backward() without return types