Returns the device name for a core in a replicated TPU computation. Args: num: the virtual core number within each replica to which operators should be assigned. Returns: A device name, suitable for passing to `tf.device()`.
(num)
| 152 | |
| 153 | @tf_export(v1=["tpu.core"]) |
| 154 | def core(num): |
| 155 | """Returns the device name for a core in a replicated TPU computation. |
| 156 | |
| 157 | Args: |
| 158 | num: the virtual core number within each replica to which operators should |
| 159 | be assigned. |
| 160 | Returns: |
| 161 | A device name, suitable for passing to `tf.device()`. |
| 162 | """ |
| 163 | return "device:TPU_REPLICATED_CORE:{}".format(num) |
| 164 | |
| 165 | |
| 166 | def _enclosing_tpu_context_and_graph(): |
no test coverage detected