Is there `linspace`?
#2578
-
Same as title, something similar to I tried to search in issues, discussion, book, doc.rs and didn't find anything similar to this. For now, I'm using this temporary solution: fn linspace(v_min: f32, v_max: f32, steps: usize, device: &B::Device) -> Tensor<B, 1> {
let arange = Tensor::<B, 1, Int>::arange(0..steps as i64, device);
arange.float() * (v_max - v_min) / (steps - 1) as f64 + v_min
} Edit: fix |
Beta Was this translation helpful? Give feedback.
Answered by
laggui
Dec 2, 2024
Replies: 1 comment
-
There is no |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
med1844
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no
linspace
equivalent atm, so your solution is a good way to achieve that :)