# From audio to tensor

> Every audio clip that enters a model becomes a tensor. Its shape decides memory and speed.

PyTorch · November 2, 2026 · Pedro Cormann, Founder & Machine Learning Engineer · https://lero.studio/research/en/tensores

In PyTorch, audio is a tensor with shape [batch, channels, samples]. Ten seconds at 48 kHz in mono is 480 thousand numbers. In float32 each number takes 4 bytes; in bfloat16, 2. The dtype sets precision and memory, and the device says where the tensor lives: on the CPU or on the GPU.

_(Interactive on the page: https://lero.studio/research/en/tensores)_

Moving data between the two costs time. That is why audio is loaded, trimmed and normalized with the GPU batch in mind. Change the duration, sample rate, dtype and batch and watch the memory grow.

_(Interactive on the page: https://lero.studio/research/en/tensores)_
