dfdx icon indicating copy to clipboard operation
dfdx copied to clipboard

Create cuda tensor from CudaSlice

Open chelsea0x3b opened this issue 3 years 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

chelsea0x3b avatar Feb 28 '23 14:02 chelsea0x3b

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?

etimofeeva avatar May 20 '24 15:05 etimofeeva