code: def testWriteShape(self):
      with self.session(), self.test_scope():
  
          def fn():
              ta = tensor_array_ops.TensorArray(
                  dtype=dtypes.float32, tensor_array_name="foo", size=3
              )
              c0 = constant_op.constant([4.0, 5.0])
              w0 = ta.write(0, c0)
              r0 = w0.read(0)
  
              return [c0, r0]
  
          c0, r0 = xla.compile(fn)
  
          self.assertAllEqual(c0.get_shape(), r0.get_shape())
  
          def fn():
              ta = tensor_array_ops.TensorArray(
                  dtype=dtypes.float32, tensor_array_name="foo", size=3
              )
              c1 = constant_op.constant([6.0, 7.0])
              w0 = ta.write(0, c0)
              w1 = w0.write(1, c1)
              r0 = w1.read(0)
              r1 = w1.read(1)
  
              return [r0, c1, r1]
  
          [r0, c1, r1] = xla.compile(fn)
  
          self.assertAllEqual(c0.get_shape(), r0.get_shape())
          self.assertAllEqual(c1.get_shape(), r1.get_shape())
  
          def fn():
              ta = tensor_array_ops.TensorArray(
                  dtype=dtypes.float32, tensor_array_name="foo", size=3
              )
              w0 = ta.write(0, c0)
              c2 = constant_op.constant([4.0, 5.0, 6.0])
              return w0.write(0, c2).flow
  
          with self.assertRaises(ValueError):
              self.evaluate(xla.compile(fn))
  
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 33 for calling the TensorArrayTest obj's underlying member method code with example usage: obj.testWriteShape() and returns: list, list, w0