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 DataNode.shape() #5648

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add DataNode.shape() #5648

wants to merge 2 commits into from

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Sep 26, 2024

Category:

New feature (non-breaking change which adds functionality)

Description:

This PR adds a shape() function to the DataNode. By default, this function returns the result of calling fn.shapes(node, device="cpu").
It also improves gpu2cpu check - for .cpu() function, calling it earlier in the process if there's a "current" pipeline available (previously it would be checked at build time).

Additional information:

Affected modules and functionalities:

Pipeline
DataNode

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-4073

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [18775471]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [18775471]: BUILD PASSED

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [18879002]: BUILD STARTED

self._check_gpu2cpu()
return fn.shapes(self, dtype=dtype, device=device)

def _check_gpu2cpu(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a docstring here where this should be used? And maybe a warning why we don't use current_pipeline.

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.

4 participants