pub fn write_batch_sample<T: NumCast + Copy>(
tensor: &mut SharedTensor<f32>,
ith sample of a batch into a SharedTensor.
The size of a single sample is inferred through the first dimension of the SharedTensor, which is assumed to be the batchsize.
Allocates memory on a Native Backend if neccessary.