0ad33d606682537466f3430fc6d6ac7d47460f1a,beginner_source/blitz/data_parallel_tutorial.py,,,#,118
Before Change
//
for data in rand_loader:
if torch.cuda.is_available():
input_var = Variable(data.cuda())
else:
input_var = Variable(data)
output = model(input_var)
print("Outside: input size", input_var.size(),
"output_size", output.size())
After Change
//
for data in rand_loader:
input = data.to(device)
output = model(input)
print("Outside: input size", input.size(),
"output_size", output.size())
In pattern: SUPERPATTERN
Frequency: 6
Non-data size: 8
Instances
Project Name: pytorch/tutorials
Commit Name: 0ad33d606682537466f3430fc6d6ac7d47460f1a
Time: 2018-04-24
Author: soumith@gmail.com
File Name: beginner_source/blitz/data_parallel_tutorial.py
Class Name:
Method Name:
Project Name: kengz/SLM-Lab
Commit Name: 861657d2c9b321961994c8cdd0e58b6c4fe0645f
Time: 2018-09-03
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/policy_util.py
Class Name:
Method Name: init_action_pd
Project Name: keras-team/autokeras
Commit Name: 4fb281b7f9f5e549e29addd5641eac007c5ed385
Time: 2019-02-09
Author: jhfjhfj1@gmail.com
File Name: autokeras/pretrained/face_detector.py
Class Name: FaceDetector
Method Name: detect_pnet
Project Name: kengz/SLM-Lab
Commit Name: 861657d2c9b321961994c8cdd0e58b6c4fe0645f
Time: 2018-09-03
Author: kengzwl@gmail.com
File Name: slm_lab/agent/net/recurrent.py
Class Name: RecurrentNet
Method Name: init_hidden
Project Name: thunlp/OpenNRE
Commit Name: cdd4f684667d102267091f0288087825132f55c7
Time: 2020-04-03
Author: Jacen789@gmail.com
File Name: opennre/encoder/bert_encoder.py
Class Name: BERTEntityEncoder
Method Name: forward