PR https://github.com/tensorflow/tensorflow/pull/61309: Fix MSVC compile errors
This is a finalized PR of https://github.com/tensorflow/tensorflow/pull/61309. Add `int tf_min/max()` overloading, fix operator errors and casting errors.