class_docstr: Represents a Mesh configuration over a certain list of Mesh Dimensions.
  
  A mesh consists of named dimensions with sizes, which describe how a set of
  devices are arranged. Defining tensor layouts in terms of mesh dimensions
  allows us to efficiently determine the communication required when computing
  an operation with tensors of different layouts.
  
  A mesh provides information not only about the placement of the tensors but
  also the topology of the underlying devices. For example, we can group 8 TPUs
  as a 1-D array for data parallelism or a `2x4` grid for (2-way) data
  parallelism and (4-way) model parallelism.
  
  Refer to [DTensor Concepts](https://www.tensorflow.org/guide/dtensor_overview)
  for in depth discussion and examples.
  
  Note: the utilities `dtensor.create_mesh` and
  `dtensor.create_distributed_mesh` provide a simpler API to create meshes for
  single- or multi-client use cases.
class_docstr_tok: ["Represents","a","Mesh","configuration","over","a","certain","list","of","Mesh","Dimensions",".","A","mesh","consists","of","named","dimensions","with","sizes",",","which","describe","how","a","set","of","devices","are","arranged",".","Defining","tensor","layouts","in","terms","of","mesh","dimensions","allows","us","to","efficiently","determine","the","communication","required","when","computing","an","operation","with","tensors","of","different","layouts",".","A","mesh","provides","information","not","only","about","the","placement","of","the","tensors","but","also","the","topology","of","the","underlying","devices",".","For","example",",","we","can","group","8","TPUs","as","a","1-D","array","for","data","parallelism","or","a","`","2x4","`","grid","for","(","2-way",")","data","parallelism","and","(","4-way",")","model","parallelism",".","Refer","to","[","DTensor","Concepts","]","(","https",":","\/\/www.tensorflow.org\/guide\/dtensor_overview",")","for","in","depth","discussion","and","examples",".","Note",":","the","utilities","`","dtensor.create_mesh","`","and","`","dtensor.create_distributed_mesh","`","provide","a","simpler","API","to","create","meshes","for","single-","or","multi-client","use","cases","."]
docstr: Returns the strides tensor array for this mesh.
  
  If the mesh shape is `[a, b, c, d]`, then the strides array can be computed
  as `[b*c*d, c*d, d, 1]`. This array can be useful in computing local device
  offsets given a device ID. Using the same example, the device coordinates of
  the mesh can be computed as:
  
  ```
  [(device_id / (b*c*d)) % a,
   (device_id / (c*d))   % b,
   (device_id / (d))     % c,
   (device_id)           % d]
  ```
  
  This is the same as `(device_id // mesh.strides) % mesh.shape`.
  
  Returns:
    The mesh strides as an integer tensor.
docstr_tok: ["Returns","the","strides","tensor","array","for","this","mesh",".","If","the","mesh","shape","is","`","[","a",",","b",",","c",",","d","]","`",",","then","the","strides","array","can","be","computed","as","`","[","b","*","c","*","d",",","c","*","d",",","d",",","1","]","`",".","This","array","can","be","useful","in","computing","local","device","offsets","given","a","device","ID",".","Using","the","same","example",",","the","device","coordinates","of","the","mesh","can","be","computed","as",":","``","`","[","(","device_id","\/","(","b","*","c","*","d",")",")","%","a",",","(","device_id","\/","(","c","*","d",")",")","%","b",",","(","device_id","\/","(","d",")",")","%","c",",","(","device_id",")","%","d","]","``","`","This","is","the","same","as","`","(","device_id","\/\/","mesh.strides",")","%","mesh.shape","`",".","Returns",":","The","mesh","strides","as","an","integer","tensor","."]
code: def strides(self) -> List[int]:
      """Returns the strides tensor array for this mesh.
  
      If the mesh shape is `[a, b, c, d]`, then the strides array can be computed
      as `[b*c*d, c*d, d, 1]`. This array can be useful in computing local device
      offsets given a device ID. Using the same example, the device coordinates of
      the mesh can be computed as:
  
      ```
      [(device_id / (b*c*d)) % a,
       (device_id / (c*d))   % b,
       (device_id / (d))     % c,
       (device_id)           % d]
      ```
  
      This is the same as `(device_id // mesh.strides) % mesh.shape`.
  
      Returns:
        The mesh strides as an integer tensor.
      """
      return _compute_mesh_strides(self.shape())
  
imports: import collections
  import functools
  import itertools
  from typing import List, Dict, Optional, Union
  import numpy
  from tensorflow.dtensor.proto import layout_pb2
  from tensorflow.python import _pywrap_dtensor_device
  from tensorflow.python.framework import device
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 16 for calling the Mesh obj's underlying member method code with example usage: obj.strides() and returns: _compute_mesh_strides