f should be a file-like object (e.g. obtained from a call to open), or a path to the file where the model will be saved. torch.save is exactly what you should use, but we recommend serializing only the model.state_dict(). You can later load it using load_state_dict.