Skip to content

Commit aaa77ba

Browse files
authored
fix: Fix reverse mutating sequence (#957)
1 parent 0b1abc4 commit aaa77ba

File tree

1 file changed

+5
-2
lines changed
  • crates/cubecl-core/src/frontend/container/sequence

1 file changed

+5
-2
lines changed

crates/cubecl-core/src/frontend/container/sequence/base.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,11 @@ impl<T: CubeType> SequenceExpand<T> {
258258
}
259259

260260
pub fn __expand_rev_method(self, _scope: &mut Scope) -> Self {
261-
self.values.borrow_mut().reverse();
262-
self
261+
let mut values = self.values.borrow().clone();
262+
values.reverse();
263+
Self {
264+
values: Rc::new(RefCell::new(values)),
265+
}
263266
}
264267

265268
pub fn __expand_clone_method(&self, _scope: &mut Scope) -> Self {

0 commit comments

Comments
 (0)