Split TensorIteratorConfig out of TensorIterator (#39803)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39803
The basic concept is to make it more clear what the construction
side API is, as opposed to the "I want to actually do kernel stuff
with TensorIterator" API (which has been kept on TensorIterator.)
In fact, most of the stuff in TensorIteratorConfig isn't used by
TensorIterator later, so it can be dropped entirely after construction.
Before:
```
TensorIterator iter;
iter.config1();
iter.config2();
iter.config3();
iter.build();
// use iter
```
Now:
```
TensorIterator iter = TensorIteratorConfig()
.config1()
.config2()
.config3()
.build();
// use iter
```
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Differential Revision: D22018845
Pulled By: ezyang
fbshipit-source-id: 5baca9a4dc87149d71a44489da56d299f9b12b34