code: def ref_gather(axis):
      def inner(data, ind):
          if ind.size == 0 or data.shape[axis] == 0:
              shape = list(data.shape)
              shape[0] = 0
              return [np.zeros(tuple(shape)).astype(np.float32)]
          # np.take() does axis lookup same as gather
          output = data.take(ind, axis).astype(np.float32)
          return [output]
  
      return inner
  
imports: import numpy
  from caffe2.python import core, workspace
  from hypothesis import given, settings
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  import hypothesis.strategies
  import hypothesis.extra.numpy
label_desc: Use image node_id 2 for calling a global function with example usage: ref_gather(axis) and returns: inner, list, list