mbs-octoml commented on code in PR #11224:
URL: https://github.com/apache/tvm/pull/11224#discussion_r876439068
##########
tests/python/relay/test_ir_text_printer.py:
##########
@@ -47,16 +47,28 @@ def show(text):
print(text)
-# Commented due to weird memory allocation error
-# def test_large_graph():
-# x = relay.var("x", shape=(3, 2))
-# y = relay.var("y")
-# one = relay.const(10e10, dtype="float32")
-# z = relay.add(x, one)
-# for i in range(int(9e5)):
-# z = relay.add(z, one)
-# f = relay.Function([x, y], z)
-# show(astext(f))
+def assert_prints_as(expr, str):
+ assert astext(expr) == SEMVER + str
+
+
+def test_scalars():
+ assert_prints_as(relay.const(42, "int16"), "42i16")
+ assert_prints_as(relay.const(42, "int32"), "42")
+ assert_prints_as(relay.const(42, "int64"), "42i64")
+ assert_prints_as(relay.const(3.0, "float16"), "3f16")
+ assert_prints_as(relay.const(3.0, "float32"), "3f")
+ assert_prints_as(relay.const(3.0, "float64"), "3f64")
+
+
+def test_large_graph():
Review Comment:
Yeah, turned it on expecting CI to fail but all was well. Job well done
indeed.
--
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]