Buckets:
| import{s as ie,n as de,o as me}from"../chunks/scheduler.53228c21.js";import{S as le,i as fe,e as i,s as n,c,h as pe,a as d,d as t,b as s,f as D,g as u,j as J,k as E,l as f,m as r,n as _,t as h,o as g,p as T}from"../chunks/index.cac5d66a.js";import{C as ce}from"../chunks/CopyLLMTxtMenu.0ef49226.js";import{D as ee}from"../chunks/Docstring.9de32ff4.js";import{H as oe,E as ue}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.48d5cb47.js";function _e(te){let m,q,P,H,b,I,$,S,v,re="A Transformer model for video-like data.",B,M,U,a,x,K,O,ne="A Transformer model for video-like data.",Q,p,w,X,C,se="The <code>TransformerTemporal</code> forward method.",V,y,j,l,N,Y,z,ae='The output of <a href="/docs/diffusers/pr_13921/en/api/models/transformer_temporal#diffusers.TransformerTemporalModel">TransformerTemporalModel</a>.',F,L,G,A,R;return b=new ce({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new oe({props:{title:"TransformerTemporalModel",local:"transformertemporalmodel",headingTag:"h1"}}),M=new oe({props:{title:"TransformerTemporalModel",local:"diffusers.TransformerTemporalModel",headingTag:"h2"}}),x=new ee({props:{name:"class diffusers.TransformerTemporalModel",anchor:"diffusers.TransformerTemporalModel",parameters:[{name:"num_attention_heads",val:": int = 16"},{name:"attention_head_dim",val:": int = 88"},{name:"in_channels",val:": int | None = None"},{name:"out_channels",val:": int | None = None"},{name:"num_layers",val:": int = 1"},{name:"dropout",val:": float = 0.0"},{name:"norm_num_groups",val:": int = 32"},{name:"cross_attention_dim",val:": int | None = None"},{name:"attention_bias",val:": bool = False"},{name:"sample_size",val:": int | None = None"},{name:"activation_fn",val:": str = 'geglu'"},{name:"norm_elementwise_affine",val:": bool = True"},{name:"double_self_attention",val:": bool = True"},{name:"positional_embeddings",val:": str | None = None"},{name:"num_positional_embeddings",val:": int | None = None"}],parametersDescription:[{anchor:"diffusers.TransformerTemporalModel.num_attention_heads",description:"<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — The number of heads to use for multi-head attention.",name:"num_attention_heads"},{anchor:"diffusers.TransformerTemporalModel.attention_head_dim",description:"<strong>attention_head_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 88) — The number of channels in each head.",name:"attention_head_dim"},{anchor:"diffusers.TransformerTemporalModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>) — | |
| The number of channels in the input and output (specify if the input is <strong>continuous</strong>).`,name:"in_channels"},{anchor:"diffusers.TransformerTemporalModel.num_layers",description:"<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — The number of layers of Transformer blocks to use.",name:"num_layers"},{anchor:"diffusers.TransformerTemporalModel.dropout",description:"<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — The dropout probability to use.",name:"dropout"},{anchor:"diffusers.TransformerTemporalModel.cross_attention_dim",description:"<strong>cross_attention_dim</strong> (<code>int</code>, <em>optional</em>) — The number of <code>encoder_hidden_states</code> dimensions to use.",name:"cross_attention_dim"},{anchor:"diffusers.TransformerTemporalModel.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, <em>optional</em>) — | |
| Configure if the <code>TransformerBlock</code> attention should contain a bias parameter.`,name:"attention_bias"},{anchor:"diffusers.TransformerTemporalModel.sample_size",description:`<strong>sample_size</strong> (<code>int</code>, <em>optional</em>) — The width of the latent images (specify if the input is <strong>discrete</strong>). | |
| This is fixed during training since it is used to learn a number of position embeddings.`,name:"sample_size"},{anchor:"diffusers.TransformerTemporalModel.activation_fn",description:`<strong>activation_fn</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"geglu"</code>) — | |
| Activation function to use in feed-forward. See <code>diffusers.models.activations.get_activation</code> for supported | |
| activation functions.`,name:"activation_fn"},{anchor:"diffusers.TransformerTemporalModel.norm_elementwise_affine",description:`<strong>norm_elementwise_affine</strong> (<code>bool</code>, <em>optional</em>) — | |
| Configure if the <code>TransformerBlock</code> should use learnable elementwise affine parameters for normalization.`,name:"norm_elementwise_affine"},{anchor:"diffusers.TransformerTemporalModel.double_self_attention",description:`<strong>double_self_attention</strong> (<code>bool</code>, <em>optional</em>) — | |
| Configure if each <code>TransformerBlock</code> should contain two self-attention layers.`,name:"double_self_attention"},{anchor:"diffusers.TransformerTemporalModel.positional_embeddings",description:`<strong>positional_embeddings</strong> — (<code>str</code>, <em>optional</em>): | |
| The type of positional embeddings to apply to the sequence input before passing use.`,name:"positional_embeddings"},{anchor:"diffusers.TransformerTemporalModel.num_positional_embeddings",description:`<strong>num_positional_embeddings</strong> — (<code>int</code>, <em>optional</em>): | |
| The maximum length of the sequence over which to apply positional embeddings.`,name:"num_positional_embeddings"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_temporal.py#L41"}}),w=new ee({props:{name:"forward",anchor:"diffusers.TransformerTemporalModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"encoder_hidden_states",val:": torch.LongTensor | None = None"},{name:"timestep",val:": torch.LongTensor | None = None"},{name:"class_labels",val:": LongTensor = None"},{name:"num_frames",val:": int = 1"},{name:"cross_attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.TransformerTemporalModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.LongTensor</code> of shape <code>(batch size, num latent pixels)</code> if discrete, <code>torch.Tensor</code> of shape <code>(batch size, channel, height, width)</code> if continuous) — | |
| Input hidden_states.`,name:"hidden_states"},{anchor:"diffusers.TransformerTemporalModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> ( <code>torch.LongTensor</code> of shape <code>(batch size, encoder_hidden_states dim)</code>, <em>optional</em>) — | |
| Conditional embeddings for cross attention layer. If not given, cross-attention defaults to | |
| self-attention.`,name:"encoder_hidden_states"},{anchor:"diffusers.TransformerTemporalModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.LongTensor</code>, <em>optional</em>) — | |
| Used to indicate denoising step. Optional timestep to be applied as an embedding in <code>AdaLayerNorm</code>.`,name:"timestep"},{anchor:"diffusers.TransformerTemporalModel.forward.class_labels",description:`<strong>class_labels</strong> ( <code>torch.LongTensor</code> of shape <code>(batch size, num classes)</code>, <em>optional</em>) — | |
| Used to indicate class labels conditioning. Optional class labels to be applied as an embedding in | |
| <code>AdaLayerZeroNorm</code>.`,name:"class_labels"},{anchor:"diffusers.TransformerTemporalModel.forward.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of frames to be processed per batch. This is used to reshape the hidden states.`,name:"num_frames"},{anchor:"diffusers.TransformerTemporalModel.forward.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under | |
| <code>self.processor</code> in | |
| <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.TransformerTemporalModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/pr_13921/en/api/models/transformer_temporal#diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput">TransformerTemporalModelOutput</a> | |
| instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_temporal.py#L123",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is True, an | |
| <a | |
| href="/docs/diffusers/pr_13921/en/api/models/transformer_temporal#diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput" | |
| >TransformerTemporalModelOutput</a> is returned, otherwise a | |
| <code>tuple</code> where the first element is the sample tensor.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/diffusers/pr_13921/en/api/models/transformer_temporal#diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput" | |
| >TransformerTemporalModelOutput</a> or <code>tuple</code></p> | |
| `}}),y=new oe({props:{title:"TransformerTemporalModelOutput",local:"diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput",headingTag:"h2"}}),N=new ee({props:{name:"class diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput",anchor:"diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput",parameters:[{name:"sample",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size x num_frames, num_channels, height, width)</code>) — | |
| The hidden states output conditioned on <code>encoder_hidden_states</code> input.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_temporal.py#L29"}}),L=new ue({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/transformer_temporal.md"}}),{c(){m=i("meta"),q=n(),P=i("p"),H=n(),c(b.$$.fragment),I=n(),c($.$$.fragment),S=n(),v=i("p"),v.textContent=re,B=n(),c(M.$$.fragment),U=n(),a=i("div"),c(x.$$.fragment),K=n(),O=i("p"),O.textContent=ne,Q=n(),p=i("div"),c(w.$$.fragment),X=n(),C=i("p"),C.innerHTML=se,V=n(),c(y.$$.fragment),j=n(),l=i("div"),c(N.$$.fragment),Y=n(),z=i("p"),z.innerHTML=ae,F=n(),c(L.$$.fragment),G=n(),A=i("p"),this.h()},l(e){const o=pe("svelte-u9bgzb",document.head);m=d(o,"META",{name:!0,content:!0}),o.forEach(t),q=s(e),P=d(e,"P",{}),D(P).forEach(t),H=s(e),u(b.$$.fragment,e),I=s(e),u($.$$.fragment,e),S=s(e),v=d(e,"P",{"data-svelte-h":!0}),J(v)!=="svelte-1ywwpi7"&&(v.textContent=re),B=s(e),u(M.$$.fragment,e),U=s(e),a=d(e,"DIV",{class:!0});var k=D(a);u(x.$$.fragment,k),K=s(k),O=d(k,"P",{"data-svelte-h":!0}),J(O)!=="svelte-1ywwpi7"&&(O.textContent=ne),Q=s(k),p=d(k,"DIV",{class:!0});var W=D(p);u(w.$$.fragment,W),X=s(W),C=d(W,"P",{"data-svelte-h":!0}),J(C)!=="svelte-14zjqkb"&&(C.innerHTML=se),W.forEach(t),k.forEach(t),V=s(e),u(y.$$.fragment,e),j=s(e),l=d(e,"DIV",{class:!0});var Z=D(l);u(N.$$.fragment,Z),Y=s(Z),z=d(Z,"P",{"data-svelte-h":!0}),J(z)!=="svelte-143zybd"&&(z.innerHTML=ae),Z.forEach(t),F=s(e),u(L.$$.fragment,e),G=s(e),A=d(e,"P",{}),D(A).forEach(t),this.h()},h(){E(m,"name","hf:doc:metadata"),E(m,"content",he),E(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),E(a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),E(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){f(document.head,m),r(e,q,o),r(e,P,o),r(e,H,o),_(b,e,o),r(e,I,o),_($,e,o),r(e,S,o),r(e,v,o),r(e,B,o),_(M,e,o),r(e,U,o),r(e,a,o),_(x,a,null),f(a,K),f(a,O),f(a,Q),f(a,p),_(w,p,null),f(p,X),f(p,C),r(e,V,o),_(y,e,o),r(e,j,o),r(e,l,o),_(N,l,null),f(l,Y),f(l,z),r(e,F,o),_(L,e,o),r(e,G,o),r(e,A,o),R=!0},p:de,i(e){R||(h(b.$$.fragment,e),h($.$$.fragment,e),h(M.$$.fragment,e),h(x.$$.fragment,e),h(w.$$.fragment,e),h(y.$$.fragment,e),h(N.$$.fragment,e),h(L.$$.fragment,e),R=!0)},o(e){g(b.$$.fragment,e),g($.$$.fragment,e),g(M.$$.fragment,e),g(x.$$.fragment,e),g(w.$$.fragment,e),g(y.$$.fragment,e),g(N.$$.fragment,e),g(L.$$.fragment,e),R=!1},d(e){e&&(t(q),t(P),t(H),t(I),t(S),t(v),t(B),t(U),t(a),t(V),t(j),t(l),t(F),t(G),t(A)),t(m),T(b,e),T($,e),T(M,e),T(x),T(w),T(y,e),T(N),T(L,e)}}}const he='{"title":"TransformerTemporalModel","local":"transformertemporalmodel","sections":[{"title":"TransformerTemporalModel","local":"diffusers.TransformerTemporalModel","sections":[],"depth":2},{"title":"TransformerTemporalModelOutput","local":"diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput","sections":[],"depth":2}],"depth":1}';function ge(te){return me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xe extends le{constructor(m){super(),fe(this,m,ge,_e,ie,{})}}export{xe as component}; | |
Xet Storage Details
- Size:
- 13.8 kB
- Xet hash:
- df996639c9a836f403a89737ca4809f4fb67f4e9fc970747a85b0f2cfbc88f47
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.