Skip to content
Snippets Groups Projects
Unverified Commit b2f8bc71 authored by auphelia's avatar auphelia Committed by GitHub
Browse files

[Transformation] Use util fct get_by_name to determine if padding is used

parent 435ff92c
No related branches found
No related tags found
No related merge requests found
...@@ -246,10 +246,9 @@ class MoveScalarAddPastConv(Transformation): ...@@ -246,10 +246,9 @@ class MoveScalarAddPastConv(Transformation):
conv_out_shape = model.get_tensor_shape(end_name) conv_out_shape = model.get_tensor_shape(end_name)
using_padding = True using_padding = True
for att_idx, attr in enumerate(consumer.attribute): pads = list(get_by_name(consumer.attribute, "pads").ints)
if attr.name == "pads": if sum(pads) == 0:
if sum(attr.ints) == 0: using_padding = False
using_padding = False
if all(x == 1 for x in A.shape) and not using_padding: if all(x == 1 for x in A.shape) and not using_padding:
# create a tensor filled with the add constant, in # create a tensor filled with the add constant, in
# the shape expected by the convolution # the shape expected by the convolution
......
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