Watch keynotes, product sessions, workshops, and more from Google I/O See playlist


TensorFlow 1 version View source on GitHub

Mapping from logical cores in a computation to the physical TPU topology.

Prefer to use the helper to construct a DeviceAssignment; it is easier if less flexible than constructing a DeviceAssignment directly.

topology A Topology object that describes the physical TPU topology.
core_assignment A logical to physical core mapping, represented as a rank 3 numpy array. See the description of the core_assignment property for more details.

ValueError If topology is not Topology object.
ValueError If core_assignment is not a rank 3 numpy array.

core_assignment The logical to physical core mapping.
num_cores_per_replica The number of cores per replica.
num_replicas The number of replicas of the computation.
topology A Topology that describes the TPU topology.



View source


View source

Returns the physical topology coordinates of a logical core.


View source

Returns the CPU device attached to a logical core.


View source

Lookup replica ids by task number and logical core.

task_id TensorFlow task number.
logical_core An integer, identifying a logical core.

A sorted list of the replicas that are attached to that task and logical_core.

ValueError If no replica exists in the task which contains the logical core.


View source

Returns the name of the TPU device assigned to a logical core.


View source

Returns the ordinal of the TPU device assigned to a logical core.