diff options
author | 2016-04-21 15:51:49 -0800 | |
---|---|---|
committer | 2016-04-21 17:02:46 -0700 | |
commit | 63c06935aea613ccb5bcaef5e03512b96455c6db (patch) | |
tree | 529b9d9eb408f66be30e950acf6c45b453f710c9 | |
parent | 18429eb67a947f9535e5e9755e8c469511af0d01 (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.ts | 23 |
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); }); }); } |