1# Copyright 2016 The TensorFlow Authors. All Rights Reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# ============================================================================== 15"""profiler python module provides APIs to profile TensorFlow models. 16""" 17from __future__ import absolute_import 18from __future__ import division 19from __future__ import print_function 20 21# pylint: disable=unused-import 22from tensorflow.core.profiler.tfprof_log_pb2 import OpLogProto 23from tensorflow.core.profiler.tfprof_output_pb2 import AdviceProto 24from tensorflow.core.profiler.tfprof_output_pb2 import GraphNodeProto 25from tensorflow.core.profiler.tfprof_output_pb2 import MultiGraphNodeProto 26 27from tensorflow.python.profiler.model_analyzer import advise 28from tensorflow.python.profiler.model_analyzer import profile 29from tensorflow.python.profiler.model_analyzer import Profiler 30from tensorflow.python.profiler.option_builder import ProfileOptionBuilder 31from tensorflow.python.profiler.tfprof_logger import write_op_log 32 33from tensorflow.python.util.tf_export import tf_export 34 35 36_allowed_symbols = [ 37 'Profiler', 38 'profile', 39 'ProfileOptionBuilder', 40 'advise', 41 'write_op_log', 42] 43 44_allowed_symbols.extend([ 45 'GraphNodeProto', 46 'MultiGraphNodeProto', 47 'AdviceProto', 48 'OpLogProto', 49]) 50 51# Export protos 52tf_export(v1=['profiler.GraphNodeProto'])(GraphNodeProto) 53tf_export(v1=['profiler.MultiGraphNodeProto'])(MultiGraphNodeProto) 54tf_export(v1=['profiler.AdviceProto'])(AdviceProto) 55tf_export(v1=['profiler.OpLogProto'])(OpLogProto) 56