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

[AA] Add select operator/wrapper #4696

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Conversation

stiepan
Copy link
Member

@stiepan stiepan commented Mar 7, 2023

Category:

New feature (non-breaking change which adds functionality)

Description:

Adds select utility - meant to be used internally by automatic augmentation schemes. The meaning is select(ops, op_idx, *args, **kwargs) = ops[op_idx](*args, **kwargs). It uses conditional execution for that.

Additional information:

Part of AA lib: #4648

It loosely depends on the #4694 (it uses the wrapper for type annotation and testing).

Affected modules and functionalities:

Autograph integration with dali - so that it converts the auto_aug module too.

Key points relevant for the review:

Tests:

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

Checklist

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: DALI-3230

@klecki klecki self-assigned this Mar 7, 2023
@awolant awolant self-assigned this Mar 7, 2023
@stiepan stiepan added the automatic augmentations Automatic augmentations (AutoAugment, RandAugment, TrivialAugment and more) support in DALI. label Mar 7, 2023
@klecki klecki added the conditional execution Questions related to conditional execution and using `if` statements in DALI label Mar 7, 2023
Comment on lines +30 to +35
def sample_info(cb):

def idx_in_batch_cb(sample_info):
return np.array(cb(sample_info), dtype=np.int32)

return fn.external_source(idx_in_batch_cb, batch=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have the op for that at some point. Just a general, unrelated comment.

Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
@stiepan stiepan force-pushed the auto_aug_select_util branch from 25276e4 to d2a3e29 Compare March 9, 2023 09:25
@stiepan
Copy link
Member Author

stiepan commented Mar 9, 2023

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7531110]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7531110]: BUILD FAILED

@stiepan
Copy link
Member Author

stiepan commented Mar 9, 2023

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7537860]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7537860]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7537860]: BUILD PASSED

@stiepan stiepan merged commit 86f0b5f into NVIDIA:main Mar 10, 2023
@stiepan stiepan mentioned this pull request Mar 14, 2023
18 tasks
aderylo pushed a commit to zpp-dali-2022/DALI that referenced this pull request Mar 17, 2023
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
@JanuszL JanuszL mentioned this pull request Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automatic augmentations Automatic augmentations (AutoAugment, RandAugment, TrivialAugment and more) support in DALI. conditional execution Questions related to conditional execution and using `if` statements in DALI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants