import{s as ne,n as re,o as ae}from"../chunks/scheduler.182ea377.js";import{S as se,i as de,g as d,s as r,r as w,A as ie,h as i,f as o,c as a,j as P,u as y,x as R,k,y as f,a as n,v as O,d as C,t as L,w as N}from"../chunks/index.abf12888.js";import{D as K}from"../chunks/Docstring.93f6f462.js";import{H as Q}from"../chunks/Heading.16916d63.js";function me(X){let m,A,z,E,p,H,u,Y="A Transformer model for video-like data.",I,h,U,s,_,W,v,ee="A Transformer model for video-like data.",Z,c,T,G,$,oe="The <code>TransformerTemporal</code> forward method.",q,g,F,l,b,J,M,te="The output of <code>TransformerTemporalModel</code>.",S,D,V;return p=new Q({props:{title:"Transformer Temporal",local:"transformer-temporal",headingTag:"h1"}}),h=new Q({props:{title:"TransformerTemporalModel",local:"diffusers.models.TransformerTemporalModel",headingTag:"h2"}}),_=new K({props:{name:"class diffusers.models.TransformerTemporalModel",anchor:"diffusers.models.TransformerTemporalModel",parameters:[{name:"num_attention_heads",val:": int = 16"},{name:"attention_head_dim",val:": int = 88"},{name:"in_channels",val:": typing.Optional[int] = None"},{name:"out_channels",val:": typing.Optional[int] = 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:": typing.Optional[int] = None"},{name:"attention_bias",val:": bool = False"},{name:"sample_size",val:": typing.Optional[int] = None"},{name:"activation_fn",val:": str = 'geglu'"},{name:"norm_elementwise_affine",val:": bool = True"},{name:"double_self_attention",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.models.TransformerTemporalModel.num_attention_heads",description:"<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014; The number of heads to use for multi-head attention.",name:"num_attention_heads"},{anchor:"diffusers.models.TransformerTemporalModel.attention_head_dim",description:"<strong>attention_head_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 88) &#x2014; The number of channels in each head.",name:"attention_head_dim"},{anchor:"diffusers.models.TransformerTemporalModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of channels in the input and output (specify if the input is <strong>continuous</strong>).`,name:"in_channels"},{anchor:"diffusers.models.TransformerTemporalModel.num_layers",description:"<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014; The number of layers of Transformer blocks to use.",name:"num_layers"},{anchor:"diffusers.models.TransformerTemporalModel.dropout",description:"<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014; The dropout probability to use.",name:"dropout"},{anchor:"diffusers.models.TransformerTemporalModel.cross_attention_dim",description:"<strong>cross_attention_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014; The number of <code>encoder_hidden_states</code> dimensions to use.",name:"cross_attention_dim"},{anchor:"diffusers.models.TransformerTemporalModel.sample_size",description:`<strong>sample_size</strong> (<code>int</code>, <em>optional</em>) &#x2014; 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.models.TransformerTemporalModel.activation_fn",description:"<strong>activation_fn</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;geglu&quot;</code>) &#x2014; Activation function to use in feed-forward.",name:"activation_fn"},{anchor:"diffusers.models.TransformerTemporalModel.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Configure if the <code>TransformerBlock</code> attention should contain a bias parameter.`,name:"attention_bias"},{anchor:"diffusers.models.TransformerTemporalModel.double_self_attention",description:`<strong>double_self_attention</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Configure if each <code>TransformerBlock</code> should contain two self-attention layers.`,name:"double_self_attention"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformer_temporal.py#L39"}}),T=new K({props:{name:"forward",anchor:"diffusers.models.TransformerTemporalModel.forward",parameters:[{name:"hidden_states",val:""},{name:"encoder_hidden_states",val:" = None"},{name:"timestep",val:" = None"},{name:"class_labels",val:" = None"},{name:"num_frames",val:" = 1"},{name:"cross_attention_kwargs",val:" = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.models.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.FloatTensor</code> of shape <code>(batch size, channel, height, width)</code> if continuous) &#x2014;
Input hidden_states.`,name:"hidden_states"},{anchor:"diffusers.models.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>) &#x2014;
Conditional embeddings for cross attention layer. If not given, cross-attention defaults to
self-attention.`,name:"encoder_hidden_states"},{anchor:"diffusers.models.TransformerTemporalModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.long</code>, <em>optional</em>) &#x2014;
Used to indicate denoising step. Optional timestep to be applied as an embedding in <code>AdaLayerNorm</code>.`,name:"timestep"},{anchor:"diffusers.models.TransformerTemporalModel.forward.class_labels",description:`<strong>class_labels</strong> ( <code>torch.LongTensor</code> of shape <code>(batch size, num classes)</code>, <em>optional</em>) &#x2014;
Used to indicate class labels conditioning. Optional class labels to be applied as an embedding in
<code>AdaLayerZeroNorm</code>.`,name:"class_labels"},{anchor:"diffusers.models.TransformerTemporalModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.models.unet_2d_condition.UNet2DConditionOutput">UNet2DConditionOutput</a> instead of a plain
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformer_temporal.py#L107",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is True, an <a
  href="/docs/diffusers/main/en/api/models/transformer_temporal#diffusers.models.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/main/en/api/models/transformer_temporal#diffusers.models.transformer_temporal.TransformerTemporalModelOutput"
>TransformerTemporalModelOutput</a> or <code>tuple</code></p>
`}}),g=new Q({props:{title:"TransformerTemporalModelOutput",local:"diffusers.models.transformer_temporal.TransformerTemporalModelOutput",headingTag:"h2"}}),b=new K({props:{name:"class diffusers.models.transformer_temporal.TransformerTemporalModelOutput",anchor:"diffusers.models.transformer_temporal.TransformerTemporalModelOutput",parameters:[{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.models.transformer_temporal.TransformerTemporalModelOutput.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size x num_frames, num_channels, height, width)</code>) &#x2014;
The hidden states output conditioned on <code>encoder_hidden_states</code> input.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformer_temporal.py#L27"}}),{c(){m=d("meta"),A=r(),z=d("p"),E=r(),w(p.$$.fragment),H=r(),u=d("p"),u.textContent=Y,I=r(),w(h.$$.fragment),U=r(),s=d("div"),w(_.$$.fragment),W=r(),v=d("p"),v.textContent=ee,Z=r(),c=d("div"),w(T.$$.fragment),G=r(),$=d("p"),$.innerHTML=oe,q=r(),w(g.$$.fragment),F=r(),l=d("div"),w(b.$$.fragment),J=r(),M=d("p"),M.innerHTML=te,S=r(),D=d("p"),this.h()},l(e){const t=ie("svelte-u9bgzb",document.head);m=i(t,"META",{name:!0,content:!0}),t.forEach(o),A=a(e),z=i(e,"P",{}),P(z).forEach(o),E=a(e),y(p.$$.fragment,e),H=a(e),u=i(e,"P",{"data-svelte-h":!0}),R(u)!=="svelte-1ywwpi7"&&(u.textContent=Y),I=a(e),y(h.$$.fragment,e),U=a(e),s=i(e,"DIV",{class:!0});var x=P(s);y(_.$$.fragment,x),W=a(x),v=i(x,"P",{"data-svelte-h":!0}),R(v)!=="svelte-1ywwpi7"&&(v.textContent=ee),Z=a(x),c=i(x,"DIV",{class:!0});var j=P(c);y(T.$$.fragment,j),G=a(j),$=i(j,"P",{"data-svelte-h":!0}),R($)!=="svelte-14zjqkb"&&($.innerHTML=oe),j.forEach(o),x.forEach(o),q=a(e),y(g.$$.fragment,e),F=a(e),l=i(e,"DIV",{class:!0});var B=P(l);y(b.$$.fragment,B),J=a(B),M=i(B,"P",{"data-svelte-h":!0}),R(M)!=="svelte-1wdi1wk"&&(M.innerHTML=te),B.forEach(o),S=a(e),D=i(e,"P",{}),P(D).forEach(o),this.h()},h(){k(m,"name","hf:doc:metadata"),k(m,"content",le),k(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(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,t){f(document.head,m),n(e,A,t),n(e,z,t),n(e,E,t),O(p,e,t),n(e,H,t),n(e,u,t),n(e,I,t),O(h,e,t),n(e,U,t),n(e,s,t),O(_,s,null),f(s,W),f(s,v),f(s,Z),f(s,c),O(T,c,null),f(c,G),f(c,$),n(e,q,t),O(g,e,t),n(e,F,t),n(e,l,t),O(b,l,null),f(l,J),f(l,M),n(e,S,t),n(e,D,t),V=!0},p:re,i(e){V||(C(p.$$.fragment,e),C(h.$$.fragment,e),C(_.$$.fragment,e),C(T.$$.fragment,e),C(g.$$.fragment,e),C(b.$$.fragment,e),V=!0)},o(e){L(p.$$.fragment,e),L(h.$$.fragment,e),L(_.$$.fragment,e),L(T.$$.fragment,e),L(g.$$.fragment,e),L(b.$$.fragment,e),V=!1},d(e){e&&(o(A),o(z),o(E),o(H),o(u),o(I),o(U),o(s),o(q),o(F),o(l),o(S),o(D)),o(m),N(p,e),N(h,e),N(_),N(T),N(g,e),N(b)}}}const le='{"title":"Transformer Temporal","local":"transformer-temporal","sections":[{"title":"TransformerTemporalModel","local":"diffusers.models.TransformerTemporalModel","sections":[],"depth":2},{"title":"TransformerTemporalModelOutput","local":"diffusers.models.transformer_temporal.TransformerTemporalModelOutput","sections":[],"depth":2}],"depth":1}';function fe(X){return ae(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _e extends se{constructor(m){super(),de(this,m,fe,me,ne,{})}}export{_e as component};
