In this short paper, we obtain the Hamilton type gradient estimate for the sub-elliptic operators satisfying the generalized curvature-dimension inequality CD(ρ 1 , ρ 2 , k, d), which is introduced by F. Baudoin and N. Garofalo. As a consequence, we obtain the gradient estimate for the logarithm of the associated heat kernels.