ARCHIVED, because there is already one for you:
https://github.com/ncullen93/torchsample
Keras.Model::fit
-like torch fit implementation
$ pip install torch-fit
from torch_fit import fit
model = MyPyTorchModule()
history = fit(
model,
loss='mse',
metrics='mae',
epochs=100
)