dfdx
dfdx copied to clipboard
Create cuda tensor from CudaSlice
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
It looks like Cuda::build_tensor
mostly does this already?
Are there any issues in this project available for grabs?