[caffe2] merge internal (RowWise)SparseAdagrad into open source version (#35090)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35090
As a preparation to open source fp16 + stochastic rounding SparseAdagrad and fused SparseAdagrad
Other minor changes:
* Removed template parameters T that are not actually used
* Removed unnecessary anonymous namespaces used in header files
Test Plan: CI
Reviewed By: jianyuh
Differential Revision: D20552770
fbshipit-source-id: 224fdca15ea786620ce88e33cbcbf97661423538