1fd1fbb4b677f10d8e2181e7176daabad7327a72,python/baseline/pytorch/tagger/model.py,TaggerModelBase,create,#Any#Any#Any#,62
Before Change
assert model.span_type is not None, "A crf mask cannot be used without providing `span_type`"
model.crf = CRF(
len(labels),
(Offsets.GO, Offsets.EOS) , batch_first=False,
vocab=model.labels, span_type=model.span_type, pad_idx=Offsets.PAD
)
else:
After Change
)
else:
if constraint is not None:
constraint = F.log_softmax(torch.zeros(constraint.shape).masked_fill(constraint, -1e4), dim=0)
model.register_buffer("constraint", constraint.unsqueeze(0))
else:
model.constraint = None
model.crit = SequenceCriterion(LossFn=nn.CrossEntropyLoss)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: dpressel/mead-baseline
Commit Name: 1fd1fbb4b677f10d8e2181e7176daabad7327a72
Time: 2018-11-19
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/tagger/model.py
Class Name: TaggerModelBase
Method Name: create
Project Name: pytorch/examples
Commit Name: 490243127c02a5ea3348fa4981ecd7e9bcf6144c
Time: 2020-03-17
Author: taufiquzzaman.peyash@northsouth.edu
File Name: word_language_model/model.py
Class Name: RNNModel
Method Name: forward
Project Name: rusty1s/pytorch_geometric
Commit Name: 4e43734dd0b7f1c026069af64151a8f52f41060d
Time: 2019-07-03
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/conv/gat_conv.py
Class Name: GATConv
Method Name: forward