1b50e0ce69cff758a6ed4cef847c01e9aa5b3f2d,tools/release_model.py,,,#,5
Before Change
import torch
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Removes the optim data of PyTorch models")
parser.add_argument("--model", "-m",
help="The model filename (*.pt)", required=True)
parser.add_argument("--output", "-o",
help="The output filename (*.pt)", required=True)
opt = parser.parse_args()
model = torch.load(opt.model)
model["optim"] = None
torch.save(model, opt.output)
After Change
from onmt.bin.release_model import main
if __name__ == "__main__":
main()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: 1b50e0ce69cff758a6ed4cef847c01e9aa5b3f2d
Time: 2020-01-28
Author: guillaumekln@users.noreply.github.com
File Name: tools/release_model.py
Class Name:
Method Name:
Project Name: GoogleCloudPlatform/ml-on-gcp
Commit Name: 8079adae33711e4886a625df3f0ae9860739f7b9
Time: 2019-09-03
Author: yuhanliu@google.com
File Name: example_zoo/tools/process.py
Class Name:
Method Name:
Project Name: pytorch/audio
Commit Name: 740c5a860a741d1507174a71fb6e51d6f65d9c41
Time: 2017-08-19
Author: david@da3.net
File Name: test/test.py
Class Name:
Method Name: