mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
* Test serialization file-like object API guarantees and update docs. * Implement torch.load() / torch.save() for arbitrary file-like objects * Add tests for torch.load/save for file-like objects * Fix compiler errors * Throw error if user tries torch.save(tensor, StringIO.StringIO) * Skip test_serialization_container_filelike. Investigation pending. * Address comments * Fix _test_serialization_container * Address comments * fix comment * Use PyBuffer_FromReadWriteMemory * Fix build by removing inlining * Fix clang builds? * Address comments * Don't use memoryview in python 2 * Ensure doRead/doWrite templates are instantiated before they're used in generic/serialization.cpp
17 lines
359 B
C++
17 lines
359 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>
|
|
ssize_t doRead(io fildes, void* buf, size_t nbytes);
|
|
|
|
template <class io>
|
|
ssize_t doWrite(io fildes, void* buf, size_t nbytes);
|
|
|
|
#endif
|