class_docstr: Mapping from logical cores in a computation to the physical TPU topology.
  
  Prefer to use the `DeviceAssignment.build()` helper to construct a
  `DeviceAssignment`; it is easier if less flexible than constructing a
  `DeviceAssignment` directly.
class_docstr_tok: ["Mapping","from","logical","cores","in","a","computation","to","the","physical","TPU","topology",".","Prefer","to","use","the","`","DeviceAssignment.build","(",")","`","helper","to","construct","a","`","DeviceAssignment","`",";","it","is","easier","if","less","flexible","than","constructing","a","`","DeviceAssignment","`","directly","."]
code: def build(
      cls,
      topology: Topology,
      computation_shape: Optional[np.ndarray] = None,
      computation_stride: Optional[np.ndarray] = None,
      num_replicas: int = 1,
      device_order_mode: DeviceOrderMode = DeviceOrderMode.AUTO,
  ) -> "DeviceAssignment":
      return device_assignment(
          topology=topology,
          computation_shape=computation_shape,
          computation_stride=computation_stride,
          num_replicas=num_replicas,
          device_order_mode=device_order_mode,
      )
  
imports: import enum
  import math
  from typing import List, Optional, Tuple
  import numpy
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.tpu.topology import Topology
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 11 for calling the DeviceAssignment obj's underlying member method code with example usage: obj.build(cls, topology, computation_shape, computation_stride, num_replicas, device_order_mode) and returns: device_assignment