Skip to content
Snippets Groups Projects
Commit cd705c6d authored by Hendrik Borras's avatar Hendrik Borras
Browse files

Added support for moving scalar ops, which are not flat.

parent cbdfcfc3
No related branches found
No related tags found
No related merge requests found
......@@ -623,6 +623,10 @@ class MoveScalarLinearPastInvariants(Transformation):
# if initializer is not scalar, skip
if np.prod(init0.shape) != 1:
continue
# Flatten input if required
if len(init0.shape) > 0:
init0 = init0.flatten()[0]
model.set_initializer(prod0.input[1], init0)
# move prod0 from input to output,
old_prod0_in = prod0.input[0]
old_prod0_out = prod0.output[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment