[easy] use number of param bytes as the chunk size if it's not provided (#111844)

Summary: ATT

Test Plan: CI

Differential Revision: D50572228

Pull Request resolved: https://github.com/pytorch/pytorch/pull/111844
Approved by: https://github.com/zyan0, https://github.com/houseroad
This commit is contained in:
Shiyan Deng
2023-10-24 23:56:33 +00:00
committed by PyTorch MergeBot
parent ad4971c0b1
commit 3acaf8564d

View File

@@ -380,6 +380,9 @@ size_t PyTorchStreamReader::getRecord(
if ((!load_debug_symbol_) && c10::string_view(name).ends_with(kDebugPklSuffix)) {
return 0;
}
if (chunk_size <= 0) {
chunk_size = n;
}
size_t key = getRecordID(name);
mz_zip_archive_file_stat stat;
mz_zip_reader_file_stat(ar_.get(), key, &stat);