Refactor Tensor methods to use void* for data handling and add device_ptr method

This commit is contained in:
2025-11-27 21:18:51 +01:00
parent 9ff214d759
commit c855ae89ec
5 changed files with 24 additions and 28 deletions

View File

@@ -92,6 +92,18 @@ size_t Tensor::size() const {
return total_size;
}
void* Tensor::device_ptr() {
return d_ptr;
}
void Tensor::zero() {
backend->zero(*this);
}
void Tensor::fill(int value) {
backend->fill(*this, value);
}
void Tensor::set_data(void *data) {
backend->copy_to_device(*this, data, total_size);
}