Remove functor factories in KernelFunction (#35488)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35488
-
The original problem why those existed was a SIOF (see the multi-line comment that is deleted in this PR).
However, I think this SIOF situation only happened for caffe2 kernels exposed to PyTorch and those now use a different mechanism that shouldn't cause the SIOF anymore (they now create the caffe2 kernel instance on each call instead of storing it in the functor). If this PR passes CI, I'm assuming that the SIOF doesn't exist anymore and we can simplify this code.
ghstack-source-id: 101933838
Test Plan: waitforsandcastle
Differential Revision: D20676093
fbshipit-source-id: 462e11f75f45d9012095d87f447be88416f5dcdc