Deep learning library for tensors and dynamic neural networks
Tensors and dynamic neural networks
python$ python -c "import torch; x = torch.tensor([1.0, 2.0, 3.0]); print(x)"$ python -c "import torch; import torch.nn as nn; model = nn.Linear(10, 5); print(model)"$ python -c "import torch; x = torch.tensor([1.0, 2.0], requires_grad=True); y = (x**2).sum(); y.backward(); print(x.grad)"