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:
[email protected]