theano/gof/op.py
def make_py_thunk(self, node, storage_map, compute_map, no_recycling,
                      debug=False):
        """
        Like make_thunk() but only makes python thunks.

        """
        node_input_storage = [storage_map[r] for r in node.inputs]
        node_output_storage = [storage_map[r] for r in node.outputs]

        if debug:
            p = node.op.debug_perform
        else:
            p = node.op.perform

        params = node.run_params()

        if params is graph.NoParams:
            # default arguments are stored in the closure of `rval`
            def rval(p=p, i=node_input_storage, o=node_output_storage, n=node):
                r = p(n, [x[0] for x in i], o)
                for o in node.outputs:
                    compute_map[o][0] = True
                return r
        else:
            params_val = node.params_type.filter(params)

            def rval(p=p, i=node_input_storage, o=node_output_storage, n=node,
                     params=params_val):
                r = p(n, [x[0] for x in i], o, params)
                for o in node.outputs:
                    compute_map[o][0] = True
                return r

        rval.inputs = node_input_storage
        rval.outputs = node_output_storage
        rval.perform = p
        rval.lazy = False
        return rval

        Like make_thunk() but only makes python thunks.

        
Like make_thunk() but only makes python thunks.
Like make_thunk () but only makes python thunks .
def make_py_thunk(self, node, storage_map, compute_map, no_recycling,
                      debug=False):
        node_input_storage = [storage_map[r] for r in node.inputs]
        node_output_storage = [storage_map[r] for r in node.outputs]
        if debug:
            p = node.op.debug_perform
        else:
            p = node.op.perform
        params = node.run_params()
        if params is graph.NoParams:
            def rval(p=p, i=node_input_storage, o=node_output_storage, n=node):
                r = p(n, [x[0] for x in i], o)
                for o in node.outputs:
                    compute_map[o][0] = True
                return r
        else:
            params_val = node.params_type.filter(params)
            def rval(p=p, i=node_input_storage, o=node_output_storage, n=node,
                     params=params_val):
                r = p(n, [x[0] for x in i], o, params)
                for o in node.outputs:
                    compute_map[o][0] = True
                return r
        rval.inputs = node_input_storage
        rval.outputs = node_output_storage
        rval.perform = p
        rval.lazy = False
        return rval
def make_py_thunk ( self , node , storage_map , compute_map , no_recycling , debug = False ) : node_input_storage = [ storage_map [ r ] for r in node . inputs ] node_output_storage = [ storage_map [ r ] for r in node . outputs ] if debug : p = node . op . debug_perform else : p = node . op . perform params = node . run_params ( ) if params is graph . NoParams : def rval ( p = p , i = node_input_storage , o = node_output_storage , n = node ) : r = p ( n , [ x [ 0 ] for x in i ] , o ) for o in node . outputs : compute_map [ o ] [ 0 ] = True return r else : params_val = node . params_type . filter ( params ) def rval ( p = p , i = node_input_storage , o = node_output_storage , n = node , params = params_val ) : r = p ( n , [ x [ 0 ] for x in i ] , o , params ) for o in node . outputs : compute_map [ o ] [ 0 ] = True return r rval . inputs = node_input_storage rval . outputs = node_output_storage rval . perform = p rval . lazy = False return rval
Like make_thunk() but only makes python thunks.
Like make_thunk () but only makes python thunks .
"""
        Like make_thunk() but only makes python thunks.

        """ # default arguments are stored in the closure of `rval`
self
node
storage_map
compute_map
no_recycling
debug