code: def test_cos_distane_backward3():
      x = C.sequence.input_variable(
          shape=(100,), sequence_axis=C.Axis("B"), needs_gradient=True
      )
      z = C.cosine_distance(x, x)
      np.random.seed(0)
      a = np.float32(np.random.rand(10, 50, 100))
      b = a
      bwd, fwd = z.forward({x: a}, [z.output], set([z.output]))
      value = list(fwd.values())[0]
      expected_cos = numpy_cos(a, b)
      expected = expected_cos.forward()
      assert np.allclose(value, expected)
      grad = z.backward(bwd, {z.output: np.ones_like(value)}, set([x]))
      bwd = expected_cos.backward()
      x_driv_expected = bwd["a"] + bwd["b"]
      assert np.all(np.absolute(grad[x] - x_driv_expected) < 1e-6)
  
file_path: CNTK/bindings/python/cntk/losses/tests/cosine_distance_test.py
imports: import numpy
  import pytest
  import cntk
label_desc: Use image node_id 7 for calling a global function with example usage: test_cos_distane_backward3() without return types