It might be more readable if you do: 

        grad = np.zeros( log_vector.shape[0] )