Depends on how much is passed along.
If you fight someone better than you, but there's no communication or dialogue about the what, why, how, it's no better than fighting the AI.
Presuming that the "sessions" are friendly and educational, both have their place. Fight a better player to get better, fight a similar player to refine your betterment.