Skip to content

Commit 0bf5398

Browse files
Neural-Link Teamtensorflow-copybara
authored andcommitted
Fixed a bug in read_tsv_graph() that was incrementing the edge_cnt too often.
PiperOrigin-RevId: 319143820
1 parent 3ab7b0b commit 0bf5398

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

neural_structured_learning/tools/graph_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ def read_tsv_graph(filename):
127127
with open(filename, 'rU') as f:
128128
for tsv_line in f:
129129
edge = tsv_line.rstrip('\n').split('\t')
130-
add_edge(graph, edge)
131-
edge_cnt += 1
130+
if add_edge(graph, edge): edge_cnt += 1
132131
logging.info('Done reading %d edges from: %s (%.2f seconds).', edge_cnt,
133132
filename, (time.time() - start_time))
134133
return graph

0 commit comments

Comments
 (0)