def gradient1(f, v):
 return tt.flatten(tt.grad(f, v, disconnected_inputs='warn'))

def gradient1 ( f , v ) : return tt . flatten ( tt . grad ( f , v , disconnected_inputs = 'warn' ) )
flat gradient of f wrt v .