def _create_tpu_strategy(): resolver = cluster_resolver.TPUClusterResolver("") tpu_lib.initialize_tpu_system(resolver) strategy = tpu_lib.TPUStrategy(resolver, steps_per_run=steps_per_run, **kwargs) return strategy
def _create_tpu_strategy(): resolver = cluster_resolver.TPUClusterResolver("") topology = tpu_lib.initialize_tpu_system(resolver) device_assignment = None if use_single_core: device_assignment = device_assignment_lib.DeviceAssignment( topology, core_assignment=device_assignment_lib. SINGLE_CORE_ASSIGNMENT) strategy = tpu_lib.TPUStrategy(resolver, steps_per_run=steps_per_run, device_assignment=device_assignment, **kwargs) return strategy