def _theano_hamiltonian(model_vars, shared, logpt, potential):
 dlogp = gradient(logpt, model_vars)
 ((logp, dlogp), q) = join_nonshared_inputs([logpt, dlogp], model_vars, shared)
 logp = CallableTensor(logp)
 dlogp = CallableTensor(dlogp)
 return (Hamiltonian(logp, dlogp, potential), q)

def _theano_hamiltonian ( model_vars , shared , logpt , potential ) : dlogp = gradient ( logpt , model_vars ) ( ( logp , dlogp ) , q ) = join_nonshared_inputs ( [ logpt , dlogp ] , model_vars , shared ) logp = CallableTensor ( logp ) dlogp = CallableTensor ( dlogp ) return ( Hamiltonian ( logp , dlogp , potential ) , q )
creates a hamiltonian with shared inputs .