-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[CustomOp] Support duplicable op input and output #31535
[CustomOp] Support duplicable op input and output #31535
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.
LGTM
} | ||
}; | ||
|
||
// for std::vector<Tensor> input |
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.
Bad comments, describe what's for in detail
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.
thx, I will remove it in next PR
platform::errors::NotFound( | ||
"Input vector<tensor> (%s) is empty.", in_name)); | ||
std::vector<paddle::Tensor> custom_vec_in; | ||
for (size_t i = 0; i < vec_x.size(); ++i) { |
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.
clang format using for(const auto& x: vec_x)
is better?
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.
if using for(const auto& x: vec_x)
, we cannot tell users which tensor cause error in error message.
const PreviousArgs&... pargs) { | ||
template <int in_idx, int vec_in_idx, typename... PreviousArgs> | ||
static Return InferShape( | ||
std::vector<std::vector<int64_t>> input_shapes, |
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.
我们可以统一一下函数的输入参数类型,infershape、inferDatatype可以都使用const &
,更符合编程习惯和直觉。可以在下个PR修改
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.
thx,下个PR修改
PR types
New features
PR changes
OPs
Describe
[CustomOp] Support duplicable op input and output.
This PR add variable length tensor input and output in op, for example: