MemoryReadAdapter Class — pytorch Architecture
Architecture documentation for the MemoryReadAdapter class in pytorch_jni_common.h from the pytorch codebase.
Entity Profile
Relationship Graph
Source Code
android/pytorch_android/src/main/cpp/pytorch_jni_common.h lines 74–94
class MemoryReadAdapter final : public caffe2::serialize::ReadAdapterInterface {
public:
explicit MemoryReadAdapter(const void* data, off_t size)
: data_(data), size_(size){};
size_t size() const override {
return size_;
}
size_t read(uint64_t pos, void* buf, size_t n, const char* what = "")
const override {
memcpy(buf, (int8_t*)(data_) + pos, n);
return n;
}
~MemoryReadAdapter() {}
private:
const void* data_;
off_t size_;
};
Domain
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free