Skip to content

Commit c9c3220

Browse files
convert: fix convert.py not working with int filename_stem (#3028)
* fix implicit int to string conversion * convert : remove an obsolete pyright comment --------- Co-authored-by: Cebtenzzre <[email protected]>
1 parent d59bd97 commit c9c3220

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

convert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def persistent_load(self, pid: Any) -> Any:
673673
assert isinstance(pid[1], LazyStorageKind)
674674
data_type = pid[1].data_type
675675
filename_stem = pid[2]
676-
filename = self.data_base_path + '/' + filename_stem
676+
filename = f'{self.data_base_path}/{filename_stem}'
677677
info = self.zip_file.getinfo(filename)
678678

679679
def load(offset: int, elm_count: int) -> NDArray:
@@ -689,7 +689,6 @@ def load(offset: int, elm_count: int) -> NDArray:
689689

690690
@staticmethod
691691
def lazy_rebuild_tensor_v2(storage: Any, storage_offset: Any, size: Any, stride: Any,
692-
# pyright: ignore[reportSelfClsParameterName]
693692
requires_grad: Any, backward_hooks: Any, metadata: Any = None) -> LazyTensor:
694693
assert isinstance(storage, LazyStorage)
695694

0 commit comments

Comments
 (0)