-
-
Save funrep/ced4c79fd97cbc945e8a5a83c4b30dc8 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 Torch.Autograd | |
main :: IO () | |
main = do | |
let f = asTensor ([2.0] :: [Double]) | |
x <- sequence . map makeIndependent $ [asTensor (1.0 :: Double), asTensor (2.0 :: Double)] | |
print $ requiresGrad f | |
print $ grad f x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
False
foobar: CppStdException "Exception: Differentiated tensor not require grad; type: std::runtime_error"