- DifferentialEquation.make_thunk(node, storage_map, compute_map, no_recycling, impl=None)#
Create a thunk.
This function must return a thunk, that is a zero-arguments function that encapsulates the computation to be performed by this op on the arguments of the node.
Something previously returned by
dictmapping Variables to single-element lists where a computed value for each Variable may be found.
dictmapping Variables to single-element lists where a boolean value can be found. The boolean indicates whether the Variable’s storage_map container contains a valid value (i.e.
True) or whether it has not been computed yet (i.e.
List of Variables for which it is forbidden to reuse memory allocated by a previous call.
Description for the type of node created (e.g.
If the thunk consults the storage_map on every call, it is safe for it to ignore the no_recycling argument, because elements of the no_recycling list will have a value of
Nonein the storage_map. If the thunk can potentially cache return values (like CLinker does), then it must not do so for variables in the no_recycling list.
Op.prepare_node()is always called. If it tries
'c'and it fails, then it tries
Op.prepare_node()will be called twice.