code: def _no_backprop_sgd_test(op, x, w, dt, data, one_step_sgd):
      input_map_data = {x: data}
      op_func = op(x * w)
      w.value = np.ones(w.shape).astype(dt) * 3.0
      param_val = (w * 1.0).eval()
      one_step_sgd(op_func, input_map_data)
      new_param_val = (w * 1.0).eval()
      np.testing.assert_allclose(param_val, new_param_val)
  
      # testing inputs through shared sub-expressions: no gradients pass through reduce arg ops to inputs (e.g. x, w) of the subexpressoin
      # (e.g. x * w here), therefore the gradients will depend on how the shared expressions participate in other experssions:
      lr = 0.1
      w.value = np.ones(w.shape).astype(dt) * 3.0
      param_val = (w * 1.0).eval()
      shared_exp = x * w
      op_func = op(shared_exp) + x + w + shared_exp
      grad = op_func.grad(input_map_data, [w, x])
      one_step_sgd(op_func, input_map_data, lr)
      new_param_val = (w * 1.0).eval()
  
      w.value = np.ones(w.shape).astype(dt) * 3.0
      ref_op_func = x + w + shared_exp
      ref_grad = ref_op_func.grad(input_map_data, [w, x])
      one_step_sgd(ref_op_func, input_map_data, lr)
      ref_new_param_val = (w * 1.0).eval()
      np.testing.assert_allclose(grad[w], ref_grad[w])
      np.testing.assert_allclose(new_param_val, ref_new_param_val)
  
file_path: CNTK/bindings/python/cntk/ops/tests/stop_gradient_test.py
imports: import numpy
  import cntk
  from .ops_test_utils import AA, PRECISION_TO_TYPE, precision
  from cntk.internal import sanitize_dtype_cntk
  import pytest
  from .non_diff_test import Matrices
label_desc: Use image node_id 5 for calling a global function with example usage: _no_backprop_sgd_test(op, x, w, dt, data, one_step_sgd) without return types