albanD:

F.identity I don’t think that exists.


here is the corrected code:
d = torch.nn.Identity()(a)

I still don’t understand why .clone() exists. It seems useless.
Why would one want to record .clone if it’s identical to the identity?