Buckets:
TransformerTemporalModel
A Transformer model for video-like data.
TransformerTemporalModel[[diffusers.TransformerTemporalModel]]
class diffusers.TransformerTemporalModeldiffusers.TransformerTemporalModelint, optional, defaults to 16) -- The number of heads to use for multi-head attention.
- attention_head_dim (
int, optional, defaults to 88) -- The number of channels in each head. - in_channels (
int, optional) -- The number of channels in the input and output (specify if the input is continuous). - num_layers (
int, optional, defaults to 1) -- The number of layers of Transformer blocks to use. - dropout (
float, optional, defaults to 0.0) -- The dropout probability to use. - cross_attention_dim (
int, optional) -- The number ofencoder_hidden_statesdimensions to use. - attention_bias (
bool, optional) -- Configure if theTransformerBlockattention should contain a bias parameter. - sample_size (
int, optional) -- The width of the latent images (specify if the input is discrete). This is fixed during training since it is used to learn a number of position embeddings. - activation_fn (
str, optional, defaults to"geglu") -- Activation function to use in feed-forward. Seediffusers.models.activations.get_activationfor supported activation functions. - norm_elementwise_affine (
bool, optional) -- Configure if theTransformerBlockshould use learnable elementwise affine parameters for normalization. - double_self_attention (
bool, optional) -- Configure if eachTransformerBlockshould contain two self-attention layers. - positional_embeddings -- (
str, optional): The type of positional embeddings to apply to the sequence input before passing use. - num_positional_embeddings -- (
int, optional): The maximum length of the sequence over which to apply positional embeddings.0
A Transformer model for video-like data.
forwarddiffusers.TransformerTemporalModel.forwardtorch.LongTensor of shape (batch size, num latent pixels) if discrete, torch.Tensor of shape (batch size, channel, height, width) if continuous) --
Input hidden_states.
- encoder_hidden_states (
torch.LongTensorof shape(batch size, encoder_hidden_states dim), optional) -- Conditional embeddings for cross attention layer. If not given, cross-attention defaults to self-attention. - timestep (
torch.LongTensor, optional) -- Used to indicate denoising step. Optional timestep to be applied as an embedding inAdaLayerNorm. - class_labels (
torch.LongTensorof shape(batch size, num classes), optional) -- Used to indicate class labels conditioning. Optional class labels to be applied as an embedding inAdaLayerZeroNorm. - num_frames (
int, optional, defaults to 1) -- The number of frames to be processed per batch. This is used to reshape the hidden states. - cross_attention_kwargs (
dict, optional) -- A kwargs dictionary that if specified is passed along to theAttentionProcessoras defined underself.processorin diffusers.models.attention_processor. - return_dict (
bool, optional, defaults toTrue) -- Whether or not to return a TransformerTemporalModelOutput instead of a plain tuple.0TransformerTemporalModelOutput ortupleIfreturn_dictis True, an TransformerTemporalModelOutput is returned, otherwise atuplewhere the first element is the sample tensor.
The TransformerTemporal forward method.
TransformerTemporalModelOutput[[diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput]]
class diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutputdiffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutputtorch.Tensor of shape (batch_size x num_frames, num_channels, height, width)) --
The hidden states output conditioned on encoder_hidden_states input.0
The output of TransformerTemporalModel.
Xet Storage Details
- Size:
- 7.41 kB
- Xet hash:
- c05b3d4c9f40bbec72838300a1cb44ffc8fef328a6a597338571768dcfa792f6
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.