Skip to content

Commit

Permalink
convert: fix convert.py not working with int filename_stem (#3028)
Browse files Browse the repository at this point in the history
* fix implicit int to string conversion
* convert : remove an obsolete pyright comment

---------

Co-authored-by: Cebtenzzre <cebtenzzre@gmail.com>
  • Loading branch information
Green-Sky and cebtenzzre authored Sep 5, 2023
1 parent d59bd97 commit c9c3220
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def persistent_load(self, pid: Any) -> Any:
assert isinstance(pid[1], LazyStorageKind)
data_type = pid[1].data_type
filename_stem = pid[2]
filename = self.data_base_path + '/' + filename_stem
filename = f'{self.data_base_path}/{filename_stem}'
info = self.zip_file.getinfo(filename)

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

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

Expand Down

0 comments on commit c9c3220

Please sign in to comment.