Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/pytorch/tutorials
/ loss_fn
Function
loss_fn
intermediate_source/per_sample_grads.py:47–48 ·
view source on GitHub ↗
(predictions, targets)
Source
from the content-addressed store, hash-verified
45
return
output
46
47
def
loss_fn(predictions, targets):
48
return
F.nll_loss(predictions, targets)
49
50
51
######################################################################
Callers
13
amp_recipe.py
File · 0.85
polynomial_nn.py
File · 0.85
polynomial_optim.py
File · 0.85
trainingyt.py
File · 0.85
train_one_epoch
Function · 0.85
train
Function · 0.85
test
Function · 0.85
train_loop
Function · 0.85
test_loop
Function · 0.85
per_sample_grads.py
File · 0.85
compute_grad
Function · 0.85
compute_loss
Function · 0.85
Calls
no outgoing calls
Tested by
1
test_loop
Function · 0.68