pytorch/caffe2/serialize/read_adapter_interface.h
Lu Fang b329e03684 Add PyTorchPredictorContainer (#15899)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15899

Add PyTorchPredictorContainer to support multiple jit script modules

Reviewed By: pritamdamania87

Differential Revision: D13596139

fbshipit-source-id: 3ce0bdf2f4dbba7aa1d20e824d03e5ac98f5d887
2019-01-15 09:18:18 -08:00

24 lines
557 B
C++

#pragma once
#include <cstddef>
#include <cstdint>
#include "c10/macros/Macros.h"
namespace caffe2 {
namespace serialize {
// this is the interface for the (file/stream/memory) reader in
// PyTorchStreamReader. with this interface, we can extend the support
// besides standard istream
class CAFFE2_API ReadAdapterInterface {
public:
virtual size_t size() const = 0;
virtual size_t read(uint64_t pos, void* buf, size_t n, const char* what = "")
const = 0;
virtual ~ReadAdapterInterface();
};
} // namespace serialize
} // namespace caffe2