aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/framework/ops.py
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2016-11-01 15:18:39 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-01 16:24:25 -0700
commitd8c94dba8f53626077b21f90df309577827a0f18 (patch)
tree951d8a1563e7cb1e5effa31a04f414333e13243e /tensorflow/python/framework/ops.py
parent07ae2d1d606fa3f8f3fb09bcf65b570b3c606173 (diff)
Remove weight_parameters from OpStats and graph_metrics.
Change: 137885496
Diffstat (limited to 'tensorflow/python/framework/ops.py')
-rw-r--r--tensorflow/python/framework/ops.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py
index 3e50a357cc..ac13f57b30 100644
--- a/tensorflow/python/framework/ops.py
+++ b/tensorflow/python/framework/ops.py
@@ -1881,23 +1881,21 @@ class RegisterStatistics(object):
Well-known types of statistics include these so far:
- - weight_parameters: For operations like MatMul, Conv, and BiasAdd that take
- learned weights as inputs, this statistic captures how many numerical values
- are used. This is good to know because the weights take up most of the size
- of a typical serialized graph on disk.
-
- flops: When running a graph, the bulk of the computation happens doing
numerical calculations like matrix multiplications. This type allows a node
to return how many floating-point operations it takes to complete. The
total number of FLOPs for a graph is a good guide to its expected latency.
You can add your own statistics just by picking a new type string, registering
- functions for the ops you care about, and then calling something like
- python/tools/graph_metrics.py with the new type as an argument.
+ functions for the ops you care about, and then calling get_stats_for_node_def.
If a statistic for an op is registered multiple times, a KeyError will be
raised.
+ Since the statistics is counted on a per-op basis. It is not suitable for
+ model parameters (capacity), which is expected to be counted only once, even
+ if it is shared by multiple ops. (e.g. RNN)
+
For example, you can define a new metric called doohickey for a Foo operation
by placing this in your code: