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 supported layouts to Crop, CropMirrorNormalize #3722

Merged
merged 4 commits into from
Mar 11, 2022

Conversation

jantonguirao
Copy link
Contributor

@jantonguirao jantonguirao commented Mar 7, 2022

Signed-off-by: Joaquin Anton janton@nvidia.com

Category:

New feature

Description:

Adds layout information to Crop, CropMirrorNormalize. The layout info is used both for documentation and error checking.

Additional information:

Affected modules and functionalities:

Crop, CropMirrorNormalize operators

Key points relevant for the review:

NA

Checklist

Tests

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

// Layouts containing spatial dimensions such as height, width, depth
// Contains Image, Volumetric Images, and Sequence layouts
static std::initializer_list<TensorLayout> kSpatialLayouts {
"HWC", "CHW", "DHWC", "FHWC", "FCHW", "CDHW", "CFHW", "FDHWC", "FCDHW", "CFDHW"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not spatial layouts, since they also include temporal dimension.
Also, I don't like mixing such lists into a high-impact (and therefore, high build-time) header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it

@jantonguirao jantonguirao changed the title Extract kSpatialLayouts Add supported layouts to Crop, CropMirrorNormalize and Flip Mar 7, 2022
@jantonguirao jantonguirao marked this pull request as ready for review March 7, 2022 19:01
Copy link
Contributor

@klecki klecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have some tests for not compatible input layouts or is it overkill?

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao jantonguirao changed the title Add supported layouts to Crop, CropMirrorNormalize and Flip Add supported layouts to Crop, CropMirrorNormalize Mar 8, 2022
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Comment on lines 37 to 38
.InputLayout(0, {"HWC", "CHW", "DHWC",
"FHWC", "FCHW", "CDHW", "CFHW",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I know it technically only matters which layout is listed first for any given number of dimensions, but it would be nice to group them as 3D, video (or, conversely: video, 3D).

Suggested change
.InputLayout(0, {"HWC", "CHW", "DHWC",
"FHWC", "FCHW", "CDHW", "CFHW",
.InputLayout(0, {"HWC", "CHW", "DHWC", "CDHW",
"FHWC", "FCHW","CFHW",

Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4116328]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4116328]: BUILD PASSED

@jantonguirao jantonguirao merged commit 7688b38 into NVIDIA:main Mar 11, 2022
cyyever pushed a commit to cyyever/DALI that referenced this pull request May 13, 2022
Signed-off-by: Joaquin Anton <janton@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jun 7, 2022
Signed-off-by: Joaquin Anton <janton@nvidia.com>
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.

None yet

4 participants