As @KFrank said, the two classes are indeed the same.
If you look at the “__ init__.py” files 2 of the “nn” module, you see that the first line
from .modules import *

imports all the names defined in the “__ all__” list in “modules” 's “__ init__.py” file 1 into the namespace of “nn”. And you can check that “Module”, which is imported from “module”
from .module import Module

, is contained in the “__ all__” list.
Hence, “nn.Module” is indeed “nn.modules.module.Module”
For details, you can see this python docs, 6.4. Packages 2