aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar James Wexler <james_wexler@yahoo.com>2016-04-21 15:51:49 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-04-21 17:02:46 -0700
commit63c06935aea613ccb5bcaef5e03512b96455c6db (patch)
tree529b9d9eb408f66be30e950acf6c45b453f710c9
parent18429eb67a947f9535e5e9755e8c469511af0d01 (diff)
Fix run_metadata display issues.
Check for existance of runtime information in a run metadata node before converting it to a number. Also ignore any negative numbers seen for memory or runtime. Change: 120499626
-rw-r--r--tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts23
1 files changed, 20 insertions, 3 deletions
diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts
index 71d3bbd059..0397907991 100644
--- a/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts
+++ b/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts
@@ -395,11 +395,28 @@ export function joinStatsInfoWithGraph(graph: SlimGraph,
let totalBytes = 0;
if (nodeStats.memory) {
_.each(nodeStats.memory, alloc => {
- if (alloc.total_bytes) {
- totalBytes += Number(alloc.total_bytes);
+ if (alloc.total_bytes) {
+ if (alloc.total_bytes > 0) {
+ totalBytes += Number(alloc.total_bytes);
+ } else {
+ /* tslint:disable */
+ console.log(
+ "ignoring negative memory allocation for " + nodeName);
+ /* tslint:enable */
+ }
}
});
}
+ let totalMicroSeconds = 0;
+ if (nodeStats.all_end_rel_micros) {
+ if (nodeStats.all_end_rel_micros > 0) {
+ totalMicroSeconds = Number(nodeStats.all_end_rel_micros);
+ } else {
+ /* tslint:disable */
+ console.log("ignoring negative runtime for " + nodeName);
+ /* tslint:enable */
+ }
+ }
let outputSize: number[][] = null;
if (nodeStats.output) {
outputSize = _.map(nodeStats.output, output => {
@@ -409,7 +426,7 @@ export function joinStatsInfoWithGraph(graph: SlimGraph,
}
graph.nodes[nodeName].device = devStats.device;
graph.nodes[nodeName].stats = new NodeStats(totalBytes,
- Number(nodeStats.all_end_rel_micros), outputSize);
+ totalMicroSeconds, outputSize);
});
});
}