def MirroredStrategyEnabled() -> bool: r""" Returns: bool: `True` if mirrored strategy is enabled in current context where this function is called. """ return distribute_ctx.IsMirroredStrategyEnabled()
def CurJobAddOp(op_conf, scope_symbol=None): if distribute_ctx.IsMirroredStrategyEnabled(): return CurJobAddMirroredOp(op_conf, scope_symbol) return CurJobAddConsistentOp(op_conf, scope_symbol)