import{S as He,i as Ve,s as Ge,e as t,k as m,w as L,t as p,M as Je,c as a,d as o,m as d,a as n,x as S,h as c,b as s,G as r,g as i,y as z,L as Re,q as C,o as I,B as q,v as We}from"../../../chunks/vendor-hf-doc-builder.js";import{D as Ee}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as Oe}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Ze(ke){let u,Z,h,v,U,M,me,F,de,j,D,ie,K,_,b,B,y,fe,H,pe,Q,f,x,ce,V,ue,he,$,E,_e,O,Te,G,ge,ve,X,T,w,J,k,be,R,$e,Y,g,N,we,A,Me,W,ye,xe,ee;return M=new Oe({}),y=new Oe({}),x=new Ee({props:{name:"class diffusers.models.transformer_temporal.TransformerTemporalModel",anchor:"diffusers.models.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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/v0.18.2/src/diffusers/models/transformer_temporal.py#L39"}}),E=new Ee({props:{name:"forward",anchor:"diffusers.models.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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.transformer_temporal.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/v0.18.2/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/v0.18.2/src/diffusers/models/transformer_temporal.py#L107",returnDescription:`
<p>If <code>return_dict</code> is True, an <a
  href="/docs/diffusers/v0.18.2/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:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/models/transformer_temporal#diffusers.models.transformer_temporal.TransformerTemporalModelOutput"
>TransformerTemporalModelOutput</a> or <code>tuple</code></p>
`}}),k=new Oe({}),N=new Ee({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/v0.18.2/src/diffusers/models/transformer_temporal.py#L27"}}),{c(){u=t("meta"),Z=m(),h=t("h1"),v=t("a"),U=t("span"),L(M.$$.fragment),me=m(),F=t("span"),de=p("Transformer Temporal"),j=m(),D=t("p"),ie=p("A Transformer model for video-like data."),K=m(),_=t("h2"),b=t("a"),B=t("span"),L(y.$$.fragment),fe=m(),H=t("span"),pe=p("TransformerTemporalModel"),Q=m(),f=t("div"),L(x.$$.fragment),ce=m(),V=t("p"),ue=p("A Transformer model for video-like data."),he=m(),$=t("div"),L(E.$$.fragment),_e=m(),O=t("p"),Te=p("The "),G=t("code"),ge=p("TransformerTemporal"),ve=p(" forward method."),X=m(),T=t("h2"),w=t("a"),J=t("span"),L(k.$$.fragment),be=m(),R=t("span"),$e=p("TransformerTemporalModelOutput"),Y=m(),g=t("div"),L(N.$$.fragment),we=m(),A=t("p"),Me=p("The output of "),W=t("code"),ye=p("TransformerTemporalModel"),xe=p("."),this.h()},l(e){const l=Je('[data-svelte="svelte-1phssyn"]',document.head);u=a(l,"META",{name:!0,content:!0}),l.forEach(o),Z=d(e),h=a(e,"H1",{class:!0});var oe=n(h);v=a(oe,"A",{id:!0,class:!0,href:!0});var Ne=n(v);U=a(Ne,"SPAN",{});var Ae=n(U);S(M.$$.fragment,Ae),Ae.forEach(o),Ne.forEach(o),me=d(oe),F=a(oe,"SPAN",{});var De=n(F);de=c(De,"Transformer Temporal"),De.forEach(o),oe.forEach(o),j=d(e),D=a(e,"P",{});var Pe=n(D);ie=c(Pe,"A Transformer model for video-like data."),Pe.forEach(o),K=d(e),_=a(e,"H2",{class:!0});var re=n(_);b=a(re,"A",{id:!0,class:!0,href:!0});var Le=n(b);B=a(Le,"SPAN",{});var Se=n(B);S(y.$$.fragment,Se),Se.forEach(o),Le.forEach(o),fe=d(re),H=a(re,"SPAN",{});var ze=n(H);pe=c(ze,"TransformerTemporalModel"),ze.forEach(o),re.forEach(o),Q=d(e),f=a(e,"DIV",{class:!0});var P=n(f);S(x.$$.fragment,P),ce=d(P),V=a(P,"P",{});var Ce=n(V);ue=c(Ce,"A Transformer model for video-like data."),Ce.forEach(o),he=d(P),$=a(P,"DIV",{class:!0});var te=n($);S(E.$$.fragment,te),_e=d(te),O=a(te,"P",{});var ae=n(O);Te=c(ae,"The "),G=a(ae,"CODE",{});var Ie=n(G);ge=c(Ie,"TransformerTemporal"),Ie.forEach(o),ve=c(ae," forward method."),ae.forEach(o),te.forEach(o),P.forEach(o),X=d(e),T=a(e,"H2",{class:!0});var ne=n(T);w=a(ne,"A",{id:!0,class:!0,href:!0});var qe=n(w);J=a(qe,"SPAN",{});var Ue=n(J);S(k.$$.fragment,Ue),Ue.forEach(o),qe.forEach(o),be=d(ne),R=a(ne,"SPAN",{});var Fe=n(R);$e=c(Fe,"TransformerTemporalModelOutput"),Fe.forEach(o),ne.forEach(o),Y=d(e),g=a(e,"DIV",{class:!0});var se=n(g);S(N.$$.fragment,se),we=d(se),A=a(se,"P",{});var le=n(A);Me=c(le,"The output of "),W=a(le,"CODE",{});var Be=n(W);ye=c(Be,"TransformerTemporalModel"),Be.forEach(o),xe=c(le,"."),le.forEach(o),se.forEach(o),this.h()},h(){s(u,"name","hf:doc:metadata"),s(u,"content",JSON.stringify(je)),s(v,"id","transformer-temporal"),s(v,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(v,"href","#transformer-temporal"),s(h,"class","relative group"),s(b,"id","diffusers.models.transformer_temporal.TransformerTemporalModel"),s(b,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(b,"href","#diffusers.models.transformer_temporal.TransformerTemporalModel"),s(_,"class","relative group"),s($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(w,"id","diffusers.models.transformer_temporal.TransformerTemporalModelOutput"),s(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(w,"href","#diffusers.models.transformer_temporal.TransformerTemporalModelOutput"),s(T,"class","relative group"),s(g,"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,l){r(document.head,u),i(e,Z,l),i(e,h,l),r(h,v),r(v,U),z(M,U,null),r(h,me),r(h,F),r(F,de),i(e,j,l),i(e,D,l),r(D,ie),i(e,K,l),i(e,_,l),r(_,b),r(b,B),z(y,B,null),r(_,fe),r(_,H),r(H,pe),i(e,Q,l),i(e,f,l),z(x,f,null),r(f,ce),r(f,V),r(V,ue),r(f,he),r(f,$),z(E,$,null),r($,_e),r($,O),r(O,Te),r(O,G),r(G,ge),r(O,ve),i(e,X,l),i(e,T,l),r(T,w),r(w,J),z(k,J,null),r(T,be),r(T,R),r(R,$e),i(e,Y,l),i(e,g,l),z(N,g,null),r(g,we),r(g,A),r(A,Me),r(A,W),r(W,ye),r(A,xe),ee=!0},p:Re,i(e){ee||(C(M.$$.fragment,e),C(y.$$.fragment,e),C(x.$$.fragment,e),C(E.$$.fragment,e),C(k.$$.fragment,e),C(N.$$.fragment,e),ee=!0)},o(e){I(M.$$.fragment,e),I(y.$$.fragment,e),I(x.$$.fragment,e),I(E.$$.fragment,e),I(k.$$.fragment,e),I(N.$$.fragment,e),ee=!1},d(e){o(u),e&&o(Z),e&&o(h),q(M),e&&o(j),e&&o(D),e&&o(K),e&&o(_),q(y),e&&o(Q),e&&o(f),q(x),q(E),e&&o(X),e&&o(T),q(k),e&&o(Y),e&&o(g),q(N)}}}const je={local:"transformer-temporal",sections:[{local:"diffusers.models.transformer_temporal.TransformerTemporalModel",title:"TransformerTemporalModel"},{local:"diffusers.models.transformer_temporal.TransformerTemporalModelOutput",title:"TransformerTemporalModelOutput"}],title:"Transformer Temporal"};function Ke(ke){return We(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class eo extends He{constructor(u){super();Ve(this,u,Ke,Ze,Ge,{})}}export{eo as default,je as metadata};
