Skip to content

Commit

Permalink
[TF Longformer] Improve Speed for TF Longformer (#6447)
Browse files Browse the repository at this point in the history
* add tf graph compile tests

* fix conflict

* remove more tf transpose statements

* fix conflicts

* fix comment typos

* move function to class function

* fix black

* fix black

* make style
  • Loading branch information
patrickvonplaten authored Aug 26, 2020
1 parent a75c64d commit 858b7d5
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 134 deletions.
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ def __init__(self, config, *inputs, **kwargs):
config.num_labels, kernel_initializer=get_initializer(config.initializer_range), name="classifier"
)

@add_start_docstrings_to_callable(BERT_INPUTS_DOCSTRING)
@add_start_docstrings_to_callable(BERT_INPUTS_DOCSTRING.format("(batch_size, sequence_length)"))
@add_code_sample_docstrings(
tokenizer_class=_TOKENIZER_FOR_DOC,
checkpoint="bert-base-cased",
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def __init__(self, config, *inputs, **kwargs):
self.electra = TFElectraMainLayer(config, name="electra")
self.classifier = TFElectraClassificationHead(config, name="classifier")

@add_start_docstrings_to_callable(ELECTRA_INPUTS_DOCSTRING.format("(batch_size, num_choices, sequence_length)"))
@add_start_docstrings_to_callable(ELECTRA_INPUTS_DOCSTRING.format("(batch_size, sequence_length)"))
@add_code_sample_docstrings(
tokenizer_class=_TOKENIZER_FOR_DOC,
checkpoint="google/electra-small-discriminator",
Expand Down
Loading

0 comments on commit 858b7d5

Please sign in to comment.