implement the class for TF