tlopex commented on code in PR #19527:
URL: https://github.com/apache/tvm/pull/19527#discussion_r3219051360
##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -1140,6 +1140,19 @@ def _impl_v11(cls, bb, inputs, attr, params):
raise ValueError("Scatter is deprecated in ONNX 11")
+def _get_onnx_reduction(attr, valid_reductions: list[str]):
+ reduction = attr.get("reduction", None)
+ reduction = reduction or b"update"
+ if isinstance(reduction, bytes):
+ reduction = reduction.decode("utf-8")
+ reduction = "update" if reduction == "none" else reduction
+ assert reduction in valid_reductions, (
+ f"Only {valid_reductions} reductions are supported, but {reduction} is
gotten"
+ )
Review Comment:
This makes sense. Could you have a modification?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]