That is very surprising…
You can still check for inplace ops on the result of a transpose op.
Common ones happen in the Linear forward.
Why do you set retain_graph=True in your code btw?
Doing things like this would cause this error:
model = nn.Linear(...)
opt = optim.SGD(model.parameters(), ...)

out = model(inp)
out.backward(retain_graph=True)
opt.step()
out.backward() # Here, the linear weights were modified inplace