use ::burn::tensor::{Int, Tensor, backend::Backend};
pub fn fine_positions<B: Backend>(
height: usize,
width: usize,
x_sample_count: usize,
y_sample_count: usize,
device: &B::Device,
) -> (Tensor<B, 1>, Tensor<B, 1>) {
let fine_width = width * x_sample_count;
let fine_height = height * y_sample_count;
let x = (Tensor::<B, 1, Int>::arange(0..fine_width as i64, device).float() + 0.5)
/ x_sample_count as f32;
let y = (Tensor::<B, 1, Int>::arange(0..fine_height as i64, device).float() + 0.5)
/ y_sample_count as f32;
let x = x.unsqueeze_dim::<2>(0).repeat_dim(0, fine_height);
let y = y.unsqueeze_dim::<2>(1).repeat_dim(1, fine_width);
(
x.reshape([fine_height * fine_width]),
y.reshape([fine_height * fine_width]),
)
}