You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/24 16:21:46 UTC

[GitHub] [incubator-tvm] antinucleon commented on a change in pull request #6135: [runtime] add float for podvalue

antinucleon commented on a change in pull request #6135:
URL: https://github.com/apache/incubator-tvm/pull/6135#discussion_r460156172



##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -371,6 +371,20 @@ class TVMPODValue_ {
     TVM_CHECK_TYPE_CODE(type_code_, kDLFloat);
     return value_.v_float64;
   }
+  operator float() const {
+    double tmp_v = 0;
+    if (type_code_ == kDLInt) {
+      tmp_v = static_cast<double>(value_.v_int64);
+      CHECK_LE(tmp_v, std::numeric_limits<float>::max());

Review comment:
       Depends whether we want to run TYPE_CHECK. If we want to run type check we have to have these redundant code.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org