code: def test_rank0_output():
      x = C.sequence.input_variable(
          shape=(768,), sequence_axis=C.Axis("B"), needs_gradient=True
      )
      y = C.sequence.input_variable(
          shape=(768,), sequence_axis=C.Axis("B"), needs_gradient=True
      )
      z = C.cosine_distance(x, y)
      batch_num = 2
      batch_size = 30
      a = np.float32(np.random.rand(batch_num * batch_size, 1500, 768))
      b = np.float32(np.random.rand(batch_num * batch_size, 1500, 768))
      for i in range(batch_num):
          bwd, fwd = z.forward(
              {
                  x: a[i * batch_size : (i + 1) * batch_size],
                  y: b[i * batch_size : (i + 1) * batch_size],
              },
              [z.output],
              set([z.output]),
          )
          grad = z.backward(
              bwd, {z.output: np.ones_like(fwd[z.output])}, set([x, y])
          )
  
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 4 for calling a global function with example usage: test_rank0_output() without return types