twitter-archive / torch-autograd

Autograd automatically differentiates native Torch code
Apache License 2.0
560 stars 115 forks source link

Add scalar support to gradcheck #135

Closed jakesnell closed 8 years ago

jakesnell commented 8 years ago

This branch adds scalar support to gradcheck. The pattern of using findGrad to locate a corresponding value inside a nested table doesn't work when the variable being searched for is a basic type. As an alternative I've added a few utilities to facilitate the access of values inside of nested tables and rewritten the functions in src/gradcheck.lua to accept the nested key as input rather than the variable itself (which could be a basic type).