pass consider_constant to grad