aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/profiler/profiler.py
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-07-06 19:07:18 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-06 19:10:31 -0700
commit154df32a959df74b3a1c377ff72f955d755b3d34 (patch)
tree53be9964b971a2efee8a665a1070a6b54c199716 /tensorflow/python/profiler/profiler.py
parent5ff65ca53d37bf7fbc25e559a3b164796e9e7d05 (diff)
Follow up changes of tfprof migration:
1. Add a option_builder module to build options for Python API. 2. Expose necessary profiler protos. 3. Rename command line tool from tfprof to profiler. PiperOrigin-RevId: 161160274
Diffstat (limited to 'tensorflow/python/profiler/profiler.py')
-rw-r--r--tensorflow/python/profiler/profiler.py45
1 files changed, 35 insertions, 10 deletions
diff --git a/tensorflow/python/profiler/profiler.py b/tensorflow/python/profiler/profiler.py
index 19b253ab2f..130dcb5134 100644
--- a/tensorflow/python/profiler/profiler.py
+++ b/tensorflow/python/profiler/profiler.py
@@ -12,21 +12,46 @@
# 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.
-
-@@Profiler
-@@profile
-@@advise
-@@write_op_log
+"""profiler python module provides APIs to profile TensorFlow models.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
-# pylint: disable=unused-import,wildcard-import
-from tensorflow.python.profiler.model_analyzer import *
-from tensorflow.python.profiler.tfprof_logger import *
+# pylint: disable=unused-import
+from tensorflow.core.profiler.tfprof_log_pb2 import OpLogProto
+from tensorflow.core.profiler.tfprof_output_pb2 import AdviceProto
+from tensorflow.core.profiler.tfprof_output_pb2 import GraphNodeProto
+from tensorflow.core.profiler.tfprof_output_pb2 import MultiGraphNodeProto
+
+from tensorflow.python.profiler.model_analyzer import advise
+from tensorflow.python.profiler.model_analyzer import profile
+from tensorflow.python.profiler.model_analyzer import Profiler
+from tensorflow.python.profiler.option_builder import ProfileOptionBuilder
+from tensorflow.python.profiler.tfprof_logger import write_op_log
+
from tensorflow.python.util.all_util import remove_undocumented
-remove_undocumented(__name__, [])
+_allowed_symbols = [
+ 'Profiler',
+ 'profile',
+ 'ProfileOptionBuilder',
+ 'advise',
+ 'write_op_log',
+]
+
+_allowed_symbols.extend([
+ 'GraphNodeProto',
+ 'MultiGraphNodeProto',
+ 'AdviceProto',
+ 'OpLogProto',
+])
+
+remove_undocumented(__name__, _allowed_symbols, [
+ Profiler,
+ profile,
+ ProfileOptionBuilder,
+ advise,
+ write_op_log,
+])