Added partial support for TF2.