-
-
Save zou3519/2c6a820bc3ef0b3a9c3107d2c26fb064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import functorch | |
from functorch import vmap, grad | |
def foo(input, p): | |
result = torch.linalg.cond(input, p) | |
return result.sum() | |
input = torch.randn(5, 5) | |
p = 1 | |
grad(foo)(input, p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment