def grad_sources_inputs(sources, inputs):
 if (inputs is None):
  inputs = theano.gof.graph.inputs([source[0] for source in sources])
 return dict(izip(inputs, theano.gradient.grad(cost=None, known_grads=dict(sources), wrt=inputs, consider_constant=inputs)))

def grad_sources_inputs ( sources , inputs ) : if ( inputs is None ) : inputs = theano . gof . graph . inputs ( [ source [ 0 ] for source in sources ] ) return dict ( izip ( inputs , theano . gradient . grad ( cost = None , known_grads = dict ( sources ) , wrt = inputs , consider_constant = inputs ) ) )
this implements the old grad_sources_inputs function in terms of the new interface so the tests dont need to be rewritten .