-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RUNTIME] Auto conversion from str to runtime::String in PackedFUnc #5251
Conversation
…dFunc, move dtype related handling to data_type.h
@@ -554,6 +512,10 @@ class TVMArgValue : public TVMPODValue_ { | |||
return std::string(value_.v_str); | |||
} | |||
} | |||
operator tvm::runtime::String() const { | |||
// directly use the std::string constructor for now. | |||
return tvm::runtime::String(operator std::string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tqchen It happened to me that Line511 above failed for the check because the type_code_ for String is an object. Should we remove this and pass String objectref directly? Or do we need to handle String through FFI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, i see, good catch, we will need to add a patch, by checking if the result is kStr and run this, alternatively, use AsObjectRef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so let's just return AsObjectRef<tvm::runtime::String>()
for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…dFunc, move dtype related handling to data_type.h (apache#5251)
…dFunc, move dtype related handling to data_type.h (apache#5251)
…dFunc, move dtype related handling to data_type.h (apache#5251)
Also moves dtype related handling to data_type.h