Base class for outputs of backbones. Args: feature_maps (`tuple(torch.FloatTensor)` of shape `(batch_size, num_channels, height, width)`): Feature maps of the stages. hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True
| 1436 | |
| 1437 | @dataclass |
| 1438 | class BackboneOutput(ModelOutput): |
| 1439 | """ |
| 1440 | Base class for outputs of backbones. |
| 1441 | |
| 1442 | Args: |
| 1443 | feature_maps (`tuple(torch.FloatTensor)` of shape `(batch_size, num_channels, height, width)`): |
| 1444 | Feature maps of the stages. |
| 1445 | hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`): |
| 1446 | Tuple of `torch.FloatTensor` (one for the output of the embeddings + one for the output of each layer) of |
| 1447 | shape `(batch_size, sequence_length, hidden_size)` or `(batch_size, num_channels, height, width)`, |
| 1448 | depending on the backbone. |
| 1449 | |
| 1450 | Hidden-states of the model at the output of each stage plus the initial embedding outputs. |
| 1451 | attentions (`tuple(torch.FloatTensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`): |
| 1452 | Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, |
| 1453 | sequence_length)`. Only applicable if the backbone uses attention. |
| 1454 | |
| 1455 | Attentions weights after the attention softmax, used to compute the weighted average in the self-attention |
| 1456 | heads. |
| 1457 | """ |
| 1458 | |
| 1459 | feature_maps: Tuple[torch.FloatTensor] = None |
| 1460 | hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None |
| 1461 | attentions: Optional[Tuple[torch.FloatTensor, ...]] = None |
| 1462 | |
| 1463 | |
| 1464 | @dataclass |
no outgoing calls
no test coverage detected