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 14:27:51 UTC

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

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



##########
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:
       this three lines are redundent with the below 3 lines. can you have if else that set tmp_v's value?




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