-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add unittest, backward of array read/write op #5409
Conversation
It is easy to debug and test when use `stable_sort`and the time complexity is not changed.
paddle/framework/operator.cc
Outdated
@@ -388,6 +391,20 @@ class RuntimeInferShapeContext : public InferShapeContext { | |||
} | |||
} | |||
|
|||
VarDesc::VarType GetVarType(const std::string& name) const override { | |||
Variable* var = scope_.FindVar(name); | |||
if (var->IsType<LoDTensor>()) { |
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.
this logic should be under Variable
, something like return var->GetType()
.
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.
Done.
paddle/operators/sum_op.cc
Outdated
} | ||
} | ||
} | ||
PADDLE_THROW("Unexpected branch"); |
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.
More helpful message, something like "Unexpected Type %s", x_vars[0]->GetType()
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.
Done.
paddle/operators/sum_op.h
Outdated
} | ||
} | ||
} else { | ||
PADDLE_THROW("Unexpected branch"); |
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.
More helpful message, something like "Unexpected Type %s", out_var->GetType()
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.
Done
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.
LGTM
No description provided.