Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 69a6b51

Browse files
authored
Update README.md (#176)
Readded missed `grad`
1 parent 0057b5f commit 69a6b51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def compute_loss(params, data, targets):
264264
preds = func_model(params, data)
265265
return torch.mean((preds - targets) ** 2)
266266

267-
per_sample_grads = vmap(compute_loss, (None, 0, 0))(params, data, targets)
267+
per_sample_grads = vmap(grad(compute_loss), (None, 0, 0))(params, data, targets)
268268
```
269269

270270
If you're making an ensemble of models, you may find

0 commit comments

Comments
 (0)