Leaf variable is one that you explicitly create (with constructors/factory functions, as Parameter etc.) so that it has no predecessors in the sense that is is not computed. requires_grad can mean two things

Either it is a leaf and you require_grad explicitly (or via making it a Parameter),
or it has been computed from things requiring gradient.

Your error could be that you assign or modify inplace a leaf variable where you should not. This is usually hard to diagnose without looking at the code.
Best regards
Thomas