code: def test_cast():
      i = C.input_variable((3))
      i2 = C.input_variable((1), needs_gradient=True)
      i_data = [[1, 20, 300], [2000, 3000, 5000], [3, 4, 5]]
      i2_data = [[7], [8], [9]]
      f = C.combine(
          C.cast(i, dtype=np.float16), C.cast(i2, dtype=np.float16)
      )
      feed_dict = {
          i: AA(i_data).astype(np.float32),
          i2: AA(i2_data).astype(np.float32),
      }
      data = f.eval(feed_dict)
      assert np.array_equal(data[f[0]], i_data)
      assert np.array_equal(data[f[1]], i2_data)
      s = f[0] * f[1]
      data = s.grad(feed_dict)
      assert np.array_equal(data, [[321], [10000], [12]])
  
file_path: CNTK/bindings/python/cntk/ops/tests/fp16_test.py
imports: from __future__ import division
  import numpy
  import pytest
  from .ops_test_utils import _test_binary_op, AA, PRECISION_TO_TYPE, unittest_helper
  import cntk
label_desc: Use image node_id 2 for calling a global function with example usage: test_cast() without return types