codecamp

TensorFlow函数教程:tf.profiler.write_op_log

tf.profiler.write_op_log函数

tf.profiler.write_op_log(
    graph,
    log_dir,
    op_log=None,
    run_meta=None,
    add_trace=True
)

定义在:tensorflow/python/profiler/tfprof_logger.py。

log提供了'op_log',并在下面添加其他模型信息。

API还将tf.trainable_variables()中的ops指定为名为“_trainable_variables”的op类型。API还会记录定义了op.RegisterStatistics()的ops的“flops”统计信息。flops计算取决于'graph'中定义的Tensor形状,这可能不完整。如果提供了'run_meta',则尽最大努力完成shape信息。

参数:

  • graph:tf.Graph。如果为“None”或者未启用“eager执行”,请使用默认图形。
  • log_dir:写入日志文件的目录。
  • op_log:(可选)要写入的OpLogProto原型。如果未提供,则创建新的。
  • run_meta:(可选)RunMetadata proto,可帮助使用运行时shape信息进行计算。
  • add_trace:是否添加python代码跟踪信息。用于支持“code”视图。
TensorFlow函数教程:tf.profiler.Profiler
tf.python_io概览
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }