Skip to content

Commit 19324fa

Browse files
committed
2.5.1 and mypy
1 parent 9971db4 commit 19324fa

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- { python_version: "3.11", pytorch_version: "2.2.2", cuda_version: "12.1.0" }
109109
- { python_version: "3.11", pytorch_version: "2.3.1", cuda_version: "12.1.0" }
110110
- { python_version: "3.11", pytorch_version: "2.4.1", cuda_version: "12.1.0" }
111-
- { python_version: "3.12", pytorch_version: "2.5.0", cuda_version: "12.1.0" }
111+
- { python_version: "3.12", pytorch_version: "2.5.1", cuda_version: "12.1.0" }
112112
steps:
113113
- uses: actions/checkout@v4
114114
- uses: docker/setup-buildx-action@v3

requirements/typing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mypy==1.11.0
2-
torch==2.5.0
2+
torch==2.5.1
33

44
types-Markdown
55
types-PyYAML

src/lightning/pytorch/core/module.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,9 @@ def forward(self, x):
14051405
input_sample = self._apply_batch_transfer_handler(input_sample)
14061406

14071407
file_path = str(file_path) if isinstance(file_path, Path) else file_path
1408-
torch.onnx.export(self, input_sample, file_path, **kwargs)
1408+
# PyTorch (2.5) declares file_path to be str | PathLike[Any] | None, but
1409+
# BytesIO does work, too.
1410+
torch.onnx.export(self, input_sample, file_path, **kwargs) # type: ignore
14091411
self.train(mode)
14101412

14111413
@torch.no_grad()

0 commit comments

Comments
 (0)