Skip to content

Commit

Permalink
update README to make it runs with just tinygrad (tinygrad#7795)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyuxyz authored Nov 19, 2024
1 parent 170ece6 commit f16122f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit f16122f

Please sign in to comment.