code: def layout(mtf_graph, mesh_shape, mtf_outputs=()):
      """Compute layout rules based on a computational graph and mesh shape.
  
      Args:
        mtf_graph: a mtf.Graph.
        mesh_shape: an mtf.Shape, str, or listlike of mtf.Dimension.
        mtf_outputs: an optional iterable of mtf.Tensor, representing the outputs
            of the computation.
  
      Returns:
        a mtf.LayoutRules
      """
      mesh_shape = mtf.convert_to_shape(mesh_shape)
      estimator = memory_estimator.MemoryEstimator(
          mtf_graph, mesh_shape, mtf_outputs
      )
      optimizer = layout_optimizer.LayoutOptimizer(estimator)
      return mtf.convert_to_layout_rules(optimizer.solve())
  
file_path: mesh/mesh_tensorflow/auto_mtf/api.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  from mesh_tensorflow.auto_mtf import layout_optimizer
  from mesh_tensorflow.auto_mtf import memory_estimator
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: layout(mtf_graph, mesh_shape, mtf_outputs) and returns: mtf