code: def test_range(self, gc, dc):
      names = [
          ("stop_",),
          ("start_", "stop_"),
          ("start_", "stop_", "step_"),
      ]
      # Most random values aren't great here, so use a fixed set instead of
      # hypothesis.
      for inputs in (
          (10,),
          (np.float32(10.0),),
          (0,),
          (0, 0),
          (10.0, 5.0, -1.0),
          (2, 10000),
          (2, 10000, 20000),
          (2, 10000, -1),
      ):
          inputs = [np.array(v) for v in inputs]
          op = core.CreateOperator(
              "Range", names[len(inputs) - 1], ["Y"]
          )
  
          self.assertReferenceChecks(
              device_option=gc,
              op=op,
              inputs=inputs,
              reference=lambda *x: [np.arange(*x)],
          )
          self.assertDeviceChecks(dc, op, inputs, [0])
  
      inputs = (np.array(0), np.array(10), np.array(0))
      op = core.CreateOperator("Range", names[len(inputs) - 1], ["Y"])
      with self.assertRaisesRegex(
          RuntimeError, "Step size cannot be 0"
      ):
          self.assertReferenceChecks(
              device_option=gc,
              op=op,
              inputs=inputs,
              reference=lambda *x: [np.arange(*x)],
          )
  
imports: from caffe2.python import core, workspace
  from hypothesis import assume, given, settings
  from caffe2.proto import caffe2_pb2
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  import hypothesis.strategies
  import numpy
  import random
label_desc: Use image node_id 14 for calling the TestUtilityOps obj's underlying member method code with example usage: obj.test_range(gc, dc) without return types