Tensors and dynamic neural networks in Python with strong GPU acceleration
PyTorch is a Python package that provides two high-level features: Tensor computation (like NumPy) with strong GPU acceleration; Deep neural networks built on a tape-based autograd system. You can reuse your favorite Python packages such as NumPy, SciPy and Cython to extend PyTorch when needed.
PyTorch is a Python package that provides two high-level features: Tensor computation (like NumPy) with strong GPU acceleration; Deep neural networks built on a tape-based autograd system. You can reuse your favorite Python packages such as NumPy, SciPy and Cython to extend PyTorch when needed.
The port py312-pytorch is built with Apple Metal Performance Shaders (MPS) support for GPU hardware acceleration. To enable Apple GPU devices, use device "mps". Matrix multiplication example:
import torch
mpsDevice = torch.device("mps" if torch.backends.mps.is_available() else "cpu") x = torch.randn((10_000, 1_000), device=mpsDevice) cov = (x.T @ x)/x.shape[0]