예제 #1
0
def watch_variable(tape, variable):
    """Marks this variable to be watched by the given tape."""
    strategy = distribution_strategy_context.get_distribution_strategy()
    if distribution_strategy_context.get_replica_context():
        variables = [strategy.value_container(variable)]
    else:
        variables = strategy.unwrap(variable)
    for var in variables:
        pywrap_tensorflow.TFE_Py_TapeWatchVariable(tape._tape, var)  # pylint: disable=protected-access
예제 #2
0
def watch_variable(tape, variable):
    """Marks this variable to be watched by the given tape."""
    strategy, context = (
        distribution_strategy_context.get_strategy_and_replica_context())
    if context:
        variables = [strategy.extended.value_container(variable)]
    else:
        variables = strategy.experimental_local_results(variable)
    for var in variables:
        pywrap_tensorflow.TFE_Py_TapeWatchVariable(tape._tape, var)  # pylint: disable=protected-access
예제 #3
0
파일: tape.py 프로젝트: neuroph12/CNNDDDD
def watch_variable(tape, variable):
    """Marks this variable to be watched by the given tape."""
    pywrap_tensorflow.TFE_Py_TapeWatchVariable(tape._tape, variable)  # pylint: disable=protected-access
예제 #4
0
파일: tape.py 프로젝트: zabzyliu/tensorflow
 def watch_variable(self, v):
     pywrap_tensorflow.TFE_Py_TapeWatchVariable(self._tape, v)