d5a75ba09ae0595ca284fd806475eb8d3f771387,word_language_model/generate.py,,,#,18

Before Change



hidden = model.initHidden(1)

input = torch.LongTensor(1,1).fill_(int(math.floor(torch.rand(1)[0] * ntokens)))
if args.cuda:
    input = input.cuda()

After Change


        input.data.fill_(word_idx)
        word = corpus.dictionary.idx2word[word_idx]

        outf.write(word + ("\n" if i % 20 == 19 else " "))

        if i % args.log_interval == 0:
            print("| Generated {}/{} words".format(i, args.words))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pytorch/examples
Commit Name: d5a75ba09ae0595ca284fd806475eb8d3f771387
Time: 2017-01-17
Author: adam.paszke@gmail.com
File Name: word_language_model/generate.py
Class Name:
Method Name:


Project Name: pysb/pysb
Commit Name: 242b37fab5f5286cc3a874ac2a2eb89f617d2e37
Time: 2013-03-11
Author: bachmanjohn@gmail.com
File Name: pysb/exporters/mathematica.py
Class Name: ExportMathematica
Method Name: export