MCPcopy Index your code
hub / github.com/pytorch/tutorials / log_softmax

Function log_softmax

beginner_source/nn_tutorial.py:138–139  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

136# automatically.
137
138def log_softmax(x):
139 return x - x.exp().sum(-1).log().unsqueeze(-1)
140
141def model(xb):
142 return log_softmax(xb @ weights + bias)

Callers 1

modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected