Are there any function could stop training using validation loss?

In Keras, EarlyStopping could judge whether I should stop my training procedure, I am wondering if there is an API could do the same thing in PyTorch, or what method could do the same thing easy to implement?

Ignite has a handler to perform early stopping.


Thank you, it really helps