Created
July 11, 2017 00:05
-
-
Save ezyang/936e4334ededb779b6a147bba7e25a1c to your computer and use it in GitHub Desktop.
Diff to word language model for JIT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/word_language_model/main.py b/word_language_model/main.py | |
index c4ea458..7ff9b61 100644 | |
--- a/word_language_model/main.py | |
+++ b/word_language_model/main.py | |
@@ -81,6 +81,8 @@ test_data = batchify(corpus.test, eval_batch_size) | |
ntokens = len(corpus.dictionary) | |
model = model.RNNModel(args.model, ntokens, args.emsize, args.nhid, args.nlayers, args.dropout, args.tied) | |
+import torch.jit | |
+model = torch.jit.verify_model(model) | |
if args.cuda: | |
model.cuda() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment