Bug: `as_vec` crashes for empty Tensors
emchristiansen opened this issue · 0 comments
emchristiansen commented
Code:
let dev = Cpu::default();
let x: Tensor<(usize,), f32, Cpu> = dev.ones_like(&(0,));
// This line crashes.
x.as_vec();
Crash message:
Message: index out of bounds: the len is 0 but the index is 0
Location: dfdx/src/tensor/cpu/iterate.rs:173