code: def test_inferred_static_axis_in_recurrence():
      x = C.sequence.input_variable((-1, 2))
      out_placeholder = C.placeholder()
      out_past = C.sequence.past_value(out_placeholder)
      wh = C.parameter(
          init=np.asarray([[2, 5], [1, 3]], dtype=np.float32)
      )
      wx = C.parameter(
          init=np.asarray([[1, 4], [2, 5]], dtype=np.float32)
      )
      out = C.times(x, wx) + C.times(out_past, wh)
      out.replace_placeholders({out_placeholder: out})
  
      x_data = np.asarray([[0.5, 0.2], [-0.7, 1.2]], np.float32)
      w_grad, out_val = out.grad(
          {x: x_data}, wrt=[wh, wx], outputs=[out]
      )
      assert np.allclose(out_val, [[[[0.9, 3.0], [1.7, 3.2]]]])
      assert np.allclose(w_grad[wx], [[-0.2, -0.2], [1.4, 1.4]])
  
imports: import numpy
  import pytest
  import cntk
  from cntk.ops.functions import Function, UserFunction
  from .ops_test_utils import AA
label_desc: Use image node_id 5 for calling a global function with example usage: test_inferred_static_axis_in_recurrence() without return types