aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/tfprof
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-08-15 21:39:28 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-15 21:42:58 -0700
commit2b51e0ba27af69c914a7523d9aae232de09e3206 (patch)
tree892089b4eca69784760e397f9bf1a5dd64dc9f18 /tensorflow/contrib/tfprof
parent8041185b16c0ce9348bd79900f6682fc3976bfd7 (diff)
1. Support profiling nodes in RunMetadata but not in GraphDef.
2. Add an API to allow easier profile retrieval. Currently in contrib. PiperOrigin-RevId: 165399640
Diffstat (limited to 'tensorflow/contrib/tfprof')
-rw-r--r--tensorflow/contrib/tfprof/BUILD1
-rw-r--r--tensorflow/contrib/tfprof/__init__.py16
-rw-r--r--tensorflow/contrib/tfprof/model_analyzer.py1
3 files changed, 17 insertions, 1 deletions
diff --git a/tensorflow/contrib/tfprof/BUILD b/tensorflow/contrib/tfprof/BUILD
index 4ff97e5d76..28adce71d4 100644
--- a/tensorflow/contrib/tfprof/BUILD
+++ b/tensorflow/contrib/tfprof/BUILD
@@ -16,6 +16,7 @@ py_library(
deps = [
"//tensorflow/python:util",
"//tensorflow/python/profiler:model_analyzer",
+ "//tensorflow/python/profiler:profile_context",
"//tensorflow/python/profiler:tfprof_logger",
],
)
diff --git a/tensorflow/contrib/tfprof/__init__.py b/tensorflow/contrib/tfprof/__init__.py
index 7a023e5d67..d5d3650e60 100644
--- a/tensorflow/contrib/tfprof/__init__.py
+++ b/tensorflow/contrib/tfprof/__init__.py
@@ -12,7 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
-"""tfprof is a tool that profile various aspect of TensorFlow model."""
+"""tfprof is a tool that profile various aspect of TensorFlow model.
+
+@@model_analyzer
+@@tfprof_logger
+
+@@ProfileContext
+"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
@@ -20,3 +26,11 @@ from __future__ import print_function
# pylint: disable=unused-import
from tensorflow.contrib.tfprof import model_analyzer
from tensorflow.contrib.tfprof import tfprof_logger
+
+from tensorflow.contrib.tfprof.model_analyzer import ProfileContext
+
+from tensorflow.python.util.all_util import remove_undocumented
+
+_allowed_symbols = ['model_analyzer', 'tfprof_logger', 'ProfileContext']
+
+remove_undocumented(__name__, _allowed_symbols)
diff --git a/tensorflow/contrib/tfprof/model_analyzer.py b/tensorflow/contrib/tfprof/model_analyzer.py
index d45c8f54c4..00bd0b4110 100644
--- a/tensorflow/contrib/tfprof/model_analyzer.py
+++ b/tensorflow/contrib/tfprof/model_analyzer.py
@@ -28,6 +28,7 @@ from tensorflow.python.profiler.model_analyzer import advise as _advise
from tensorflow.python.profiler.model_analyzer import ALL_ADVICE
from tensorflow.python.profiler.model_analyzer import profile as _profile
from tensorflow.python.profiler.model_analyzer import Profiler
+from tensorflow.python.profiler.profile_context import ProfileContext
from tensorflow.python.util.deprecation import deprecated
_DEFAULT_PROFILE_OPTIONS = 0