Commit 582ec017 authored by Yuxin Wu's avatar Yuxin Wu

add docs for tfutils.dependency

parent 8d888d30
...@@ -103,6 +103,14 @@ tensorpack.tfutils.export module ...@@ -103,6 +103,14 @@ tensorpack.tfutils.export module
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
tensorpack.tfutils.dependency module
------------------------------------
.. automodule:: tensorpack.tfutils.dependency
:members:
:undoc-members:
:show-inheritance:
Other functions in tensorpack.tfutils module Other functions in tensorpack.tfutils module
--------------------------------------------- ---------------------------------------------
......
...@@ -19,12 +19,13 @@ Then it is a good time to open an issue. ...@@ -19,12 +19,13 @@ Then it is a good time to open an issue.
## How to print/dump intermediate results during training ## How to print/dump intermediate results during training
1. Learn `tf.Print`. Most of the times, adding one line in between: 1. Learn `tf.Print`. Most of the times, adding one line in between:
```python
tensor = obtain_a_tensor() ```python
tensor = tf.Print(tensor, [tf.shape(tensor), tensor], tensor.name, summarize=100) tensor = obtain_a_tensor()
use_the_tensor(tensor) tensor = tf.Print(tensor, [tf.shape(tensor), tensor], tensor.name, summarize=100)
``` use_the_tensor(tensor)
is sufficient. ```
is sufficient.
2. Know [DumpTensors](../modules/callbacks.html#tensorpack.callbacks.DumpTensors), 2. Know [DumpTensors](../modules/callbacks.html#tensorpack.callbacks.DumpTensors),
[ProcessTensors](../modules/callbacks.html#tensorpack.callbacks.ProcessTensors) callbacks. [ProcessTensors](../modules/callbacks.html#tensorpack.callbacks.ProcessTensors) callbacks.
......
...@@ -25,7 +25,7 @@ def dependency_of_targets(targets, op): ...@@ -25,7 +25,7 @@ def dependency_of_targets(targets, op):
op (tf.Operation or tf.Tensor): op (tf.Operation or tf.Tensor):
Returns: Returns:
bool bool: True if any one of `targets` depend on `op`.
""" """
# TODO tensorarray? sparsetensor? # TODO tensorarray? sparsetensor?
if isinstance(op, tf.Tensor): if isinstance(op, tf.Tensor):
...@@ -48,7 +48,7 @@ def dependency_of_fetches(fetches, op): ...@@ -48,7 +48,7 @@ def dependency_of_fetches(fetches, op):
op (tf.Operation or tf.Tensor): op (tf.Operation or tf.Tensor):
Returns: Returns:
bool bool: True if any of `fetches` depend on `op`.
""" """
try: try:
from tensorflow.python.client.session import _FetchHandler as FetchHandler from tensorflow.python.client.session import _FetchHandler as FetchHandler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment