code: def testSumOfTwoReadVariablesWithoutRepeatGrad(self):
      with self.session() as session, self.test_scope():
          g0 = -(np.arange(3 * 5, dtype=np.float32).reshape(3, 5) + 1)
  
          def fn():
              a = array_ops.identity(
                  np.arange(3 * 5, dtype=np.float32).reshape(3, 5) + 1
              )
              b = array_ops.identity(
                  np.arange(3 * 5, dtype=np.float32).reshape(3, 5)
                  + 1
                  + 3 * 5
              )
              ta = tensor_array_ops.TensorArray(
                  dtype=dtypes.float32, size=2
              )
              ta = ta.write(0, a, name="write_a")
              ta = ta.write(1, b, name="write_b")
              c = ta.read(0, name="read_a_0") + ta.read(  # a + b
                  1, name="read_b_0"
              )
              grad_a = gradients_impl.gradients([c], [a], [g0])[
                  0
              ]  # d(a+b)/da = 1
              grad_b = gradients_impl.gradients([c], [b], [g0])[
                  0
              ]  # d(a+b)/db = 1
  
              return [grad_a, grad_b]
  
          grad_a, grad_b = xla.compile(fn)
  
          # Test gradients calculated individually
          (grad_a_t,) = self.evaluate([grad_a])
          self.assertAllEqual(grad_a_t, g0)
  
          (grad_b_t,) = self.evaluate([grad_b])
          self.assertAllEqual(grad_b_t, g0)
  
          # Test gradients calculated jointly.
          joint_grad_a_t, joint_grad_b_t = self.evaluate(
              [grad_a, grad_b]
          )
          self.assertAllEqual(joint_grad_a_t, g0)
          self.assertAllEqual(joint_grad_b_t, g0)
  
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.compiler.xla import xla
  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 control_flow_util
  from tensorflow.python.ops import gen_data_flow_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import tensor_array_grad
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 32 for calling the TensorArrayTest obj's underlying member method code with example usage: obj.testSumOfTwoReadVariablesWithoutRepeatGrad() and returns: list