0ad33d606682537466f3430fc6d6ac7d47460f1a,beginner_source/nlp/word_embeddings_tutorial.py,,,#,237

Before Change



        // Step 4. Compute your loss function. (Again, Torch wants the target
        // word wrapped in a variable)
        loss = loss_function(log_probs, autograd.Variable(
            torch.LongTensor([word_to_ix[target]])))

        // Step 5. Do the backward pass and update the gradient
        loss.backward()

After Change



        // Step 4. Compute your loss function. (Again, Torch wants the target
        // word wrapped in a variable)
        loss = loss_function(log_probs, torch.tensor([word_to_ix[target]], dtype=torch.long))

        // Step 5. Do the backward pass and update the gradient
        loss.backward()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pytorch/tutorials
Commit Name: 0ad33d606682537466f3430fc6d6ac7d47460f1a
Time: 2018-04-24
Author: soumith@gmail.com
File Name: beginner_source/nlp/word_embeddings_tutorial.py
Class Name:
Method Name:


Project Name: pytorch/tutorials
Commit Name: 0ad33d606682537466f3430fc6d6ac7d47460f1a
Time: 2018-04-24
Author: soumith@gmail.com
File Name: intermediate_source/char_rnn_classification_tutorial.py
Class Name:
Method Name: randomTrainingExample


Project Name: pytorch/tutorials
Commit Name: 0ad33d606682537466f3430fc6d6ac7d47460f1a
Time: 2018-04-24
Author: soumith@gmail.com
File Name: beginner_source/former_torchies/nn_tutorial.py
Class Name:
Method Name: