As mentioned before, nn.Identity will just return the input without any clone usage or manipulation of the input. The input and output would thus be the same.



 TheOraware:

what is the point of nn.Identity()?


Yes, this “pass-through” layer can easily be written manually, which was also the reason feature requests were declined in the past.
However, since a lot of users were rewriting the same layer to e.g. replace specific modules inside a larger model, this layer was introduced.