diff options
author | 2016-10-12 13:48:18 -0800 | |
---|---|---|
committer | 2016-10-12 15:07:25 -0700 | |
commit | 25723e3f09f3d1986f756635e804665cc9b32f5d (patch) | |
tree | d3371501d573045ba9ea0b74e0d357baad659a0f /tensorflow/tensorboard/components/tf-graph-common/lib/render.ts | |
parent | c455f430183fbe5e81866dee43a23b41e3356d17 (diff) |
Checked for whether a node exists in the graph before extracting it due to high out-degree.
Change: 135964994
Diffstat (limited to 'tensorflow/tensorboard/components/tf-graph-common/lib/render.ts')
-rw-r--r-- | tensorflow/tensorboard/components/tf-graph-common/lib/render.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts index b4945eed10..3bea0061c6 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts @@ -1452,8 +1452,11 @@ function extractHighInOrOutDegree(renderNode: RenderGroupNodeInfo) { outDegreeUpperBound = Math.max(outDegreeUpperBound, minUpperBound); for (let i = validNodeCount - 1; nodeToOutDegree[sortedByOutDegree[i]] > outDegreeUpperBound; i--) { - if (graph.node(sortedByOutDegree[i]).isInExtract) { - // This node has already been extracted due to high in-degree. Ignore it. + let node = graph.node(sortedByOutDegree[i]); + if (!node || node.isInExtract) { + // This node has already been extracted due to high in-degree. It might + // have been removed from the graph in general (during in-degree + // extraction) due to a lack of neighbors. Do not extract this node twice. continue; } |