Skip to content
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

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Apr 6, 2020

Also moves dtype related handling to data_type.h

@tqchen
Copy link
Member Author

tqchen commented Apr 6, 2020

cc @zhiics @wweic

@tqchen tqchen mentioned this pull request Apr 6, 2020
2 tasks
…dFunc, move dtype related handling to data_type.h
@icemelon icemelon merged commit 5e50f47 into apache:master Apr 6, 2020
@icemelon
Copy link
Member

icemelon commented Apr 6, 2020

Thanks @tqchen @zhiics

@@ -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());
Copy link
Member

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?

Copy link
Member Author

@tqchen tqchen Apr 7, 2020

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

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Apr 16, 2020
…dFunc, move dtype related handling to data_type.h (apache#5251)
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Apr 17, 2020
@tqchen tqchen deleted the packed-str branch April 21, 2020 00:01
dpankratz pushed a commit to dpankratz/incubator-tvm that referenced this pull request Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants