Merge pull request #19417 from LupusSanctus:am/text_graph_identity

* Corrected SSD text graph generation for Identity nodes

* Added minor code corrections
This commit is contained in:
Anastasia M 2021-02-17 21:01:41 +03:00 committed by GitHub
parent 8d21c84e7d
commit eb90186614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,7 +270,11 @@ def removeIdentity(graph_def):
identities = {}
for node in graph_def.node:
if node.op == 'Identity' or node.op == 'IdentityN':
identities[node.name] = node.input[0]
inp = node.input[0]
if inp in identities:
identities[node.name] = identities[inp]
else:
identities[node.name] = inp
graph_def.node.remove(node)
for node in graph_def.node: