pytorch/torch/csrc/serialization.h
Edward Z. Yang a5818047c4 Rewrite serialization to correctly handle partial reads/writes in all cases (#12143)
Summary:
Previously, doRead/doWrite were functions that could return partial reads/writes,
and we checked for this case inconsistently in the call sites of serialization.cpp.
Now, these functions do NOT return the amount of bytes read/written, and instead
handle the necessary checking loop themselves.

Fixes #12042. Maybe.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12143

Differential Revision: D10097027

Pulled By: ezyang

fbshipit-source-id: fd222ab8a825bed352153648ad396acfe124a3e1
2018-09-27 19:09:53 -07:00

17 lines
353 B
C++

#ifndef THP_SERIALIZATION_INC
#define THP_SERIALIZATION_INC
#include "generic/serialization.h"
#include <TH/THGenerateAllTypes.h>
#include "generic/serialization.h"
#include <TH/THGenerateHalfType.h>
template <class io>
void doRead(io fildes, void* buf, size_t nbytes);
template <class io>
void doWrite(io fildes, void* buf, size_t nbytes);
#endif