We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ab7b0b commit 0bf5398Copy full SHA for 0bf5398
neural_structured_learning/tools/graph_utils.py
@@ -127,8 +127,7 @@ def read_tsv_graph(filename):
127
with open(filename, 'rU') as f:
128
for tsv_line in f:
129
edge = tsv_line.rstrip('\n').split('\t')
130
- add_edge(graph, edge)
131
- edge_cnt += 1
+ if add_edge(graph, edge): edge_cnt += 1
132
logging.info('Done reading %d edges from: %s (%.2f seconds).', edge_cnt,
133
filename, (time.time() - start_time))
134
return graph
0 commit comments