text stringlengths 31 243k | type stringclasses 1
value | start int64 36 275k | end int64 286 280k | depth int64 0 1 | filepath stringlengths 85 188 | parent_class stringclasses 3
values | class_index int64 0 10.8k |
|---|---|---|---|---|---|---|---|
class WarmUp(schedules.LearningRateSchedule):
"""
Applies a warmup schedule on a given learning rate decay schedule.
Args:
initial_learning_rate (`float`):
The initial learning rate for the schedule after the warmup (so this will be the learning rate at the end
of the warmup... | class_definition | 1,367 | 3,694 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/optimization_tf.py | null | 0 |
class AdamWeightDecay(Adam):
"""
Adam enables L2 weight decay and clip_by_global_norm on gradients. Just adding the square of the weights to the
loss function is *not* the correct way of using L2 regularization/weight decay with Adam, since that will interact
with the m and v parameters in strange ways ... | class_definition | 7,254 | 13,854 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/optimization_tf.py | null | 1 |
class GradientAccumulator:
"""
Gradient accumulation utility. When used with a distribution strategy, the accumulator should be called in a
replica context. Gradients will be accumulated locally on each replica and without synchronization. Users should
then call `.gradients`, scale the gradients if requ... | class_definition | 13,952 | 16,853 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/optimization_tf.py | null | 2 |
class BaseModelOutput(ModelOutput):
"""
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 mode... | class_definition | 751 | 2,186 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 3 |
class BaseModelOutputWithNoAttention(ModelOutput):
"""
Base class for model's outputs, with potential hidden states.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`):
Sequence of hidden-states at the output of the last layer of the model... | class_definition | 2,200 | 3,136 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 4 |
class BaseModelOutputWithPooling(ModelOutput):
"""
Base class for model's outputs that also contains a pooling of the last hidden states.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the output of the l... | class_definition | 3,150 | 5,207 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 5 |
class BaseModelOutputWithPoolingAndNoAttention(ModelOutput):
"""
Base class for model's outputs that also contains a pooling of the last hidden states.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`):
Sequence of hidden-states at the ou... | class_definition | 5,221 | 6,407 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 6 |
class BaseModelOutputWithPast(ModelOutput):
"""
Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding).
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the... | class_definition | 6,421 | 8,913 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 7 |
class BaseModelOutputWithCrossAttentions(ModelOutput):
"""
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 las... | class_definition | 8,927 | 10,969 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 8 |
class BaseModelOutputWithPoolingAndCrossAttentions(ModelOutput):
"""
Base class for model's outputs that also contains a pooling of the last hidden states.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at t... | class_definition | 10,983 | 14,517 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 9 |
class BaseModelOutputWithPastAndCrossAttentions(ModelOutput):
"""
Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding).
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hi... | class_definition | 14,531 | 17,629 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 10 |
class MoECausalLMOutputWithPast(ModelOutput):
"""
Base class for causal language model (or autoregressive) outputs as well as Mixture of Expert's router hidden
states terms, to train a MoE model.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
... | class_definition | 17,643 | 20,790 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 11 |
class MoEModelOutput(ModelOutput):
"""
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... | class_definition | 20,804 | 22,788 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 12 |
class MoeModelOutputWithPast(ModelOutput):
"""
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 t... | class_definition | 22,802 | 25,660 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 13 |
class MoeCausalLMOutputWithPast(ModelOutput):
"""
Base class for causal language model (or autoregressive) with mixture of experts outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss (for next-token prediction... | class_definition | 25,674 | 28,683 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 14 |
class MoEModelOutputWithPastAndCrossAttentions(ModelOutput):
"""
Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding) as well as
Mixture of Expert's router hidden states terms, to train a MoE model.
Args:
last_hidden_state (`torch.FloatTensor`... | class_definition | 28,697 | 32,428 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 15 |
class Seq2SeqModelOutput(ModelOutput):
"""
Base class for model encoder's outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of h... | class_definition | 32,442 | 36,844 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 16 |
class Seq2SeqMoEModelOutput(ModelOutput):
"""
Base class for model encoder's outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence o... | class_definition | 36,858 | 42,217 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 17 |
class CausalLMOutput(ModelOutput):
"""
Base class for causal language model (or autoregressive) outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss (for next-token prediction).
logits (`torch.FloatTens... | class_definition | 42,231 | 43,874 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 18 |
class CausalLMOutputWithPast(ModelOutput):
"""
Base class for causal language model (or autoregressive) outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss (for next-token prediction).
logits (`torch.F... | class_definition | 43,888 | 46,139 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 19 |
class CausalLMOutputWithCrossAttentions(ModelOutput):
"""
Base class for causal language model (or autoregressive) outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss (for next-token prediction).
logit... | class_definition | 46,153 | 49,030 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 20 |
class SequenceClassifierOutputWithPast(ModelOutput):
"""
Base class for outputs of sentence classification models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification (or regression if config.num_labels==1) loss.
logit... | class_definition | 49,044 | 51,270 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 21 |
class MaskedLMOutput(ModelOutput):
"""
Base class for masked language models outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Masked language modeling (MLM) loss.
logits (`torch.FloatTensor` of shape `(batch_size, sequenc... | class_definition | 51,284 | 52,893 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 22 |
class Seq2SeqLMOutput(ModelOutput):
"""
Base class for sequence-to-sequence language models outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss.
logits (`torch.FloatTensor` of shape `(batch_size, seque... | class_definition | 52,907 | 57,247 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 23 |
class Seq2SeqMoEOutput(ModelOutput):
"""
Base class for sequence-to-sequence language models outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss.
logits (`torch.FloatTensor` of shape `(batch_size, sequ... | class_definition | 57,261 | 62,743 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 24 |
class NextSentencePredictorOutput(ModelOutput):
"""
Base class for outputs of models predicting if two sentences are consecutive or not.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `next_sentence_label` is provided):
Next sequence prediction (classificatio... | class_definition | 62,757 | 64,445 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 25 |
class SequenceClassifierOutput(ModelOutput):
"""
Base class for outputs of sentence classification models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification (or regression if config.num_labels==1) loss.
logits (`torc... | class_definition | 64,459 | 66,077 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 26 |
class Seq2SeqSequenceClassifierOutput(ModelOutput):
"""
Base class for outputs of sequence-to-sequence sentence classification models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `label` is provided):
Classification (or regression if config.num_labels==1) ... | class_definition | 66,091 | 70,465 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 27 |
class MultipleChoiceModelOutput(ModelOutput):
"""
Base class for outputs of multiple choice models.
Args:
loss (`torch.FloatTensor` of shape *(1,)*, *optional*, returned when `labels` is provided):
Classification loss.
logits (`torch.FloatTensor` of shape `(batch_size, num_choic... | class_definition | 70,479 | 72,102 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 28 |
class TokenClassifierOutput(ModelOutput):
"""
Base class for outputs of token classification models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided) :
Classification loss.
logits (`torch.FloatTensor` of shape `(batch_size, sequenc... | class_definition | 72,116 | 73,666 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 29 |
class QuestionAnsweringModelOutput(ModelOutput):
"""
Base class for outputs of question answering models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Total span extraction loss is the sum of a Cross-Entropy for the start and end posi... | class_definition | 73,680 | 75,462 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 30 |
class Seq2SeqQuestionAnsweringModelOutput(ModelOutput):
"""
Base class for outputs of sequence-to-sequence question answering models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Total span extraction loss is the sum of a Cross-Entrop... | class_definition | 75,476 | 80,015 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 31 |
class SemanticSegmenterOutput(ModelOutput):
"""
Base class for outputs of semantic segmentation models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification (or regression if config.num_labels==1) loss.
logits (`torch.F... | class_definition | 80,029 | 82,025 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 32 |
class ImageClassifierOutput(ModelOutput):
"""
Base class for outputs of image classification models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification (or regression if config.num_labels==1) loss.
logits (`torch.Floa... | class_definition | 82,039 | 83,628 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 33 |
class ImageClassifierOutputWithNoAttention(ModelOutput):
"""
Base class for outputs of image classification models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification (or regression if config.num_labels==1) loss.
logi... | class_definition | 83,642 | 84,753 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 34 |
class DepthEstimatorOutput(ModelOutput):
"""
Base class for outputs of depth estimation models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification (or regression if config.num_labels==1) loss.
predicted_depth (`torch.... | class_definition | 84,767 | 86,335 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 35 |
class ImageSuperResolutionOutput(ModelOutput):
"""
Base class for outputs of image super resolution models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Reconstruction loss.
reconstruction (`torch.FloatTensor` of shape `(batch... | class_definition | 86,349 | 87,891 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 36 |
class Wav2Vec2BaseModelOutput(ModelOutput):
"""
Base class for models that have been trained with the Wav2Vec2 loss objective.
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 o... | class_definition | 87,905 | 89,549 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 37 |
class XVectorOutput(ModelOutput):
"""
Output type of [`Wav2Vec2ForXVector`].
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Classification loss.
logits (`torch.FloatTensor` of shape `(batch_size, config.xvector_output_dim)`):
... | class_definition | 89,563 | 91,250 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 38 |
class BackboneOutput(ModelOutput):
"""
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 `out... | class_definition | 91,264 | 92,704 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 39 |
class BaseModelOutputWithPoolingAndProjection(ModelOutput):
"""
Base class for model's outputs that also contains a pooling of the last hidden states.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the ou... | class_definition | 92,718 | 95,200 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 40 |
class Seq2SeqSpectrogramOutput(ModelOutput):
"""
Base class for sequence-to-sequence spectrogram outputs.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Spectrogram generation loss.
spectrogram (`torch.FloatTensor` of shape `(ba... | class_definition | 95,214 | 99,493 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 41 |
class Seq2SeqTSModelOutput(ModelOutput):
"""
Base class for time series model's encoder outputs that also contains pre-computed hidden states that can speed up
sequential decoding.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
S... | class_definition | 99,507 | 104,866 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 42 |
class Seq2SeqTSPredictionOutput(ModelOutput):
"""
Base class for time series model's decoder outputs that also contain the loss as well as the parameters of the
chosen distribution.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when a `future_values` is provided):
... | class_definition | 104,880 | 110,202 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 43 |
class SampleTSPredictionOutput(ModelOutput):
"""
Base class for time series model's predictions outputs that contains the sampled values from the chosen
distribution.
Args:
sequences (`torch.FloatTensor` of shape `(batch_size, num_samples, prediction_length)` or `(batch_size, num_samples, predi... | class_definition | 110,216 | 110,670 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 44 |
class MaskedImageModelingOutput(ModelOutput):
"""
Base class for outputs of masked image completion / in-painting models.
Args:
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `bool_masked_pos` is provided):
Reconstruction loss.
reconstruction (`torch.FloatT... | class_definition | 110,684 | 112,566 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_outputs.py | null | 45 |
class PretrainedConfig(PushToHubMixin):
# no-format
r"""
Base class for all configuration classes. Handles a few parameters common to all models' configurations as well as
methods for loading/downloading/saving configurations.
<Tip>
A configuration file can be loaded and saved to disk. Loading... | class_definition | 1,460 | 55,322 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/configuration_utils.py | null | 46 |
class FlashAttentionKwargs(TypedDict, total=False):
"""
Keyword arguments for Flash Attention with Compile.
Attributes:
cu_seq_lens_q (`torch.LongTensor`, *optional*)
Gets cumlative sequence length for query state.
cu_seq_lens_k (`torch.LongTensor`, *optional*)
Gets ... | class_definition | 16,332 | 17,045 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/modeling_flash_attention_utils.py | null | 47 |
class SizeDict:
"""
Hashable dictionary to store image size information.
"""
height: int = None
width: int = None
longest_edge: int = None
shortest_edge: int = None
max_height: int = None
max_width: int = None
def __getitem__(self, key):
if hasattr(self, key):
... | class_definition | 995 | 1,403 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/image_processing_utils_fast.py | null | 48 |
class BaseImageProcessorFast(BaseImageProcessor):
_transform_params = None
def _build_transforms(self, **kwargs) -> "Compose":
"""
Given the input settings e.g. do_resize, build the image transforms.
"""
raise NotImplementedError
def _validate_params(self, **kwargs) -> None... | class_definition | 1,406 | 2,208 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/image_processing_utils_fast.py | null | 49 |
class ChannelDimension(ExplicitEnum):
FIRST = "channels_first"
LAST = "channels_last" | class_definition | 2,968 | 3,061 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/image_utils.py | null | 50 |
class AnnotationFormat(ExplicitEnum):
COCO_DETECTION = "coco_detection"
COCO_PANOPTIC = "coco_panoptic" | class_definition | 3,064 | 3,175 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/image_utils.py | null | 51 |
class AnnotionFormat(ExplicitEnum):
COCO_DETECTION = AnnotationFormat.COCO_DETECTION.value
COCO_PANOPTIC = AnnotationFormat.COCO_PANOPTIC.value | class_definition | 3,178 | 3,329 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/image_utils.py | null | 52 |
class ImageType(ExplicitEnum):
PIL = "pillow"
TORCH = "torch"
NUMPY = "numpy"
TENSORFLOW = "tensorflow"
JAX = "jax" | class_definition | 3,485 | 3,620 | 0 | /Users/nielsrogge/Documents/python_projecten/transformers/src/transformers/image_utils.py | null | 53 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 11