Skip to content

Commit

Permalink
Identityが出力先を1つしか認めないため、DropoutをIdentityに変換するときはmask用の出力先を削るよう修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Masato Hori committed Feb 2, 2018
1 parent f3206ed commit e0c9bd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/test/utils/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ def convert_to_function(node, base_name, func_counter):
# by using the Identity function
func.ClearField("dropout_param")
func.type = "Identity"

if len(node.output) > 1:
# Identity only allows a single output,
# while a dropout node may have two outputs (result + mask)
# We will drop the mask output (which should be the second one)
del func.output[:]
func.output.extend([node.output[0]])
# We break here so we don't write any needless attributes
break
elif attr.name == "ratio":
Expand Down

0 comments on commit e0c9bd3

Please sign in to comment.