-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Dedup MethodValue and FunctionValue #12589
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
Conversation
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.
ok
torch/csrc/jit/script/init.cpp
Outdated
@@ -361,33 +344,17 @@ static void gatherParametersAndBuffers(std::vector<at::Tensor*> & values, const | |||
} | |||
|
|||
namespace { | |||
struct PythonResolver : public Resolver { | |||
struct PythonResolver { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
2b01e6a
to
b2b94cf
Compare
torch/csrc/jit/script/compiler.cpp
Outdated
@@ -804,14 +804,15 @@ inline bool isSupportedListElementType(TypePtr type) { | |||
struct to_ir { | |||
to_ir( | |||
Def def, | |||
std::shared_ptr<Resolver> resolver, | |||
Resolver resolver, | |||
SugaredValuePtr self, | |||
Method& method) // method being constructed | |||
: method(method) | |||
, graph(method.graph()) | |||
, def(def) | |||
, resolver(resolver) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/csrc/jit/script/compiler.cpp
Outdated
@@ -152,11 +152,11 @@ struct CastValue : public SugaredValue { | |||
// the IR API, but for now we choose to pessimisitically create inputs and | |||
// delete unnecessary ones later with replaceAllusesWith(). | |||
struct Environment { | |||
Environment(Method & method, std::shared_ptr<Resolver> resolver, Block* b, std::shared_ptr<Environment> next = nullptr) | |||
Environment(Method & method, Resolver resolver, Block* b, std::shared_ptr<Environment> next = nullptr) | |||
: method(method), resolver(resolver), b(b), next(next) {} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
zdevito has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
... they are basically the same class and I didn't see it in the initial PR. I also got resolvers back onto std::functions by keeping the function_table logic local to defineMethodInModules.