cbalint13 commented on code in PR #15715:
URL: https://github.com/apache/tvm/pull/15715#discussion_r1320653395
##########
python/tvm/relay/frontend/oneflow.py:
##########
@@ -1025,15 +1025,17 @@ def _impl_v1(cls, inputs, attrs, params):
return out
-class ThresholdedRelu(OneFlowOpConverter):
- """Operator converter for ThresholdedRelu."""
+class Threshold(OneFlowOpConverter):
+ """Operator converter for Threshold."""
@classmethod
def _impl_v1(cls, inputs, attrs, params):
- alpha = float(attrs.get("alpha", 1.0))
- alpha_tensor = _op.full_like(inputs[0], fill_value=_expr.const(alpha))
- mask = _op.greater(inputs[0], alpha_tensor).astype("float32")
- return inputs[0] * mask
+ threshold = float(attrs.get("threshold_val", 1.0))
+ threshold_tensor = _op.full_like(inputs[0],
fill_value=_expr.const(threshold))
+ value = float(attrs.get("value"))
+ value_tensor = _op.full_like(inputs[0], fill_value=_expr.const(value))
+ mask = _op.greater(inputs[0], threshold_tensor).astype("float32")
Review Comment:
```.astype("float32")``` should't it be of any universal ```dtype``` ?
thinking of other types i.e. ```int``` kinds in case of quantized things.
--
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]