-
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
Support symbol placement type in functional. #5627
Support symbol placement type in functional. #5627
Conversation
template<> | ||
Maybe<std::vector<Symbol<cfg::SbpParallel>>> | ||
PythonArg::ObjectAs<std::vector<Symbol<cfg::SbpParallel>>>() const { | ||
return *JUST(detail::cast<std::vector<Symbol<cfg::SbpParallel>>>(Borrow())); |
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.
这里应该是
const auto& v = JUST(detail::cast<std::vector<std::shared_ptr<Symbol<cfg::SbpParallel>>>>(Borrow()));
auto sbp_list = std::make_shared<std::vector<Symbol<cfg::SbpParallel>>>(v->size());
for (int i = 0; i < v->size(); ++i) {
sbp_list[i] = *(v->at(i));
}
return sbp_list
Speed stats:
|
"ParallelDesc", | ||
"SbpParallel", | ||
"SbpParallelList", |
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.
"Placement"
"Sbp"
"SbpList"
"ParallelDesc": "const Symbol<ParallelDesc>&", | ||
"SbpParallel": "const Symbol<cfg::SbpParallel>&", | ||
"SbpParallelList": "const std::vector<Symbol<cfg::SbpParallel>>&", |
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.
"Placement": "const Symbol<ParallelDesc>&",
"Sbp": "const Symbol<cfg::SbpParallel>&",
"SbpList": "const std::vector<Symbol<cfg::SbpParallel>>&",
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.
这么做是因为我们的ParallelDesc后边一定会统一命名成Placement。
但是接口处需要和Python对齐,同时和将来很快要做的改动对齐。
No description provided.