mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-12-22 22:34:22 +00:00
Add simple Tensor class
This commit is contained in:
11
src/backends/tensor.cpp
Normal file
11
src/backends/tensor.cpp
Normal 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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user