Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
eduardoleao052 authored Nov 15, 2024
1 parent e99954e commit d50b89f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -126,6 +126,7 @@
### Simple Autograd Example:

```typescript
// Require the Library if running in node (not necessary in the browser):
const { torch } = require("js-pytorch");

// Pass device as an argument to a Tensor or nn.Module (same as PyTorch):
@@ -151,9 +152,11 @@ console.log(b.grad);
### Complex Autograd Example (Transformer):

```typescript
// Require the Library if running in node (not necessary in the browser):
const { torch } = require("js-pytorch");
const nn = torch.nn;
const optim = torch.optim;

const device = 'gpu';

// Define training hyperparameters:

0 comments on commit d50b89f

Please sign in to comment.