dfdx icon indicating copy to clipboard operation
dfdx copied to clipboard

Create cuda tensor from CudaSlice

Open coreylowman opened this issue 1 year ago • 2 comments

Similar to how we can create a cpu tensor from a Vec, it'd be nice to be able to pass in a separately allocated CudaSlice.

The new method of this would look like:

impl Cuda {
    pub fn tensor_from_buf<S: Shape, E: Dtype>(&self, buf: CudaSlice<E>, shape: S) -> Tensor<S, E, Self> {
       ...
    }
}

And can be added in src/tensor/cuda/allocate.rs

coreylowman avatar Feb 28 '23 14:02 coreylowman

It looks like Cuda::build_tensor mostly does this already?

DogPawHat avatar Aug 25 '23 10:08 DogPawHat

Are there any issues in this project available for grabs?

murluki avatar May 20 '24 15:05 murluki