theano/gof/op.py
def make_thunk(self, node, storage_map, compute_map, no_recycling,
                   impl=None):
        """
        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.

        Parameters
        ----------
        node
            Something previously returned by self.make_node.
        storage_map
            dict variable -> one-element-list where a computed
            value for this variable may be found.
        compute_map
            dict variable -> one-element-list where a boolean
            value will be found. The boolean indicates whether the
            variable's storage_map container contains a valid value (True)
            or if it has not been computed yet (False).
        no_recycling
            List of variables for which it is forbidden to reuse memory
            allocated by a previous call.
        impl
            Currently, None, 'c' or 'py'. If 'c' or 'py' we will only try
            that version of the code.

        Notes
        -----
        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 None in 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.

        self.prepare_node(node, ...) is always called. If we try 'c' and it
        fail and we try again 'py', prepare_node will be called twice.
        """

        if (impl is None and theano.config.cxx) or impl == 'c':
            self.prepare_node(node, storage_map=storage_map,
                              compute_map=compute_map, impl='c')
            try:
                return self.make_c_thunk(node, storage_map, compute_map,
                                         no_recycling)
            except (NotImplementedError, utils.MethodNotDefined):
                # We requested the c code, so don't catch the error.
                if impl == 'c':
                    raise
                _logger.debug('Falling back on perform')

        # condition: either there was no c_code, or it failed or
        # python code was requested.
        self.prepare_node(node, storage_map=storage_map,
                          compute_map=compute_map, impl='py')
        return self.make_py_thunk(node, storage_map, compute_map, no_recycling)

        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.

        Parameters
        ----------
        node
            Something previously returned by self.make_node.
        storage_map
            dict variable -> one-element-list where a computed
            value for this variable may be found.
        compute_map
            dict variable -> one-element-list where a boolean
            value will be found. The boolean indicates whether the
            variable's storage_map container contains a valid value (True)
            or if it has not been computed yet (False).
        no_recycling
            List of variables for which it is forbidden to reuse memory
            allocated by a previous call.
        impl
            Currently, None, 'c' or 'py'. If 'c' or 'py' we will only try
            that version of the code.

        Notes
        -----
        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 None in 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.

        self.prepare_node(node, ...) is always called. If we try 'c' and it
        fail and we try again 'py', prepare_node will be called twice.
        
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.

Parameters

node
Something previously returned by self.make_node.
storage_map
dict variable -> one-element-list where a computed
value for this variable may be found.
compute_map
dict variable -> one-element-list where a boolean
value will be found. The boolean indicates whether the
variable's storage_map container contains a valid value (True)
or if it has not been computed yet (False).
no_recycling
List of variables for which it is forbidden to reuse memory
allocated by a previous call.
impl
Currently, None, 'c' or 'py'. If 'c' or 'py' we will only try
that version of the code.

Notes

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 None in 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.


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 . Parameters node Something previously returned by self . make_node . storage_map dict variable - > one - element - list where a computed value for this variable may be found . compute_map dict variable - > one - element - list where a boolean value will be found . The boolean indicates whether the variable ' s storage_map container contains a valid value ( True ) or if it has not been computed yet ( False ) . no_recycling List of variables for which it is forbidden to reuse memory allocated by a previous call . impl Currently None ' c ' or ' py ' . If ' c ' or ' py ' we will only try that version of the code . Notes 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 None in 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 .
def make_thunk(self, node, storage_map, compute_map, no_recycling,
                   impl=None):
        if (impl is None and theano.config.cxx) or impl == 'c':
            self.prepare_node(node, storage_map=storage_map,
                              compute_map=compute_map, impl='c')
            try:
                return self.make_c_thunk(node, storage_map, compute_map,
                                         no_recycling)
            except (NotImplementedError, utils.MethodNotDefined):
                if impl == 'c':
                    raise
                _logger.debug('Falling back on perform')
        self.prepare_node(node, storage_map=storage_map,
                          compute_map=compute_map, impl='py')
        return self.make_py_thunk(node, storage_map, compute_map, no_recycling)
def make_thunk ( self , node , storage_map , compute_map , no_recycling , impl = None ) : if ( impl is None and theano . config . cxx ) or impl == 'c' : self . prepare_node ( node , storage_map = storage_map , compute_map = compute_map , impl = 'c' ) try : return self . make_c_thunk ( node , storage_map , compute_map , no_recycling ) except ( NotImplementedError , utils . MethodNotDefined ) : if impl == 'c' : raise _logger . debug ( 'Falling back on perform' ) self . prepare_node ( node , storage_map = storage_map , compute_map = compute_map , impl = 'py' ) return self . make_py_thunk ( node , storage_map , compute_map , no_recycling )
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.
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 .
"""
        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.

        Parameters
        ----------
        node
            Something previously returned by self.make_node.
        storage_map
            dict variable -> one-element-list where a computed
            value for this variable may be found.
        compute_map
            dict variable -> one-element-list where a boolean
            value will be found. The boolean indicates whether the
            variable's storage_map container contains a valid value (True)
            or if it has not been computed yet (False).
        no_recycling
            List of variables for which it is forbidden to reuse memory
            allocated by a previous call.
        impl
            Currently, None, 'c' or 'py'. If 'c' or 'py' we will only try
            that version of the code.

        Notes
        -----
        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 None in 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.

        self.prepare_node(node, ...) is always called. If we try 'c' and it
        fail and we try again 'py', prepare_node will be called twice.
        """ # We requested the c code, so don't catch the error. # condition: either there was no c_code, or it failed or # python code was requested.
self
node
storage_map
compute_map
no_recycling
impl