Initializes the TPUStrategy object. Args: tpu_cluster_resolver: A tf.distribute.cluster_resolver.TPUClusterResolver, which provides information about the TPU cluster. steps_per_run: Number of steps to run on device before returning to the host. Note that this can
(self,
tpu_cluster_resolver=None,
steps_per_run=None,
device_assignment=None)
| 116 | """TPU distribution strategy implementation.""" |
| 117 | |
| 118 | def __init__(self, |
| 119 | tpu_cluster_resolver=None, |
| 120 | steps_per_run=None, |
| 121 | device_assignment=None): |
| 122 | """Initializes the TPUStrategy object. |
| 123 | |
| 124 | Args: |
| 125 | tpu_cluster_resolver: A tf.distribute.cluster_resolver.TPUClusterResolver, |
| 126 | which provides information about the TPU cluster. |
| 127 | steps_per_run: Number of steps to run on device before returning to the |
| 128 | host. Note that this can have side-effects on performance, hooks, |
| 129 | metrics, summaries etc. |
| 130 | This parameter is only used when Distribution Strategy is used with |
| 131 | estimator or keras. |
| 132 | device_assignment: Optional `tf.tpu.experimental.DeviceAssignment` to |
| 133 | specify the placement of replicas on the TPU cluster. Currently only |
| 134 | supports the usecase of using a single core within a TPU cluster. |
| 135 | """ |
| 136 | super(TPUStrategyV1, self).__init__(TPUExtended( |
| 137 | self, tpu_cluster_resolver, steps_per_run, device_assignment)) |
| 138 | |
| 139 | @property |
| 140 | def steps_per_run(self): |
nothing calls this directly
no test coverage detected