Check that the tensor is contiguous before applying the kernel.

This commit is contained in:
laurent
2023-06-21 21:28:59 +01:00
parent 9834151254
commit 7c46de9584
3 changed files with 19 additions and 10 deletions

View File

@ -85,13 +85,15 @@ impl CudaStorage {
pub(crate) fn affine_impl(
&self,
shape: &Shape,
_stride: &[usize],
stride: &[usize],
mul: f64,
add: f64,
) -> Result<Self> {
match self {
Self::F32(arg) => {
// TODO: Handle the stride.
if !shape.is_contiguous(stride) {
todo!("affine is only implemented for the contiguous case")
}
let dev = arg.device();
let module_name = "affine_f32";
if !dev.has_func(module_name, module_name) {