Commit Graph

5 Commits

Author SHA1 Message Date
Xuehai Pan
b77406a9ec [BE][CI] bump ruff to 0.8.4 (#143753)
Changes:

1. Bump `ruff` from 0.7.4 to 0.8.4
2. Change `%`-formatted strings to f-string
3. Change arguments with the `__`-prefix to positional-only arguments with the `/` separator in function signature.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143753
Approved by: https://github.com/Skylion007
2024-12-24 12:24:10 +00:00
Erjia Guan
e7ad82eb2f [DataLoader] Add option to refine type during runtime validation for DP instance (#56066)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/56066

Test Plan: Imported from OSS

Reviewed By: VitalyFedyunin

Differential Revision: D27776646

Pulled By: ejguan

fbshipit-source-id: 695ff7775177653d809c5917d938c706281e1298
2021-06-10 14:04:24 -07:00
Erjia Guan
3b977b3b4d [DataLoader] Add context manager for runtime type validation (#55936)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55936

Test Plan: Imported from OSS

Reviewed By: VitalyFedyunin

Differential Revision: D27743476

Pulled By: ejguan

fbshipit-source-id: 8f0454ccf3ec37807598056433bff91013fa9bb9
2021-05-12 11:59:16 -07:00
Erjia Guan
5c696443c7 [DataLoader] Modfity construct_time_validation to argument_validation (#55836)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55836

Change construct_time_validation to argument_validation as we should provide users the flexibility to use this decorator over all different functions, which are required with type validation.

It can also work as a construct-time validation
```py
class ExampleDataPipe(IterDataPipe):
    argument_validation
    def __init__(self, dp: IterDataPipe[int]):
        self.dp = dp

    ...
```
Notebook is also updated.

Test Plan: Imported from OSS

Reviewed By: VitalyFedyunin

Differential Revision: D27743478

Pulled By: ejguan

fbshipit-source-id: 49743152d121028cd7d72d89dc7df5c7c7b94c41
2021-05-12 11:58:05 -07:00
Erjia Guan
c549a147a9 [DataLoader] Typing Doc (#54773)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/54773

Test Plan: Imported from OSS

Reviewed By: VitalyFedyunin

Differential Revision: D27364246

Pulled By: ejguan

fbshipit-source-id: 48908555853c364d2d3cc173e3b73a6bec2e19f1
2021-04-02 15:22:35 -07:00