Skip to content

Torchvsion API documentation page update#6313

Merged
mdabek-nvidia merged 3 commits into
NVIDIA:mainfrom
mdabek-nvidia:torchvision_docs_update
Jun 2, 2026
Merged

Torchvsion API documentation page update#6313
mdabek-nvidia merged 3 commits into
NVIDIA:mainfrom
mdabek-nvidia:torchvision_docs_update

Conversation

@mdabek-nvidia
Copy link
Copy Markdown
Collaborator

Category:

Other (Documentation)

Description:

Update of the Torchvision API's documentation:

  • Added tables with supported operators for both APIs

  • Updated cells that list supported operators

Additional information:

Affected modules and functionalities:

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: N/A

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mdabek-nvidia
Copy link
Copy Markdown
Collaborator Author

@greptileai please review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR adds two operator reference tables to the Torchvision API getting-started notebook: one for the object-oriented API and one for the functional API. It also updates the execution-output cells to reflect the expanded operator list now available in both modules.

  • Two new tables added (cells 3–5): every operator currently exported by dtv.__all__ and dtv_fn.__all__ is listed with its torchvision.transforms.v2 counterpart (linked to official Torchvision docs) and a short description; the operator counts in the tables match the updated output cells exactly.
  • Addressed prior review feedback: to_tensor now carries a deprecation note ("Deprecated in Torchvision."), and PILToTensor now has a detailed description that clearly distinguishes its marker-only role from the actual-conversion role of the functional pil_to_tensor.

Confidence Score: 5/5

Documentation-only change with no executable code modifications; safe to merge.

The change adds two Markdown tables to a Jupyter notebook and refreshes output cells. The operator names in the tables match exactly what the all output cells print, previously raised review concerns about to_tensor deprecation and PILToTensor marker semantics have both been addressed, and no source code is modified.

No files require special attention.

Important Files Changed

Filename Overview
docs/examples/getting_started/torchvision_api.ipynb Added two operator reference tables (OO and functional) and updated output cells; operator lists in tables match the actual all output cells exactly.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    direction LR
    class OO_API["nvidia.dali.experimental.torchvision (OO)"] {
        CenterCrop
        ColorJitter
        Compose
        GaussianBlur
        Grayscale
        Normalize
        Pad
        PILToTensor
        RandomApply
        RandomCrop
        RandomGrayscale
        RandomHorizontalFlip
        RandomResizedCrop
        RandomVerticalFlip
        Resize
        ToPILImage
        ToPureTensor
    }
    class Functional_API["nvidia.dali.experimental.torchvision.v2.functional"] {
        center_crop
        crop
        gaussian_blur
        get_dimensions
        get_image_size
        get_size
        horizontal_flip
        normalize
        pad
        pil_to_tensor
        resize
        resized_crop
        rgb_to_grayscale
        to_grayscale
        to_pil_image
        to_tensor
        vertical_flip
    }
    class TV2["torchvision.transforms.v2 (upstream)"]
    TV2 <|.. OO_API : mirrors
    TV2 <|.. Functional_API : mirrors
Loading

Reviews (4): Last reviewed commit: "Available operators update" | Re-trigger Greptile

@mdabek-nvidia mdabek-nvidia force-pushed the torchvision_docs_update branch from f2b4813 to 7cb4fc6 Compare April 24, 2026 12:20
* Added tables with supported operators for both APIs

* Updated cells that list supported operators

Signed-off-by: Marek Dabek <mdabek@nvidia.com>
@mdabek-nvidia mdabek-nvidia force-pushed the torchvision_docs_update branch from 7cb4fc6 to 378f16c Compare April 24, 2026 12:32
@mdabek-nvidia mdabek-nvidia marked this pull request as ready for review April 24, 2026 12:33
@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 24, 2026

View / edit / reply to this conversation on ReviewNB

JanuszL commented on 2026-04-24T12:36:49Z
----------------------------------------------------------------

I wonder if we remember ot update it, do you think we can have it generated outside of jupyter on a separated docs page?


mdabek-nvidia commented on 2026-05-07T16:36:38Z
----------------------------------------------------------------

I don't expect to have an influx of new operators, but I've created JIRA ticket to automatically generate this table: https://jirasw.nvidia.com/browse/DALI-4703

JanuszL commented on 2026-05-13T19:04:48Z
----------------------------------------------------------------

👍

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 24, 2026

View / edit / reply to this conversation on ReviewNB

JanuszL commented on 2026-04-24T12:36:50Z
----------------------------------------------------------------

Is it possible to make below go?

/home/mdabek/.local/lib/python3.10/site-packages/matplotlib/projections/__init__.py:63: UserWarning: Unable to import Axes3D. This may be due to multiple versions of Matplotlib being installed (e.g. as a system package and as a pip package). As a result, the 3D projection is not available. 
  warnings.warn("Unable to import Axes3D. This may be due to multiple versions of " 

mdabek-nvidia commented on 2026-05-07T16:36:53Z
----------------------------------------------------------------

Fixed

Copy link
Copy Markdown
Collaborator

@jantonguirao jantonguirao left a comment

Choose a reason for hiding this comment

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

Comments added

Comment thread docs/examples/getting_started/torchvision_api.ipynb
Comment thread docs/examples/getting_started/torchvision_api.ipynb
Comment thread docs/examples/getting_started/torchvision_api.ipynb
Comment thread docs/examples/getting_started/torchvision_api.ipynb
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Copy link
Copy Markdown
Collaborator Author

I don't expect to have an influx of new operators, but I've created JIRA ticket to automatically generate this table: https://jirasw.nvidia.com/browse/DALI-4703


View entire conversation on ReviewNB

Copy link
Copy Markdown
Collaborator Author

Fixed


View entire conversation on ReviewNB

Copy link
Copy Markdown
Collaborator

@jantonguirao jantonguirao left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes — all four prior comments are addressed.

One very minor leftover from comment #2 (the consistency suggestion): the ToPILImage row (~L108) still uses the original "Acts as a return-type hint for Compose" phrasing, while PILToTensor (~L104) and ToPureTensor (~L109) now both use the "Marker placed in a Compose op list — signals…" phrasing. Consider aligning ToPILImage for consistency, e.g.:

ToPILImage | v2.ToPILImage | Marker placed at the end of a Compose op list — signals the CHW pipeline to return a PIL.Image instead of a torch.Tensor. The conversion is performed by Compose; the operator does not modify the data. |

Not a blocker — feel free to address in a follow-up or leave as is.

Copy link
Copy Markdown
Contributor

JanuszL commented May 13, 2026

👍


View entire conversation on ReviewNB

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51397152]: BUILD FAILED

Signed-off-by: Marek Dabek <mdabek@nvidia.com>
@mdabek-nvidia
Copy link
Copy Markdown
Collaborator Author

!build

@mdabek-nvidia mdabek-nvidia added the Documentation Issue with the documentation label Jun 2, 2026
@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [53399787]: BUILD STARTED

@dali-automaton
Copy link
Copy Markdown
Collaborator

CI MESSAGE: [53399787]: BUILD PASSED

@mdabek-nvidia mdabek-nvidia merged commit 60eaf6f into NVIDIA:main Jun 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Issue with the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants