mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Stacked PRs * #32958 - Make zip serialization the default * **#32244 - Fix some bugs with zipfile serialization** It includes the following changes: * Split up tests so that we can test both serialization methods * Loading something within a buffer doesn't work anymore, so those tests are only on the old serialization method (it's possible but introduces a big slowdown since it requires a linear scan of the entire zipfile to find the magic number at the end) * Call `readinto` on a buffer if possible instead of `read` + a copy * Disable CRC-32 checks on read (there was some issue where miniz said the CRC was wrong but `zipinfo` and `unzip` said the zip file was fine) ](https://our.intern.facebook.com/intern/diff/19418935/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/32244 Pulled By: driazati Reviewed By: eellison Differential Revision: D19418935 fbshipit-source-id: df140854f52ecd04236225417d625374fd99f573
12 lines
281 B
C++
12 lines
281 B
C++
#ifndef TH_GENERIC_FILE
|
|
#define TH_GENERIC_FILE "torch/csrc/generic/serialization.h"
|
|
#else
|
|
|
|
template <class io>
|
|
void THPStorage_(writeFileRaw)(THWStorage *self, io fd, bool save_size);
|
|
|
|
template <class io>
|
|
THWStorage * THPStorage_(readFileRaw)(io fd, THWStorage *storage);
|
|
|
|
#endif
|