Skip to content
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

Add resize to change_3d_tensors_to_4d transformation #125

Merged
merged 107 commits into from
Dec 17, 2024

Conversation

klassen9
Copy link
Contributor

@klassen9 klassen9 commented Jul 6, 2024

This PR adds resize to the change_3d_tensors_to_4d transformation. The implementation supports resize version 10 up to 19.

Version 10 only supports scales as an input, other than the input tensor.

Version 11 up to 19 additionally support the roi and sizes inputs. sizes and scales are mutually exclusive. The Problem is that different versions have a different understanding of how to mark an input as unused. As an example:

  • Version 11 dictates: "If sizes is needed, the user must set scales to an empty tensor."
  • Version 13 dictates: "If sizes is needed, the user can use an empty string as the name of scales in this operator’s input list."

I am thus checking if scales or sizes exist by checking if they are None or are empty. None is returned by model.get_initializer() if the input is an empty string in the input list.

@klassen9
Copy link
Contributor Author

After deliberation with @fpjentzsch we decided to disallow the use of the ROI input and the axes attribute for the Resize operator.

@klassen9 klassen9 marked this pull request as ready for review July 30, 2024 15:11
maltanar and others added 26 commits December 6, 2024 12:55
now we have the tests to show that this works fine
…eature/remove_forked_identity

Remove identity nodes with output forking
…eature/fp16_fixes

Fixes for fp16 tensors and datatypes in ONNX
…nstants

Fix FoldConstants tranformation exiting early to redo shape annotations
…eature/improved_chanlast_eltwiseops

Improved channels-last via elementwise op generalization
…onnx_models

Fix incorrect value_info setting in MergeONNXModels
Updated partitioning function for PartitionFromDict
…iple_default_values

Add support for multiple default configurations
@maltanar
Copy link
Collaborator

Thanks @klassen9 . Since this is also related to #150 I took the liberty to extend the testcase generation to add a opset 13 version of Resize where the scale input is an empty string, which triggers the bug in #150 , and added exceptions in the core functions to handle this properly.

Kind reminder: please ensure future PRs go through pre-commit.

@maltanar maltanar merged commit b3121e2 into fastmachinelearning:main Dec 17, 2024
5 checks passed
@maltanar maltanar added this to the v0.4.0 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.