MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / Tensor

Class Tensor

src/codec.h:95–104  ·  view source on GitHub ↗

Tensor data as read from the file, which serializes tensors in PyTorch format.

Source from the content-addressed store, hash-verified

93// Tensor data as read from the file, which serializes tensors
94// in PyTorch format.
95struct Tensor {
96 std::string name;
97 CodecDType dtype;
98 std::array<int, 4> shape = {0, 0, 0, 0};
99 void* data = nullptr; // not managed by Tensor
100 size_t size; // size in bytes (number of elements * element size)
101
102 // Returns 0 if successful, other if failed
103 int from_json(const std::string& name, const json& j, void* bytes_ptr, size_t bytes_size);
104};
105
106// Tensor with quantization metadata.
107struct QTensor {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected