slyubomirsky commented on code in PR #16183:
URL: https://github.com/apache/tvm/pull/16183#discussion_r1409758961


##########
include/tvm/runtime/packed_func.h:
##########
@@ -547,29 +551,43 @@ class TVMPODValue_ {
     // Allow automatic conversion from int to float
     // This avoids errors when user pass in int from
     // the frontend while the API expects a float.
-    if (type_code_ == kDLInt) {
-      return static_cast<double>(value_.v_int64);
+    if (auto opt = TryAsBool()) {
+      return opt.value();
+    } else if (auto opt = TryAsInt()) {

Review Comment:
   Would any bool value also work as an int value? Maybe that's the reason for 
the ordering given.



-- 
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]

Reply via email to