guan404ming commented on code in PR #19841:
URL: https://github.com/apache/tvm/pull/19841#discussion_r3443299012


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -3084,6 +3084,15 @@ def _impl_v1(cls, bb, inputs, attr, params):
         return inputs[0]
 
 
+class Dropout(OnnxOpConverter):
+    """Converts an onnx Dropout node into an equivalent Relax expression."""
+
+    @classmethod
+    def _impl_v1(cls, bb, inputs, attr, params):
+        ratio = float(attr.get("ratio", 0.5))
+        return relax.op.nn.dropout(inputs[0], ratio)

Review Comment:
   Added _impl_v12 to read ratio from the optional input via get_constant



-- 
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]

Reply via email to