mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 03:54:56 +00:00
Check that the tensor is contiguous before applying the kernel.
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user