code: def testShapeInferenceSlice(self):
      model = model_helper.ModelHelper(name="test_model")
      model.net.Slice(
          ["x"], ["y"], starts=[0, 0, 0, 0], ends=[-1, -1, -3, -1]
      )
      workspace.FeedBlob(
          "x", np.random.rand(64, 1, 255, 384).astype(np.float32)
      )
  
      slice_starts = np.array([0, 0, 0, 0]).astype(np.int32)
      slice_ends = np.array([-1, -1, -3, -1]).astype(np.int32)
      slice_starts = model.net.GivenTensorIntFill(
          [], shape=[4], values=slice_starts
      )
      slice_ends = model.net.GivenTensorIntFill(
          [], shape=[4], values=slice_ends
      )
      model.net.Slice(["x2", slice_starts, slice_ends], ["y2"])
      workspace.FeedBlob(
          "x2", np.random.rand(64, 1, 255, 384).astype(np.float32)
      )
  
      self.InferTensorRunAndCompare(model, ["y2"])
  
imports: import numpy
  import unittest
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, workspace, test_util, model_helper, brew, build
label_desc: Use image node_id 4 for calling the TestShapeInference obj's underlying member method code with example usage: obj.testShapeInferenceSlice() without return types