[Torchvision API] Exception for isolated objective operator execution#6373
[Torchvision API] Exception for isolated objective operator execution#6373mdabek-nvidia wants to merge 2 commits into
Conversation
|
| Filename | Overview |
|---|---|
| dali/python/nvidia/dali/experimental/torchvision/v2/operator.py | Splits __call__ into a hard-failing stub (raises RuntimeError) and a new private _invoke method that carries the original execution logic; the change is clean and well-scoped. |
| dali/python/nvidia/dali/experimental/torchvision/v2/compose.py | One-line update to call op._invoke(input_node) instead of op(input_node); straightforward and necessary follow-up to the operator.py change. |
| dali/test/python/torchvision/test_tv_compose.py | Adds test_error_in_isolated_operators that verifies the new RuntimeError is raised with the expected message glob; uses assert_raises with a message pattern per DALI convention. |
Sequence Diagram
sequenceDiagram
participant User
participant Operator
participant Compose
participant _pipeline_function
Note over User,Operator: Direct call (now blocked)
User->>Operator: op(data_input)
Operator-->>User: RuntimeError: not directly callable
Note over User,_pipeline_function: Correct path via Compose
User->>Compose: compose(data_input)
Compose->>_pipeline_function: build pipeline graph
_pipeline_function->>Operator: op._invoke(input_node)
Operator-->>_pipeline_function: pipeline DataNode
_pipeline_function-->>Compose: output node
Compose-->>User: torch.Tensor / PIL.Image
Reviews (4): Last reviewed commit: "Adjust Compose tests" | Re-trigger Greptile
c8582af to
4f54085
Compare
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
4f54085 to
d84095e
Compare
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
|
@greptileai re-review |
Category:
Bug fix
Description:
RuntimeError raised when executing a standalone operator, which is not a part of a Compose pipeline.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-4644