code: def test_variable_placer(self):
      sizes = [100, 0, 0, 0]
      device_list = ["cpu:0", "cpu:1", "cpu:2", "cpu:3"]
  
      with tf.Graph().as_default() as g:
          var_placer = mtf.utils.BalancedVariablePlacer(
              device_list, sizes
          )
          graph = mtf.Graph()
          mesh = mtf.Mesh(graph, "my_mesh", var_placer)
  
          hidden_dim = mtf.Dimension("hidden", 10)
          output_dim = mtf.Dimension("output_feature", 10)
  
          for i in xrange(5):
              # Each variable takes 400 Bytes, and will be placed from cpu:1.
              mtf.get_variable(
                  mesh, "w{}".format(i), [hidden_dim, output_dim]
              )
  
          for i in xrange(5):
              var = g.get_tensor_by_name("w{}:0".format(i))
              device = (i + 1) % len(device_list)
              self.assertEqual("cpu:{}".format(device), var.device)
  
file_path: mesh/mesh_tensorflow/utils_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  from six.moves import xrange
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_variable_placer() without return types