Add simple Tensor class

This commit is contained in:
2025-11-16 19:31:09 +01:00
parent 98ad4ac760
commit 64bf9197ff
3 changed files with 70 additions and 0 deletions

11
src/backends/tensor.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include "backend/tensor.hpp"
using namespace CUDANet::Backend;
Tensor::Tensor(Shape shape, DType dtype, IBackend* backend)
: shape(shape), dtype(dtype), backend(backend), devicePtr(nullptr), hostPtr(nullptr) {}
Tensor::~Tensor() {
deallocate();
}