code: def setUp(self):
      super(LayoutPropagationV2Test, self).setUp()
      global_ids = test_util.create_device_ids_array((1, 2))
      local_ids = np.ravel(global_ids).tolist()
      mesh_dict = {  # pylint: disable=g-complex-comprehension
          device: layout.Mesh(
              [_MESH_DIM_X, _MESH_DIM_Y],
              global_ids,
              local_ids,
              test_util.create_device_list((1, 2), device),
          )
          for device in ("CPU", "GPU", "TPU")
      }
      self.mesh = self.configTestMesh(mesh_dict)
      # 1D Layouts
      self.unsharded_layout = layout.Layout.replicated(
          self.mesh, rank=1
      )
      self.x_layout = layout.Layout.batch_sharded(
          self.mesh, _MESH_DIM_X, rank=1
      )
      self.y_layout = layout.Layout.batch_sharded(
          self.mesh, _MESH_DIM_Y, rank=1
      )
  
      # 2D Layouts
      self.unsharded_unsharded_layout = layout.Layout.replicated(
          self.mesh, rank=2
      )
      self.x_unsharded_layout = layout.Layout.batch_sharded(
          self.mesh, _MESH_DIM_X, rank=2
      )
      self.unsharded_x_layout = layout.Layout.inner_sharded(
          self.mesh, _MESH_DIM_X, rank=2
      )
      self.unsharded_y_layout = layout.Layout.inner_sharded(
          self.mesh, _MESH_DIM_Y, rank=2
      )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import d_variable
  from tensorflow.dtensor.python import layout
  from tensorflow.dtensor.python import numpy_util
  from tensorflow.dtensor.python.tests import test_util
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the LayoutPropagationV2Test obj's underlying member method code with example usage: obj.setUp() without return types