code: def test_op_batch_times_grad_with_beta_equals_to_one(
      left_operand, right_operand, device_id, precision
  ):
      dt_precision = PRECISION_TO_TYPE[precision]
      a = AA(left_operand, dtype=dt_precision)
      b = AA(right_operand, dtype=dt_precision)
  
      root_gradient = np.ones_like(a)
  
      input1 = C.input_variable((2, 2), needs_gradient=True)
      input2 = C.input_variable((2, 2), needs_gradient=True)
      z = input1 + input2 + C.times(input1, input2)
      state, actual_forward = z.forward(
          {input1: a, input2: b},
          [z.output],
          {z.output},
          cntk_device(device_id),
      )
      actual_backwards = z.backward(
          state, {z.output: root_gradient}, [input1, input2]
      )
  
      k = a.shape[0]
      left_backward = np.ones_like(a)
      for x in range(k):
          left_backward[x, ...] += b[x].sum(axis=-1)
      right_backward = np.ones_like(b)
      for x in range(k):
          transpose_axes = list(
              np.roll(np.arange(len(b.shape[1:])), -1)
          )
          sum_axes = tuple(
              np.arange(0, len(a.shape) - len(b.shape) + 1)
          )
          right_backward[x, ...] += np.transpose(
              AA([a[x].sum(axis=sum_axes)]), axes=transpose_axes
          )
  
      assert np.allclose(actual_backwards[input1], left_backward)
      assert np.allclose(actual_backwards[input2], right_backward)
  
imports: from __future__ import division
  import numpy
  import pytest
  import cntk
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  from cntk.internal import sanitize_dtype_cntk
  from cntk.internal.utils import _ones_like, eval
label_desc: Use image node_id 11 for calling a global function with example usage: test_op_batch_times_grad_with_beta_equals_to_one(left_operand, right_operand, device_id, precision) without return types