use cubecl::prelude::*;
use cubecl::server::Handle;
use cubecl::zspace::{Shape, Strides};
use super::DspFloat;
pub fn transpose<F: DspFloat>(client: &Client, input: &Handle, output: &Handle, rows: usize, cols: usize) {
if rows == 0 || cols == 0 {
return;
}
let (input, output) = unsafe {
(
TensorBinding::from_raw_parts(input.clone(), Strides::new(&[1, cols]), Shape::new([cols, rows])),
TensorBinding::from_raw_parts(output.clone(), Strides::new(&[rows, 1]), Shape::new([cols, rows])),
)
};
cubecl::std::tensor::copy_into(client, input, output, F::elem_type_native());
}