Torchvision API RandomApply implementation#6342
Conversation
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
|
@greptileai please review |
|
| Filename | Overview |
|---|---|
| dali/python/nvidia/dali/experimental/torchvision/v2/rand_apply.py | New RandomApply operator; follows the established RandomGrayscale conditional pattern correctly; p validation and _op_list storage are correct. |
| dali/test/python/torchvision/test_tv_rand_apply.py | Tests for p=0/1/multi-op are solid; probabilistic tests (test_random_apply_p, test_random_apply_p_sanity) run without a deterministic seed, violating test-set-seed. |
| dali/python/nvidia/dali/experimental/torchvision/init.py | Adds RandomApply import and all entry; straightforward. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Compose.__call__(img)"] --> B["PipelineHWC / PipelineCHW.run()"]
B --> C["_pipeline_function (enable_conditionals=True)"]
C --> D["fn.external_source → DataNode"]
D --> E["RandomApply.__call__(DataNode)"]
E --> F["Operator.__call__: verify_data, device placement"]
F --> G["RandomApply._kernel(DataNode)"]
G --> H["fn.random.coin_flip(probability=p) → convert:DataNode"]
H --> I{"if convert:\n(DALI conditional branch)"}
I -- "True (at runtime)" --> J["for op in _op_list:\n output = op(output)"]
J --> K["Nested op._kernel(DataNode) × N"]
K --> M["return output (transformed)"]
I -- "False (at runtime)" --> N["return output (unchanged = data_input)"]
M --> O["Pipeline output → PIL / Tensor"]
N --> O
Reviews (7): Last reviewed commit: "Review fixes" | Re-trigger Greptile
28cff89 to
2ac9994
Compare
|
@greptileai please re-review |
|
!build |
|
CI MESSAGE: [50671844]: BUILD STARTED |
|
CI MESSAGE: [50671844]: BUILD FAILED |
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
2ac9994 to
b0c754b
Compare
|
!build |
|
CI MESSAGE: [50675590]: BUILD STARTED |
|
CI MESSAGE: [50675590]: BUILD PASSED |
600e74b to
c52284f
Compare
c52284f to
a6ed90a
Compare
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
a6ed90a to
57302e8
Compare
7bfbf70 to
4bbc069
Compare
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
4bbc069 to
a4d6209
Compare
|
!build |
|
CI MESSAGE: [51158133]: BUILD STARTED |
|
CI MESSAGE: [51158133]: BUILD PASSED |
Category:
New feature
Description:
Torchvision API implementation of RandomApply operator
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: N/A