From 318d143224805e490d396874b9e1aaf28991393c Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Wed, 3 Apr 2024 09:02:38 +0200 Subject: Relax the contiguous check for cuda kernels. (#2000) * Relax the contiguous check for cuda kernels. * Ensure contiguity for RNNs. * Unrelated fix for segment anything. * Better error message + allow concatenating empty slices. --- candle-nn/src/rnn.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'candle-nn') diff --git a/candle-nn/src/rnn.rs b/candle-nn/src/rnn.rs index 07795eda..dbfa639b 100644 --- a/candle-nn/src/rnn.rs +++ b/candle-nn/src/rnn.rs @@ -31,7 +31,7 @@ pub trait RNN { let (_b_size, seq_len, _features) = input.dims3()?; let mut output = Vec::with_capacity(seq_len); for seq_index in 0..seq_len { - let input = input.i((.., seq_index, ..))?; + let input = input.i((.., seq_index, ..))?.contiguous()?; let state = if seq_index == 0 { self.step(&input, init_state)? } else { -- cgit v1.2.3