import{S as St,i as qt,s as Mt,e as l,k as f,w as B,t as a,M as Tt,c as i,d as s,m as c,a as n,x as D,h as o,b as h,G as t,g as u,y as x,q as C,o as N,B as A,v as Ht}from"../../chunks/vendor-hf-doc-builder.js";import{T as Lt}from"../../chunks/Tip-hf-doc-builder.js";import{D as It}from"../../chunks/Docstring-hf-doc-builder.js";import{C as je}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as jt}from"../../chunks/IconCopyLink-hf-doc-builder.js";function Yt(he){let p,I,d,_,y,m,L,E;return{c(){p=l("p"),I=a("You can\u2019t unpack a "),d=l("code"),_=a("BaseOutput"),y=a(" directly. Use the "),m=l("a"),L=a("to_tuple()"),E=a(` method to convert it to a tuple
before.`),this.h()},l(O){p=i(O,"P",{});var $=n(p);I=o($,"You can\u2019t unpack a "),d=i($,"CODE",{});var b=n(d);_=o(b,"BaseOutput"),b.forEach(s),y=o($," directly. Use the "),m=i($,"A",{href:!0});var K=n(m);L=o(K,"to_tuple()"),K.forEach(s),E=o($,` method to convert it to a tuple
before.`),$.forEach(s),this.h()},h(){h(m,"href","/docs/diffusers/main/en/api/outputs#diffusers.utils.BaseOutput.to_tuple")},m(O,$){u(O,p,$),t(p,I),t(p,d),t(d,_),t(p,y),t(p,m),t(m,L),t(p,E)},d(O){O&&s(p)}}}function Ut(he){let p,I,d,_,y,m,L,E,O,$,b,K,Q,Se,qe,me,X,Me,$e,Y,ve,g,Te,oe,He,Le,Z,Ye,Ue,_e,j,Ve,re,We,Ge,be,U,ge,ee,Je,we,V,ye,w,Re,le,ze,Fe,ie,Ke,Qe,Ee,W,Oe,S,Xe,ne,Ze,et,ke,k,q,ue,G,tt,pe,st,Pe,v,J,at,P,ot,fe,rt,lt,ce,it,nt,ut,M,pt,T,R,ft,z,ct,de,dt,ht,Be;return m=new jt({}),Y=new je({props:{code:`from diffusers import DDIMPipeline

pipeline = DDIMPipeline.from_pretrained("google/ddpm-cifar10-32")
outputs = pipeline()`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline

pipeline = DDIMPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>)
outputs = pipeline()`}}),U=new je({props:{code:"outputs.images",highlighted:"outputs.images"}}),V=new je({props:{code:'outputs["images"]',highlighted:'outputs[<span class="hljs-string">&quot;images&quot;</span>]'}}),W=new je({props:{code:"outputs[:1]",highlighted:'outputs[:<span class="hljs-number">1</span>]'}}),G=new jt({}),J=new It({props:{name:"class diffusers.utils.BaseOutput",anchor:"diffusers.utils.BaseOutput",parameters:"",source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/outputs.py#L40"}}),M=new Lt({props:{warning:!0,$$slots:{default:[Yt]},$$scope:{ctx:he}}}),R=new It({props:{name:"to_tuple",anchor:"diffusers.utils.BaseOutput.to_tuple",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/outputs.py#L104"}}),{c(){p=l("meta"),I=f(),d=l("h1"),_=l("a"),y=l("span"),B(m.$$.fragment),L=f(),E=l("span"),O=a("BaseOutputs"),$=f(),b=l("p"),K=a("All models have outputs that are instances of subclasses of "),Q=l("a"),Se=a("BaseOutput"),qe=a(`. Those are
data structures containing all the information returned by the model, but that can also be used as tuples or
dictionaries.`),me=f(),X=l("p"),Me=a("Let\u2019s see how this looks in an example:"),$e=f(),B(Y.$$.fragment),ve=f(),g=l("p"),Te=a("The "),oe=l("code"),He=a("outputs"),Le=a(" object is a "),Z=l("a"),Ye=a("ImagePipelineOutput"),Ue=a(`, as we can see in the
documentation of that class below, it means it has an image attribute.`),_e=f(),j=l("p"),Ve=a("You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you will get "),re=l("code"),We=a("None"),Ge=a(":"),be=f(),B(U.$$.fragment),ge=f(),ee=l("p"),Je=a("or via keyword lookup"),we=f(),B(V.$$.fragment),ye=f(),w=l("p"),Re=a("When considering our "),le=l("code"),ze=a("outputs"),Fe=a(" object as tuple, it only considers the attributes that don\u2019t have "),ie=l("code"),Ke=a("None"),Qe=a(` values.
Here for instance, we could retrieve images via indexing:`),Ee=f(),B(W.$$.fragment),Oe=f(),S=l("p"),Xe=a("which will return the tuple "),ne=l("code"),Ze=a("(outputs.images)"),et=a(" for instance."),ke=f(),k=l("h2"),q=l("a"),ue=l("span"),B(G.$$.fragment),tt=f(),pe=l("span"),st=a("BaseOutput"),Pe=f(),v=l("div"),B(J.$$.fragment),at=f(),P=l("p"),ot=a("Base class for all model outputs as dataclass. Has a "),fe=l("code"),rt=a("__getitem__"),lt=a(` that allows indexing by integer or slice (like a
tuple) or strings (like a dictionary) that will ignore the `),ce=l("code"),it=a("None"),nt=a(` attributes. Otherwise behaves like a regular
python dictionary.`),ut=f(),B(M.$$.fragment),pt=f(),T=l("div"),B(R.$$.fragment),ft=f(),z=l("p"),ct=a("Convert self to a tuple containing all the attributes/keys that are not "),de=l("code"),dt=a("None"),ht=a("."),this.h()},l(e){const r=Tt('[data-svelte="svelte-1phssyn"]',document.head);p=i(r,"META",{name:!0,content:!0}),r.forEach(s),I=c(e),d=i(e,"H1",{class:!0});var F=n(d);_=i(F,"A",{id:!0,class:!0,href:!0});var mt=n(_);y=i(mt,"SPAN",{});var $t=n(y);D(m.$$.fragment,$t),$t.forEach(s),mt.forEach(s),L=c(F),E=i(F,"SPAN",{});var vt=n(E);O=o(vt,"BaseOutputs"),vt.forEach(s),F.forEach(s),$=c(e),b=i(e,"P",{});var De=n(b);K=o(De,"All models have outputs that are instances of subclasses of "),Q=i(De,"A",{href:!0});var _t=n(Q);Se=o(_t,"BaseOutput"),_t.forEach(s),qe=o(De,`. Those are
data structures containing all the information returned by the model, but that can also be used as tuples or
dictionaries.`),De.forEach(s),me=c(e),X=i(e,"P",{});var bt=n(X);Me=o(bt,"Let\u2019s see how this looks in an example:"),bt.forEach(s),$e=c(e),D(Y.$$.fragment,e),ve=c(e),g=i(e,"P",{});var te=n(g);Te=o(te,"The "),oe=i(te,"CODE",{});var gt=n(oe);He=o(gt,"outputs"),gt.forEach(s),Le=o(te," object is a "),Z=i(te,"A",{href:!0});var wt=n(Z);Ye=o(wt,"ImagePipelineOutput"),wt.forEach(s),Ue=o(te,`, as we can see in the
documentation of that class below, it means it has an image attribute.`),te.forEach(s),_e=c(e),j=i(e,"P",{});var xe=n(j);Ve=o(xe,"You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you will get "),re=i(xe,"CODE",{});var yt=n(re);We=o(yt,"None"),yt.forEach(s),Ge=o(xe,":"),xe.forEach(s),be=c(e),D(U.$$.fragment,e),ge=c(e),ee=i(e,"P",{});var Et=n(ee);Je=o(Et,"or via keyword lookup"),Et.forEach(s),we=c(e),D(V.$$.fragment,e),ye=c(e),w=i(e,"P",{});var se=n(w);Re=o(se,"When considering our "),le=i(se,"CODE",{});var Ot=n(le);ze=o(Ot,"outputs"),Ot.forEach(s),Fe=o(se," object as tuple, it only considers the attributes that don\u2019t have "),ie=i(se,"CODE",{});var kt=n(ie);Ke=o(kt,"None"),kt.forEach(s),Qe=o(se,` values.
Here for instance, we could retrieve images via indexing:`),se.forEach(s),Ee=c(e),D(W.$$.fragment,e),Oe=c(e),S=i(e,"P",{});var Ce=n(S);Xe=o(Ce,"which will return the tuple "),ne=i(Ce,"CODE",{});var Pt=n(ne);Ze=o(Pt,"(outputs.images)"),Pt.forEach(s),et=o(Ce," for instance."),Ce.forEach(s),ke=c(e),k=i(e,"H2",{class:!0});var Ne=n(k);q=i(Ne,"A",{id:!0,class:!0,href:!0});var Bt=n(q);ue=i(Bt,"SPAN",{});var Dt=n(ue);D(G.$$.fragment,Dt),Dt.forEach(s),Bt.forEach(s),tt=c(Ne),pe=i(Ne,"SPAN",{});var xt=n(pe);st=o(xt,"BaseOutput"),xt.forEach(s),Ne.forEach(s),Pe=c(e),v=i(e,"DIV",{class:!0});var H=n(v);D(J.$$.fragment,H),at=c(H),P=i(H,"P",{});var ae=n(P);ot=o(ae,"Base class for all model outputs as dataclass. Has a "),fe=i(ae,"CODE",{});var Ct=n(fe);rt=o(Ct,"__getitem__"),Ct.forEach(s),lt=o(ae,` that allows indexing by integer or slice (like a
tuple) or strings (like a dictionary) that will ignore the `),ce=i(ae,"CODE",{});var Nt=n(ce);it=o(Nt,"None"),Nt.forEach(s),nt=o(ae,` attributes. Otherwise behaves like a regular
python dictionary.`),ae.forEach(s),ut=c(H),D(M.$$.fragment,H),pt=c(H),T=i(H,"DIV",{class:!0});var Ae=n(T);D(R.$$.fragment,Ae),ft=c(Ae),z=i(Ae,"P",{});var Ie=n(z);ct=o(Ie,"Convert self to a tuple containing all the attributes/keys that are not "),de=i(Ie,"CODE",{});var At=n(de);dt=o(At,"None"),At.forEach(s),ht=o(Ie,"."),Ie.forEach(s),Ae.forEach(s),H.forEach(s),this.h()},h(){h(p,"name","hf:doc:metadata"),h(p,"content",JSON.stringify(Vt)),h(_,"id","baseoutputs"),h(_,"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"),h(_,"href","#baseoutputs"),h(d,"class","relative group"),h(Q,"href","/docs/diffusers/main/en/api/outputs#diffusers.utils.BaseOutput"),h(Z,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.ImagePipelineOutput"),h(q,"id","diffusers.utils.BaseOutput"),h(q,"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"),h(q,"href","#diffusers.utils.BaseOutput"),h(k,"class","relative group"),h(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(v,"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,r){t(document.head,p),u(e,I,r),u(e,d,r),t(d,_),t(_,y),x(m,y,null),t(d,L),t(d,E),t(E,O),u(e,$,r),u(e,b,r),t(b,K),t(b,Q),t(Q,Se),t(b,qe),u(e,me,r),u(e,X,r),t(X,Me),u(e,$e,r),x(Y,e,r),u(e,ve,r),u(e,g,r),t(g,Te),t(g,oe),t(oe,He),t(g,Le),t(g,Z),t(Z,Ye),t(g,Ue),u(e,_e,r),u(e,j,r),t(j,Ve),t(j,re),t(re,We),t(j,Ge),u(e,be,r),x(U,e,r),u(e,ge,r),u(e,ee,r),t(ee,Je),u(e,we,r),x(V,e,r),u(e,ye,r),u(e,w,r),t(w,Re),t(w,le),t(le,ze),t(w,Fe),t(w,ie),t(ie,Ke),t(w,Qe),u(e,Ee,r),x(W,e,r),u(e,Oe,r),u(e,S,r),t(S,Xe),t(S,ne),t(ne,Ze),t(S,et),u(e,ke,r),u(e,k,r),t(k,q),t(q,ue),x(G,ue,null),t(k,tt),t(k,pe),t(pe,st),u(e,Pe,r),u(e,v,r),x(J,v,null),t(v,at),t(v,P),t(P,ot),t(P,fe),t(fe,rt),t(P,lt),t(P,ce),t(ce,it),t(P,nt),t(v,ut),x(M,v,null),t(v,pt),t(v,T),x(R,T,null),t(T,ft),t(T,z),t(z,ct),t(z,de),t(de,dt),t(z,ht),Be=!0},p(e,[r]){const F={};r&2&&(F.$$scope={dirty:r,ctx:e}),M.$set(F)},i(e){Be||(C(m.$$.fragment,e),C(Y.$$.fragment,e),C(U.$$.fragment,e),C(V.$$.fragment,e),C(W.$$.fragment,e),C(G.$$.fragment,e),C(J.$$.fragment,e),C(M.$$.fragment,e),C(R.$$.fragment,e),Be=!0)},o(e){N(m.$$.fragment,e),N(Y.$$.fragment,e),N(U.$$.fragment,e),N(V.$$.fragment,e),N(W.$$.fragment,e),N(G.$$.fragment,e),N(J.$$.fragment,e),N(M.$$.fragment,e),N(R.$$.fragment,e),Be=!1},d(e){s(p),e&&s(I),e&&s(d),A(m),e&&s($),e&&s(b),e&&s(me),e&&s(X),e&&s($e),A(Y,e),e&&s(ve),e&&s(g),e&&s(_e),e&&s(j),e&&s(be),A(U,e),e&&s(ge),e&&s(ee),e&&s(we),A(V,e),e&&s(ye),e&&s(w),e&&s(Ee),A(W,e),e&&s(Oe),e&&s(S),e&&s(ke),e&&s(k),A(G),e&&s(Pe),e&&s(v),A(J),A(M),A(R)}}}const Vt={local:"baseoutputs",sections:[{local:"diffusers.utils.BaseOutput",title:"BaseOutput"}],title:"BaseOutputs"};function Wt(he){return Ht(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Kt extends St{constructor(p){super();qt(this,p,Wt,Ut,Mt,{})}}export{Kt as default,Vt as metadata};
