Tensor with quantization metadata.
| 105 | |
| 106 | // Tensor with quantization metadata. |
| 107 | struct QTensor { |
| 108 | Quant quant = Quant::F32; |
| 109 | std::array<int, 4> shape = {0, 0, 0, 0}; |
| 110 | void* data = nullptr; // not managed by QTensor |
| 111 | size_t size = 0; // size in bytes |
| 112 | |
| 113 | QTensor() = default; |
| 114 | QTensor(Quant quant, std::array<int, 4> shape, void* data, size_t size) : quant(quant), shape(shape), data(data), size(size) {} |
| 115 | QTensor(const QTensor& other) = default; |
| 116 | static QTensor from_codec_tensor(const Tensor& tensor, Quant weight_quant, std::array<int, 4> shape, const int debug_line); |
| 117 | |
| 118 | size_t ndim() const; |
| 119 | size_t n_elements() const; |
| 120 | }; |
| 121 | |
| 122 | struct YALMData { |
| 123 | json metadata; |