Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output of the last layer of the model. hidden_state
| 23 | |
| 24 | @dataclass |
| 25 | class BaseModelOutput(ModelOutput): |
| 26 | """ |
| 27 | Base class for model's outputs, with potential hidden states and attentions. |
| 28 | |
| 29 | Args: |
| 30 | last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): |
| 31 | Sequence of hidden-states at the output of the last layer of the model. |
| 32 | hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`): |
| 33 | Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, + |
| 34 | one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`. |
| 35 | |
| 36 | Hidden-states of the model at the output of each layer plus the optional initial embedding outputs. |
| 37 | attentions (`tuple(torch.FloatTensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`): |
| 38 | Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, |
| 39 | sequence_length)`. |
| 40 | |
| 41 | Attentions weights after the attention softmax, used to compute the weighted average in the self-attention |
| 42 | heads. |
| 43 | """ |
| 44 | |
| 45 | last_hidden_state: torch.FloatTensor = None |
| 46 | hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None |
| 47 | attentions: Optional[Tuple[torch.FloatTensor, ...]] = None |
| 48 | |
| 49 | |
| 50 | @dataclass |
no outgoing calls