(self, input_ids, attention_mask=None, **model_kwargs)
| 992 | return outputs # (ltr_lm_loss), prediction_scores, (hidden_states), (attentions) |
| 993 | |
| 994 | def prepare_inputs_for_generation(self, input_ids, attention_mask=None, **model_kwargs): |
| 995 | input_shape = input_ids.shape |
| 996 | |
| 997 | # if model is used as a decoder in encoder-decoder model, the decoder attention mask is created on the fly |
| 998 | if attention_mask is None: |
| 999 | attention_mask = input_ids.new_ones(input_shape) |
| 1000 | |
| 1001 | return {"input_ids": input_ids, "attention_mask": attention_mask} |
| 1002 | |
| 1003 | |
| 1004 | @add_start_docstrings("""Bert Model with a `language modeling` head on top. """, BERT_START_DOCSTRING) |
nothing calls this directly
no outgoing calls
no test coverage detected