code: def testParallelUpdateWithLocking(self):
      # We need each thread to keep its own device stack or the device scopes
      # won't be properly nested.
      ops.get_default_graph().switch_to_thread_local()
      with self.cached_session() as sess:
          zeros_t = array_ops.fill([1024, 1024], 0.0)
          ones_t = array_ops.fill([1024, 1024], 1.0)
          p = variables.Variable(zeros_t)
          adds = [
              state_ops.assign_add(p, ones_t, use_locking=True)
              for _ in range(20)
          ]
          self.evaluate(p.initializer)
  
          def run_add(add_op):
              self.evaluate(add_op)
  
          threads = [
              self.checkedThread(target=run_add, args=(add_op,))
              for add_op in adds
          ]
          for t in threads:
              t.start()
          for t in threads:
              t.join()
  
          vals = self.evaluate(p)
          ones = np.ones((1024, 1024)).astype(np.float32)
          self.assertAllEqual(vals, ones * 20)
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/variables/dense_update_ops_no_tsan_test.py
imports: import numpy
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the AssignOpTest obj's underlying member method code with example usage: obj.testParallelUpdateWithLocking() without return types