zotanika commented on a change in pull request #8015:
URL: https://github.com/apache/tvm/pull/8015#discussion_r634074541
##########
File path: tests/python/frontend/caffe/test_forward.py
##########
@@ -763,6 +763,37 @@ def test_forward_TanH():
_test_tanh(np.random.rand(10).astype(np.float32))
+#######################################################################
+# Reduction
+# -----------
+
+
+def _test_reduction(data, **kwargs):
+ """ One iteration of Reduction """
+ _test_op(data, L.Reduction, "Reduction", **kwargs)
+
+
+def test_forward_Reduction():
+ """ Reduction """
+ reduction_op = {"SUM": 1, "ASUM": 2, "SUMSQ": 3, "MEAN": 4}
+ _test_reduction(np.random.rand(10).astype(np.float32),
operation=reduction_op["SUM"], axis=0)
+ _test_reduction(
+ np.random.rand(10).astype(np.float32), operation=reduction_op["SUM"],
axis=0, coeff=0.0
Review comment:
this suggestion is included in new commit. some more codes were
introduced to handle reductions on non-tail axis and give back the result
equivalent to Caffe framework.
--
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]