-
Notifications
You must be signed in to change notification settings - Fork 825
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
gen_bw_fn return maybe #5454
Merged
Merged
gen_bw_fn return maybe #5454
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…neflow-inc/oneflow into OutputArgModifier_return_maybe_part_1
…b.com/oneflow-inc/oneflow into Replace_check_using_maybe_check_part_SetInputArgModifyFn
…neflow-inc/oneflow into OutputArgModifier_return_maybe_part_1 Conflicts: oneflow/core/operator/operator.cpp
…b.com/oneflow-inc/oneflow into input_arg_modifier_return_maybe
Merged
…gen_bw_fn_return_maybe Conflicts: oneflow/core/job/job_build_and_infer_ctx.cpp oneflow/core/job/job_builder.cpp oneflow/core/job/job_builder.h oneflow/core/job_rewriter/autograd.cpp oneflow/core/job_rewriter/autotick.cpp oneflow/core/operator/operator.cpp oneflow/user/ops/model_update_ops.cpp
…outside function resulting in JUST failed in lambda
liufengwei0103
commented
Jul 16, 2021
oneflow/user/ops/matmul_op.cpp
Outdated
@@ -72,8 +72,8 @@ Maybe<void> InferDataType4Matmul(user_op::InferContext* ctx) { | |||
return Maybe<void>::Ok(); | |||
} | |||
|
|||
void GenBackwardOpConf4Matmul(const std::string& op_type_name, const user_op::UserOpWrapper& op, | |||
user_op::AddOpFn AddOp) { | |||
Maybe<void> GenBackwardOpConf4Matmul(const std::string& op_type_name, |
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.
其他位置的maybe,未来会传播到这里,提前把这个函数改成maybe的了。目前这个函数内没有check。
lixinqi
approved these changes
Jul 16, 2021
…gen_bw_fn_return_maybe
…nc/oneflow into gen_bw_fn_return_maybe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gen_bw_fn_return_maybe
该pr 依赖#5453 , 先合入
oneflow/user/ops/layer_norm_op.cpp里
"""
int64_t ShiftNegativeAxisIfNeed(const Shape& shape, int64_t axis) {
const int64_t shifted = axis < 0 ? axis + shape.NumAxes() : axis;
CHECK_GE(shifted, 0);
CHECK_LT(shifted, shape.NumAxes());
return shifted;
}
"""
暂未修改
因为SetGenBackwardOpConfFn, SetTensorDescInferFn同时会用到ShiftNegativeAxisIfNeed,SetTensorDescInferFn在后面的pr里。此处若将ShiftNegativeAxisIfNeed改为Maybe将会涉及,同时修改SetTensorDescInferFn。
ShiftNegativeAxisIfNeed后面统一修改。