XG-zheng commented on code in PR #14172:
URL: https://github.com/apache/tvm/pull/14172#discussion_r1134932146
##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -475,6 +499,39 @@ def convert_elementwise_op(g, op, block):
g.add_node(op.output("Out")[0], out)
+def convert_linspace(g, op, block):
+ """Operator converter for linspace."""
+
+ start = g.get_node(op.input("Start")[0])
+ stop = g.get_node(op.input("Stop")[0])
+ num = g.get_node(op.input("Num")[0])
+ dtype = _convert_dtype_value(op.attr("dtype"))
+
+ start = _op.cast(start, dtype)
+ stop = _op.cast(stop, dtype)
+ num = _op.cast(num, dtype)
+
+ if dtype in ["int32", "float32"]:
+ tmp_dtype = "float32"
+ else:
+ tmp_dtype = "float64"
+ start = _op.cast(start, tmp_dtype)
Review Comment:
I tested the case where the values can be infered, the relay IR as follow.
```
def @main() {
meta[relay.Constant][0]
}
```
--
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]