class_docstr: Test cases for resource variable operators.
class_docstr_tok: ["Test","cases","for","resource","variable","operators","."]
code: def testScatterNdUpdateAddOps(self):
      with self.session() as sess, self.test_scope():
          handle = resource_variable_ops.var_handle_op(
              dtype=dtypes.float32, shape=[8]
          )
          sess.run(
              resource_variable_ops.assign_variable_op(
                  handle,
                  constant_op.constant([1] * 8, dtype=dtypes.float32),
              )
          )
          indices = constant_op.constant(
              [[4], [3], [1], [7]], dtype=dtypes.int32
          )
          updates = constant_op.constant(
              [9, 10, 11, 12], dtype=dtypes.float32
          )
          expected = np.array([1, 11, 1, 10, 9, 1, 1, 12])
          sess.run(
              gen_state_ops.resource_scatter_nd_update(
                  handle, indices, updates
              )
          )
          read = resource_variable_ops.read_variable_op(
              handle, dtype=dtypes.float32
          )
          self.assertAllClose(expected, self.evaluate(read))
  
imports: import re
  import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_state_ops
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import googletest
  from tensorflow.python.training.gradient_descent import GradientDescentOptimizer
label_desc: Use image node_id 27 for calling the VariableOpsTest obj's underlying member method code with example usage: obj.testScatterNdUpdateAddOps() without return types