class_docstr: Tests for mesh_util that require accelerator initialization.
class_docstr_tok: ["Tests","for","mesh_util","that","require","accelerator","initialization","."]
code: def test_distributed_tpu_mesh_creation(self):
      self.skipForDeviceType(
          ["CPU", "GPU"], reason="Test is intended for TPUs"
      )
      self.skipForDeviceType(
          ["TPU"],
          reason="Test requires exactly 8 cores",
          unless_device_count_equals_to=8,
      )
  
      num_devices = len(test_util.list_local_logical_devices("TPU"))
      mesh = mesh_util.create_distributed_mesh(
          mesh_name="distributed_1d_mesh",
          mesh_dims=[("x", num_devices)],
          device_type="TPU",
      )
      self.assertEqual(mesh.num_local_devices(), 8)
      self.assertEqual(mesh.size, 8)
  
imports: import os
  from unittest import mock
  from absl.testing import parameterized
  from tensorflow.dtensor.python import accelerator_util
  from tensorflow.dtensor.python import config
  from tensorflow.dtensor.python import mesh_util
  from tensorflow.dtensor.python.tests import test_util
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import device
  from tensorflow.python.platform import test
label_desc: Use image node_id 11 for calling the InitializedMeshUtilTest obj's underlying member method code with example usage: obj.test_distributed_tpu_mesh_creation() without return types