cb8e2c5d60f79803d234da504477193611836d1f,pytext/task/new_task.py,_NewTask,predict,#_NewTask#Any#,225
Before Change
results = []
for row in examples:
numberized_rows = self.data.numberize_rows([row])
batches = self.data.batcher.batchify(numberized_rows)
_, inputs = next(pad_and_tensorize_batches(self.data.tensorizers, batches))
model_inputs = self.model.arrange_model_inputs(inputs)
model_context = self.model.arrange_model_context(inputs)
predictions, scores = self.model.get_pred(
self.model(*model_inputs), context=model_context
After Change
}
tensor_dict = {
name: tensorizer.tensorize(batch=numberized_row[name])
for name, tensorizer in input_tensorizers.items()
}
model_inputs = self.model.arrange_model_inputs(tensor_dict)
model_context = self.model.arrange_model_context(tensor_dict)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: facebookresearch/pytext
Commit Name: cb8e2c5d60f79803d234da504477193611836d1f
Time: 2020-04-20
Author: stevenliu@fb.com
File Name: pytext/task/new_task.py
Class Name: _NewTask
Method Name: predict
Project Name: pytorch/tutorials
Commit Name: 3128e13109c8766eafb413f2428bba976701e929
Time: 2020-12-02
Author: 6156351+zhangguanheng66@users.noreply.github.com
File Name: beginner_source/transformer_tutorial.py
Class Name:
Method Name:
Project Name: dnouri/skorch
Commit Name: e82c5a5ad0873d0ac8bf824b603f163ee5ac18ef
Time: 2017-07-24
Author: marian.tietz@ottogroup.com
File Name: examples/word_language_model/train.py
Class Name: Loader
Method Name: __init__
Project Name: dmlc/gluon-nlp
Commit Name: 489db85647d6de8a42f9fc5162e1e9ef0831800b
Time: 2018-08-02
Author: leonard@lausen.nl
File Name: gluonnlp/data/dataset.py
Class Name: LanguageModelDataset
Method Name: bptt_batchify