A generalization of the grade of a module