Inner function closure for calculating gradients.
(*args, **kwargs)
source not stored for this graph (policy: none)