code: def test_sparse_lengths_sum_8BitsRowwiseOp_cpu_invalid_index(
      self, batchsize, blocksize, normalize_by_lengths, gc, dc
  ):
      tblsize = 300
      Tbl = np.random.randint(
          7, size=(tblsize, blocksize), dtype=np.uint8
      )
  
      # array of each row length
      Lengths = np.random.randint(1, 30, size=batchsize, dtype=np.int32)
      # flat indices
      Indices = np.random.randint(
          0, tblsize, size=sum(Lengths), dtype=np.int64
      )
      Indices[0] += 1000
      Scale_Bias = np.random.rand(tblsize, 2).astype(np.float32)
  
      op = core.CreateOperator(
          "SparseLengths"
          + ("Mean" if normalize_by_lengths else "Sum")
          + "8BitsRowwise",
          ["Tbl", "Indices", "Lengths", "Scale_Bias"],
          "out",
      )
  
      self.ws.create_blob("Tbl").feed(Tbl)
      self.ws.create_blob("Indices").feed(Indices)
      self.ws.create_blob("Lengths").feed(Lengths)
      self.ws.create_blob("Scale_Bias").feed(Scale_Bias)
      with self.assertRaises(RuntimeError):
          self.ws.run(op)
  
file_path: pytorch/caffe2/python/operator_test/specialized_segment_ops_test.py
imports: import unittest
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core
  import caffe2.python.hip_test_util
  import caffe2.python.hypothesis_test_util
  import hypothesis.strategies
  import numpy
  from hypothesis import given, assume, settings
label_desc: Use image node_id 5 for calling the TestSpecializedSegmentOps obj's underlying member method code with example usage: obj.test_sparse_lengths_sum_8BitsRowwiseOp_cpu_invalid_index(batchsize, blocksize, normalize_by_lengths, gc, dc) without return types