update README to make it runs with just tinygrad (#7795)

This commit is contained in:
chenyu
2024-11-19 17:25:12 -05:00
committed by GitHub
parent 170ece6605
commit f16122f9c4

View File

@@ -125,8 +125,8 @@ y = Tensor([[2.0,0,-2.0]], requires_grad=True)
z = y.matmul(x).sum()
z.backward()
print(x.grad.numpy()) # dz/dx
print(y.grad.numpy()) # dz/dy
print(x.grad.tolist()) # dz/dx
print(y.grad.tolist()) # dz/dy
```
The same thing but in PyTorch:
@@ -138,8 +138,8 @@ y = torch.tensor([[2.0,0,-2.0]], requires_grad=True)
z = y.matmul(x).sum()
z.backward()
print(x.grad.numpy()) # dz/dx
print(y.grad.numpy()) # dz/dy
print(x.grad.tolist()) # dz/dx
print(y.grad.tolist()) # dz/dy
```
## Contributing