-
Notifications
You must be signed in to change notification settings - Fork 458
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: resize onnx import #1863
feat: resize onnx import #1863
Conversation
I'm looking for feedback to solve: onnx resize when parsing the resize node, pub fn interpolate<R: JitRuntime, E: JitElement + Element>(
input: JitTensor<R, E, 4>,
output_size: [usize; 2],
options: InterpolateOptions,
) -> JitTensor<R, E, 4> {
... |
In the codegen for the node you could get the values in the size tensor. Something like #size.to_data().value /edit: shoot I didn't realize the |
it is a good idea, something like: let output_size: [usize; 2] = #output_size.to_data()
.value
.iter()
.map(|x| x.elem::<i64>() as usize)
.collect::<Vec<usize>>()
.try_into()
.unwrap(); |
Yeah something like that could work to preserve the flexibility. I think in most cases the sizes could be constant so we might be able to get the values directly when parsing the graph, but not entirely sure. I see in the spec that ONNX also supports providing a |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1863 +/- ##
==========================================
+ Coverage 86.11% 86.14% +0.03%
==========================================
Files 777 778 +1
Lines 90555 90780 +225
==========================================
+ Hits 77979 78202 +223
- Misses 12576 12578 +2 ☔ View full report in Codecov by Sentry. |
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.
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! Just a minor request to remove the commented dead code
I think this is probably the operator with the most attributes and optional inputs I've seen thus far 😅
Glad you didn't try to cover every use case because we can't support them anyway hahah
/edit: oh and we need to fix the merge conflicts
checklist
run-checks all
script has been executed.related issues/PRs
changes
support
Resize
onnx importtesting
cargo test -p burn-import --color=always -- --color=always
cargo test -p onnx-tests --color=always