code: def test_gather_op_with_axis(device_id, precision):
      data = np.array(
          [
              [1.0, 1.2, 1.9],
              [2.3, 3.4, 3.9],
              [4.5, 5.7, 5.9],
          ]
      ).astype(PRECISION_TO_TYPE[precision])
      indices = (
          np.array([0, 2])
          .astype(PRECISION_TO_TYPE[precision])
          .astype(PRECISION_TO_TYPE[precision])
      )
      output = np.array(
          [
              [1.0, 1.9],
              [2.3, 3.9],
              [4.5, 5.9],
          ]
      ).astype(PRECISION_TO_TYPE[precision])
      x = C.constant(data)
      i = C.constant(indices)
      y = C.gather(x, i, axis=1)
      z = y.eval({}, device=cntk_device(device_id))
      assert np.allclose(output, z)
  
      data = np.array(
          [
              [[1.0, 1.2, 1.9]],
              [[2.3, 3.4, 3.9]],
              [[4.5, 5.7, 5.9]],
          ]
      ).astype(PRECISION_TO_TYPE[precision])
      indices = (
          np.array([0, 2])
          .astype(PRECISION_TO_TYPE[precision])
          .astype(PRECISION_TO_TYPE[precision])
      )
      output = np.array(
          [
              [[1.0, 1.9]],
              [[2.3, 3.9]],
              [[4.5, 5.9]],
          ]
      ).astype(PRECISION_TO_TYPE[precision])
      x = C.constant(data)
      i = C.constant(indices)
      y = C.gather(x, i, axis=2)
      z = y.eval({}, device=cntk_device(device_id))
      assert np.allclose(output, z)
  
imports: from __future__ import division
  import numpy
  import cntk
  import pytest
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  import cntk
  from cntk import Value
  from cntk.axis import Axis
  from cntk.internal import sanitize_dtype_cntk
  from ..None import constant
label_desc: Use image node_id 15 for calling a global function with example usage: test_gather_op_with_axis(device_id, precision) without return types