class_docstr: A layout to apply to a tensor.
  
  This API is aligned with `jax.sharding.NamedSharding`
  and `tf.dtensor.Layout`.
  
  See more details in [jax.sharding.NamedSharding](
      https://jax.readthedocs.io/en/latest/jax.sharding.html#jax.sharding.NamedSharding)
  and [tf.dtensor.Layout](
      https://www.tensorflow.org/api_docs/python/tf/experimental/dtensor/Layout).
  
  Args:
      axes: tuple of strings that should map to the `axis_names` in
          a `DeviceMesh`. For any dimentions that doesn't need any sharding,
          A `None` can be used a placeholder.
      device_mesh: Optional `DeviceMesh` that will be used to create
          the layout. The actual mapping of tensor to physical device
          is not known until the mesh is specified.
class_docstr_tok: ["A","layout","to","apply","to","a","tensor",".","This","API","is","aligned","with","`","jax.sharding.NamedSharding","`","and","`","tf.dtensor.Layout","`",".","See","more","details","in","[","jax.sharding.NamedSharding","]","(","https",":","\/\/jax.readthedocs.io\/en\/latest\/jax.sharding.html","#","jax.sharding.NamedSharding",")","and","[","tf.dtensor.Layout","]","(","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/experimental\/dtensor\/Layout",")",".","Args",":","axes",":","tuple","of","strings","that","should","map","to","the","`","axis_names","`","in","a","`","DeviceMesh","`",".","For","any","dimentions","that","does","n't","need","any","sharding",",","A","`","None","`","can","be","used","a","placeholder",".","device_mesh",":","Optional","`","DeviceMesh","`","that","will","be","used","to","create","the","layout",".","The","actual","mapping","of","tensor","to","physical","device","is","not","known","until","the","mesh","is","specified","."]
code: def __init__(self, axes, device_mesh=None):
      self._axes = tuple(axes)
      self._device_mesh = device_mesh
      self._validate_axes()
  
imports: import collections
  import contextlib
  import os
  import re
  import warnings
  import numpy
  from keras.api_export import keras_export
  from keras.backend import KerasTensor
  from keras.backend import distribution_lib
  from keras.backend.common import global_state
label_desc: Use image node_id 1 to create a new TensorLayout object  with example: obj = TensorLayout(axes, device_mesh)