see upstream pr https://github.com/tensorflow/tensorflow/pull/47957 (cherry picked from commit 42bfc113569c242947b7a0f6edf94031fbb8bac5)
see upstream pr https://github.com/tensorflow/tensorflow/pull/47957 (cherry picked from commit 42bfc113569c242947b7a0f6edf94031fbb8bac5)