class_docstr: Describes a set of TPU devices.
  
  Represents both the shape of the physical mesh, and the mapping between
  TensorFlow TPU devices to physical mesh coordinates.
class_docstr_tok: ["Describes","a","set","of","TPU","devices",".","Represents","both","the","shape","of","the","physical","mesh",",","and","the","mapping","between","TensorFlow","TPU","devices","to","physical","mesh","coordinates","."]
docstr: Inverts a [task,device,axis] topology to [x,y,z] -> task/device maps.
docstr_tok: ["Inverts","a","[","task",",","device",",","axis","]","topology","to","[","x",",","y",",","z","]","-",">","task\/device","maps","."]
code: def _invert_topology(self):
      """Inverts a [task,device,axis] topology to [x,y,z] -> task/device maps."""
      tasks = np.full(list(self.mesh_shape), -1, dtype=np.int32)
      devices = np.full(list(self.mesh_shape), -1, dtype=np.int32)
      for task in range(self.device_coordinates.shape[0]):
          for device in range(self.device_coordinates.shape[1]):
              x, y, z, core = self.device_coordinates[task, device, :]
              tasks[x, y, z, core] = task
              devices[x, y, z, core] = device
      return tasks, devices
  
imports: import numpy
  from tensorflow.core.protobuf.tpu import topology_pb2
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 3 for calling the Topology obj's underlying member method code with example usage: obj._invert_topology() and returns: tasks,  devices