-
Notifications
You must be signed in to change notification settings - Fork 350
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
feat: Add support for dynamic zeros_like and ones_like #1847
feat: Add support for dynamic zeros_like and ones_like #1847
Conversation
core/conversion/evaluators/aten.cpp
Outdated
@@ -124,6 +125,77 @@ DEFINE_TWO_INPUT_SIMPLE_EVALUATOR( | |||
int64_t, | |||
{"aten::__round_to_zero_floordiv(int a, int b) -> (int)"}); | |||
|
|||
std::pair<std::vector<int64_t>, torch::TensorOptions> newTensorImplementation(const torch::jit::Node* n, kwargs& args) { |
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.
I think we should probably put these helpers in the utils file.
core/conversion/evaluators/aten.cpp
Outdated
auto tensor = tensor_var.unwrapToTensor(); | ||
tensor_dims = tensor.sizes().vec(); | ||
} | ||
if (ctx->input_is_dynamic) { |
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 condition is too broad and results in additional bugs being injected. In the other dynamic shape PRs we also use the opt in shape tensor setting to limit the scope which should be good enough for now but really this should only run when the input is itself a ShapeTensor.
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.
Thanks for addressing the comments, LGTM me now, pending CI
@narendasan It looks like the CI issue is not specific to this PR. Any action needed on my side? |
You might need to rebase, the nightly version might be too old for this base branch |
c837942
to
ae4244f
Compare
ae4244f
to
864c001
Compare
@peri044 Should be ready to go. |
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
Description
Adds support for a variety of tensor creation ops including dynamic shape support for ones_like and zeros_like.
Ops supported:
aten::new_zeros
aten::new_ones
aten::zeros_like
aten::ones_like
aten::fill_
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: