code: def testUpdateSlice(self):
      for dtype in self.numeric_types:
          self._assertOpOutputMatchesExpected(
              xla.dynamic_update_slice,
              [
                  np.array([], dtype=dtype),
                  np.array([], dtype=dtype),
                  np.array([0], dtype=np.int32),
              ],
              expected=np.array([], dtype=dtype),
          )
  
          self._assertOpOutputMatchesExpected(
              xla.dynamic_update_slice,
              [
                  np.array(
                      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=dtype
                  ),
                  np.array([-1, -2, -3], dtype=dtype),
                  np.array([6], dtype=np.int32),
              ],
              expected=np.array(
                  [1, 2, 3, 4, 5, 6, -1, -2, -3, 10], dtype=dtype
              ),
          )
  
          self._assertOpOutputMatchesExpected(
              xla.dynamic_update_slice,
              [
                  np.array(
                      [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]],
                      dtype=dtype,
                  ),
                  np.array([[42, 43], [44, 45]], dtype=dtype),
                  np.array([1, 2], dtype=np.int32),
              ],
              expected=np.array(
                  [[1, 2, 3, 4], [5, 6, 42, 43], [9, 10, 44, 45]],
                  dtype=dtype,
              ),
          )
  
          self._assertOpOutputMatchesExpected(
              xla.dynamic_update_slice,
              [
                  np.array(
                      [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]],
                      dtype=dtype,
                  ),
                  np.array([[], []], dtype=dtype),
                  np.array([1, 2], dtype=np.int32),
              ],
              expected=np.array(
                  [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]],
                  dtype=dtype,
              ),
          )
  
          self._assertOpOutputMatchesExpected(
              xla.dynamic_update_slice,
              [
                  np.array(
                      [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]],
                      dtype=dtype,
                  ),
                  np.ones([3, 4], dtype=dtype),
                  np.array([0, 0], dtype=np.int32),
              ],
              expected=np.ones([3, 4], dtype=dtype),
          )
  
file_path: tensorflow-upstream/tensorflow/compiler/tests/dynamic_slice_ops_test.py
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.compiler.tf2xla.python import xla
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the DynamicUpdateSliceOpsTest obj's underlying member method code with example usage: obj.testUpdateSlice() without return types