mbrookhart commented on a change in pull request #9063:
URL: https://github.com/apache/tvm/pull/9063#discussion_r713324843
##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -3430,6 +3430,25 @@ def _impl_v10(cls, inputs, attr, params):
return _qnn.op.quantize(out, y_scale, y_zero_point, out_dtype=dtype)
+class QLinearLeakyRelu(OnnxOpConverter):
+ """Operator converter for QLinearLeakyRelu from Microsoft onnxruntime
contrib opset."""
+
+ @classmethod
+ def _impl_v10(cls, inputs, attr, params):
+
+ a_scale = get_scalar(inputs[1], params)
+ a_zero_point = get_scalar(inputs[2], params, "int32")
+ y_scale = fold_constant(get_scalar(inputs[3], params))
+ y_zero_point = get_scalar(inputs[4], params, "int32")
+ alpha = float(attr.get("alpha", 1.0))
+
+ dtype = infer_type(inputs[0]).checked_type.dtype
+
+ a = _qnn.op.dequantize(inputs[0], a_scale, a_zero_point)
+ out = _op.nn.leaky_relu(a, alpha)
+ return _qnn.op.quantize(out, y_scale, y_zero_point, out_dtype=dtype)
Review comment:
If we're dequantinzing, can you provide a link to ORT doing the same
thing? if this is an ORT op and they're running it in int8, I'd prefer to
import it in int8 here?f
--
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]