(inputs, outputs, dtypes={}, cache=None, **kwargs)
return theano.function(tinputs, toutputs, **theano_kwargs)
Create Theano function from SymPy expressions
Create Theano function from SymPy expressions
Create Theano function from SymPy expressions
def theano_function(inputs, outputs, dtypes={}, cache=None, **kwargs):
    """ Create Theano function from SymPy expressions """
    cache = {} if cache == None else cache
    broadcastables = dim_handling(inputs, **kwargs)

    # Remove keyword arguments corresponding to dim_handling
    dim_names = inspect.getargspec(dim_handling)[0]
    theano_kwargs = dict((k, v) for k, v in kwargs.items()
                                if k not in dim_names)

    code = partial(theano_code, cache=cache, dtypes=dtypes,
                   broadcastables=broadcastables)
    tinputs  = list(map(code, inputs))
    toutputs = list(map(code, outputs))
    toutputs = toutputs[0] if len(toutputs) == 1 else toutputs
    return theano.function(tinputs, toutputs, **theano_kwargs)
def theano_function ( inputs , outputs , dtypes = { } , cache = None , * * kwargs ) : cache = { } if cache == None else cache broadcastables = dim_handling ( inputs , * * kwargs ) # Remove keyword arguments corresponding to dim_handling dim_names = inspect . getargspec ( dim_handling ) [ 0 ] theano_kwargs = dict ( ( k , v ) for k , v in kwargs . items ( ) if k not in dim_names ) code = partial ( theano_code , cache = cache , dtypes = dtypes , broadcastables = broadcastables ) tinputs = list ( map ( code , inputs ) ) toutputs = list ( map ( code , outputs ) ) toutputs = toutputs [ 0 ] if len ( toutputs ) == 1 else toutputs return theano . function ( tinputs , toutputs , * * theano_kwargs )