Closed
Description
I've been trying to get a simple example working with the OpAssign traits but it seems that there is a bug there.
This code compiles and runs fine:
fn main() {
af::set_backend(raf::Backend::CPU);
let mut a = Array::new(&[1.0,1.0,1.0], Dim4::new(&[3,1,1,1]));
let b = Array::new(&[1.0,2.0,1.0], Dim4::new(&[3,1,1,1]));
a = a - b;
}
However if I switch to the SubAssign trait:
fn main() {
raf::set_backend(raf::Backend::CPU);
let mut a = Array::new(&[1.0,1.0,1.0], Dim4::new(&[3,1,1,1]));
let b = Array::new(&[1.0,2.0,1.0], Dim4::new(&[3,1,1,1]));
a -= b;
}
I get the following runtime error: thread 'main' panicked at 'Error message: Size is incorrect'
. This message persists even if I replace b
with a.clone()
.
Metadata
Metadata
Assignees
Labels
No labels