2409ca833031ab770e68a334cf2686d1d8d930d1,jiant/proj/main/modeling/taskmodels.py,,get_output_from_encoder,#Any#Any#Any#Any#,288
Before Change
output = encoder(input_ids=input_ids, token_type_ids=segment_ids, attention_mask=input_mask)
if len(output) == 2:
return EncoderOutput(pooled=output[1], unpooled=output[0],)
elif len(output) > 2:
// Extend later with attention, hidden_acts, etc
return EncoderOutput(pooled=output[1], unpooled=output[0], other=output[2:])
else:
raise RuntimeError()
def compute_mlm_loss(logits, masked_lm_labels):
vocab_size = logits.shape[-1]
After Change
pooled, unpooled, other = get_output_from_electra(
encoder=encoder, input_ids=input_ids, segment_ids=segment_ids, input_mask=input_mask,
)
elif model_arch in [
ModelArchitectures.BART,
ModelArchitectures.MBART,
]:
pooled, unpooled, other = get_output_from_bart_models(
encoder=encoder, input_ids=input_ids, input_mask=input_mask,
)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: jsalt18-sentence-repl/jiant
Commit Name: 2409ca833031ab770e68a334cf2686d1d8d930d1
Time: 2020-09-23
Author: email@jasonphang.com
File Name: jiant/proj/main/modeling/taskmodels.py
Class Name:
Method Name: get_output_from_encoder
Project Name: vatlab/SoS
Commit Name: 6a27394cb496e8216164f17e2bd80bdeea1d748c
Time: 2017-10-31
Author: ben.bog@gmail.com
File Name: src/sos/actions.py
Class Name: SoS_ExecuteScript
Method Name: run
Project Name: pytorch/pytorch
Commit Name: d6452a1a0cbc308939f8c597c68a1f5f212dc8b8
Time: 2021-02-04
Author: iliacher@fb.com
File Name: torch/profiler/profiler.py
Class Name: profile
Method Name: __init__
Project Name: pfnet/optuna
Commit Name: e7f3a2e1df2c68a639d49baf908d20ce15ff83bd
Time: 2019-03-13
Author: phjgt308@gmail.com
File Name: optuna/storages/rdb/storage.py
Class Name: RDBStorage
Method Name: _check_table_schema_compatibility