Function juice::util::write_batch_sample

source ·
pub fn write_batch_sample<T: NumCast + Copy>(
    tensor: &mut SharedTensor<f32>,
    data: &[T],
    i: usize
)
Expand description

Write the 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.