MCPcopy Create free account
hub / github.com/pytorch/tutorials / predict_with_output_summed

Function predict_with_output_summed

intermediate_source/jacobians_hessians.py:290–291  ·  view source on GitHub ↗
(weight, bias, x)

Source from the content-addressed store, hash-verified

288# and then computing the Jacobian of that function:
289
290def predict_with_output_summed(weight, bias, x):
291 return predict(weight, bias, x).sum(0)
292
293batch_jacobian1 = jacrev(predict_with_output_summed, argnums=2)(weight, bias, x).movedim(1, 0)
294assert torch.allclose(batch_jacobian0, batch_jacobian1)

Callers

nothing calls this directly

Calls 1

predictFunction · 0.85

Tested by

no test coverage detected