[caffe2] break one circular dependency between Caffe2 and ATen-cpu (#62632)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62632
Update the caffe2/core/context.h to directly use `at::mt19937` instead of the
`at::CPUGeneratorImpl` wrapper class from the ATen-cpu library.
Using `at::CPUGeneratorImpl` causes circular dependencies between the ATen and
caffe2 code. In particular the `at::CPUGeneratorImpl::get_state()` logic
depends on CPU Tensor functionality that currently depends on code from
caffe2.
Test Plan:
The RNG behavior should be identically to the previous code (perhaps even
faster since we now avoid virtual function calls).
buck test //caffe2/caffe2:caffe2_test_cpu \
//caffe2/caffe2/python: //caffe2/caffe2/fb/operators:
Differential Revision: D29915701
fbshipit-source-id: f9b2eab8d3b21b2224d30bcf52be9c0e7eb7cd0a