code: def testInvalidIndicesForSparseTensorDenseMatmul(self):
      # TODO(b/169813429): Make GPU kernel return nice errors too.
      indices = np.array([[1, 10]]).astype(np.int64)
      values = np.array([10]).astype(np.float32)
      shape = [3, 2]
      sparse_t = sparse_tensor.SparseTensor(indices, values, shape)
  
      # Test multiplying by both a small and large dense matrix, to hit
      # both cases in the kernel.
      dense_t = np.array([[1] * 5, [2] * 5], dtype=np.float32)
      with self.assertRaisesOpError(
          "k .10. from index.0,1. out of bounds .>=2."
      ):
          self.evaluate(
              sparse_ops.sparse_tensor_dense_matmul(sparse_t, dense_t)
          )
      dense_t = np.array([[1] * 500, [2] * 500], dtype=np.float32)
      with self.assertRaisesOpError(
          "k .10. from index.0,1. out of bounds .>=2."
      ):
          self.evaluate(
              sparse_ops.sparse_tensor_dense_matmul(sparse_t, dense_t)
          )
  
      # Repeat with adjoint_a, to get a different error.
      dense_t = np.array([[1] * 5, [2] * 5, [3] * 5], dtype=np.float32)
      with self.assertRaisesOpError(
          "m .10. from index.0,1. out of bounds .>=2."
      ):
          self.evaluate(
              sparse_ops.sparse_tensor_dense_matmul(
                  sparse_t, dense_t, adjoint_a=True
              )
          )
      dense_t = np.array(
          [[1] * 500, [2] * 500, [3] * 500], dtype=np.float32
      )
      with self.assertRaisesOpError(
          "m .10. from index.0,1. out of bounds .>=2."
      ):
          self.evaluate(
              sparse_ops.sparse_tensor_dense_matmul(
                  sparse_t, dense_t, adjoint_a=True
              )
          )
  
imports: import sys
  import time
  from absl import app
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the SparseTensorDenseMatMulTest obj's underlying member method code with example usage: obj.testInvalidIndicesForSparseTensorDenseMatmul() without return types