Does pytorch register modules that are assigned to object properties?
Say I have a module like:
class MyModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.cnn = CNN(params)

And then I do:
module = MyModule()
module.cnn = CNN(some_other_params)

Is the replacement registered? Will there be any nasty side effects down the line?

Yes. This is the standard way to reassign attributes. Whether there are nasty side effects depends on whether your replacement is specified compatibly.
