Lapack is way to efficiently slice and dice matrix to use memory on CPUs to make matrix computations… in case of GPUs , PyTorch uses Magma if your pytorch was built with this resource enabled to better use your GPU memory using lapack interface