-
Notifications
You must be signed in to change notification settings - Fork 115
Nil arguments prevent parsing later non-nil arguments #148
Comments
For me this example actually works fine, but in a bunch of places (like here) the arguments are stored in a table and then the length is taken. Lua's strange definition of the length operator means that the length at that point could be 1 or 3, so nothing makes sense anymore... |
Ah you're right, packing the args into a table is probably the issue. The simple workaround is never using nil as a default or packing all options into a table argument. However I think that if evaluating f this way will deterministically work in Lua then evaluating df should work as well. It looks like the best solution is to replace |
For |
|
Yes, everywhere that autograd parses the args of a function. There's also a similar issue for return values which should use
These issues with varargs and nil values are documented here and here on the lua-users wiki. |
A nil argument in a function seems to make all arguments after it nil when evaluating its derivative.
The text was updated successfully, but these errors were encountered: