(strategy)
| 582 | |
| 583 | @contextlib.contextmanager |
| 584 | def _enter_or_assert_strategy(strategy): |
| 585 | if not distribution_strategy_context.has_strategy(): |
| 586 | with strategy.scope(): |
| 587 | yield |
| 588 | else: |
| 589 | _assert_strategy(strategy) |
| 590 | yield |
| 591 | |
| 592 | |
| 593 | DistributedVarOp = collections.namedtuple( |
no test coverage detected