MasterJH5574 commented on a change in pull request #8531:
URL: https://github.com/apache/tvm/pull/8531#discussion_r674817121
##########
File path: tests/python/unittest/test_tvmscript_roundtrip.py
##########
@@ -2961,15 +2961,15 @@ def test_abs():
@tvm.script.tir
-def printer(a: ty.handle) -> None:
+def constant_folding(a: ty.handle) -> None:
A = tir.match_buffer(a, (), "float32")
A[()] = tir.min(2.2, 5.2)
- A[()] = tir.max(tir.float32(2.2), tir.float32(5.2))
+ A[()] = tir.max(tir.float32(2.2), tir.float32(tir.float32(5.2)))
Review comment:
`tir.float32(tir.float32(5.2)))` seems strange to me... Is it indented? 🤔
##########
File path: src/printer/tvmscript_printer.cc
##########
@@ -235,16 +235,13 @@ class TVMScriptPrinter : public StmtFunctor<Doc(const
Stmt&)>,
Doc doc;
std::ostringstream os;
if (dtype.is_float() || dtype.is_float16() || dtype.is_bfloat16()) {
- os.setf(std::ios::showpoint);
os.precision(17);
}
os << data[0];
if (dtype == DataType::Int(32)) {
doc << Doc::Text(os.str());
} else if (dtype == DataType::Bool()) {
doc << Doc::Text(data[0] ? "True" : "False");
- } else if (dtype == DataType::Float(32)) {
- doc << Doc::Text(os.str());
Review comment:
Just wanna ask why we remove these two lines?
--
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]