コード例 #1
0
ファイル: context.py プロジェクト: zuozi2810/tensorflow
    def add_function(self, fn):
        """Add a function definition to the context.

    Once added, the function (identified by its name) can be executed like any
    other operation.

    Args:
      fn: A wrapped TF_Function (returned from TF_GraphToFunction_wrapper).
    """
        pywrap_tensorflow.TFE_ContextAddFunction(self._handle, fn)
コード例 #2
0
ファイル: context.py プロジェクト: ShalaXD/tensorflow
    def add_function(self, fn):
        """Add a function definition to the context.

    Once added, the function (identified by its name) can be executed like any
    other operation.

    Args:
      fn: A wrapped TF_Function (returned from TF_GraphToFunction_wrapper).
    """
        with errors.raise_exception_on_not_ok_status() as status:
            pywrap_tensorflow.TFE_ContextAddFunction(
                self._handle,  # pylint: disable=protected-access
                fn,
                status)