tmoreau89 commented on a change in pull request #4887: [VTA] YoloV3 Support
URL: https://github.com/apache/incubator-tvm/pull/4887#discussion_r384722553
##########
File path: vta/python/vta/top/graphpack.py
##########
@@ -55,6 +57,46 @@ def _unpack_batch_channel(data, old_shape):
return data
+def _const_shape_match(data, dshape, cfactor_out):
+ """ Pad the constant if the shape[0] not divisible by cfactor_out.
+ """
+ pad_width = int(dshape[0]) % cfactor_out
+ if pad_width != 0:
+ pad_width = cfactor_out -pad_width
+ data = op.nn.pad(data, [[0, pad_width], [0, 0], [0, 0]])
+ dshape = tuple([dshape[0] + pad_width, dshape[1], dshape[2]])
+ return data, dshape
+
+def _weight_shape_match(data, dshape, channels, cfactor_out, transpose=False):
+ """ Pad the weight if the shape[0] not divisible by cfactor_out.
+ """
+ pad_width = int(dshape[0]) % cfactor_out
Review comment:
Same comment on assertion
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services