[PyTorch] Fix extra refcount bumps in ClassAttribute (#66723)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66723
Missing move in constructor and forced copy in getter.
ghstack-source-id: 141594742
Test Plan: CI
Reviewed By: suo
Differential Revision: D31697702
fbshipit-source-id: c2018531e7ec4a4853cd003ea3753273a5fae7fb