it is a no-op, in a sense that only python bytecode of identity function is executed. your problem is likely elsewhere (note that cuda.memory_allocated() is not changed by nn.Identity, but you may be blocking tensor freeing somehow)