  We show that the sequence of dimensions of the linear spaces, generated by a
given rank-metric code together with itself under several applications of a
field automorphism, is an invariant for the whole equivalence class of the
code. These invariants give rise to an easily computable criterion to check if
two codes are inequivalent. With this criterion we then derive bounds on the
number of equivalence classes of classical and twisted Gabidulin codes.
