code: def testMeshImpl(self):
      shape = mtf.Shape(
          [mtf.Dimension("batch", 4), mtf.Dimension("model", 8)]
      )
      layout_rules = mtf.LayoutRules(
          [("batch", "batch"), ("d_ff", "model"), ("heads", "model")]
      )
      mesh_impl = mtf.MeshImpl(shape=shape, layout_rules=layout_rules)
      self.assertEqual(mesh_impl.shape, shape)
      self.assertLen(shape, mesh_impl.ndims)
      self.assertEqual(mesh_impl.layout_rules, layout_rules)
      self.assertEqual(mesh_impl.size, shape.size)
      self.assertTrue(mesh_impl.supports_control_dependencies)
  
      batch = mtf.Dimension("batch", 128)
      length = mtf.Dimension("length", 500)
      d_ff = mtf.Dimension("d_ff", 2048)
      heads = mtf.Dimension("heads", 8)
      self.assertEqual(
          mesh_impl.tensor_dimension_to_mesh_axis(batch), 0
      )
      self.assertEqual(mesh_impl.tensor_dimension_to_mesh_axis(d_ff), 1)
      self.assertEqual(
          mesh_impl.tensor_dimension_to_mesh_axis(heads), 1
      )
      self.assertEqual(
          mesh_impl.tensor_layout(mtf.Shape([batch, length, d_ff])),
          mtf.TensorLayout([0, None, 1]),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import mesh_tensorflow
  from mesh_tensorflow import test_utils
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 12 for calling the MeshTensorFlowTest obj's underlying member method code with example usage: obj.testMeshImpl() without return types