import{S as An,i as Nn,s as Ln,e as a,k as d,w as b,t as l,M as Sn,c as r,d as t,m as u,a as i,x as _,h as p,b as c,G as n,g as o,y as P,q as $,o as j,B as k,v as On}from"../../chunks/vendor-hf-doc-builder.js";import{T as Mn}from"../../chunks/Tip-hf-doc-builder.js";import{D as Hn}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ct}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ft}from"../../chunks/IconCopyLink-hf-doc-builder.js";function Wn(ne){let f,w,m,h,D,g,W,x;return{c(){f=a("p"),w=l("It might be a bit unintuitive at first to pass "),m=a("code"),h=l("generator"),D=l(` objects to the pipelines instead of
just integer values representing the seed, but this is the recommended design when dealing with
probabilistic models in PyTorch as generators are `),g=a("em"),W=l("random states"),x=l(` that are advanced and can thus be
passed to multiple pipelines in a sequence.`)},l(I){f=r(I,"P",{});var v=i(f);w=p(v,"It might be a bit unintuitive at first to pass "),m=r(v,"CODE",{});var y=i(m);h=p(y,"generator"),y.forEach(t),D=p(v,` objects to the pipelines instead of
just integer values representing the seed, but this is the recommended design when dealing with
probabilistic models in PyTorch as generators are `),g=r(v,"EM",{});var se=i(g);W=p(se,"random states"),se.forEach(t),x=p(v,` that are advanced and can thus be
passed to multiple pipelines in a sequence.`),v.forEach(t)},m(I,v){o(I,f,v),n(f,w),n(f,m),n(m,h),n(f,D),n(f,g),n(g,W),n(f,x)},d(I){I&&t(f)}}}function Fn(ne){let f,w;return{c(){f=a("p"),w=l(`As a consequence, we recommend always passing a CPU generator if Reproducibility is important.
The loss of performance is often neglectable, but one can be sure to generate much more similar
values than if the pipeline would have been run on CPU.`)},l(m){f=r(m,"P",{});var h=i(f);w=p(h,`As a consequence, we recommend always passing a CPU generator if Reproducibility is important.
The loss of performance is often neglectable, but one can be sure to generate much more similar
values than if the pipeline would have been run on CPU.`),h.forEach(t)},m(m,h){o(m,f,h),n(f,w)},d(m){m&&t(f)}}}function Bn(ne){let f,w,m,h,D,g,W,x,I,v,y,se,F,mt,ht,Ge,ae,gt,Re,re,ie,_e,vt,wt,Me,oe,yt,Ae,T,M,Pe,B,bt,$e,_t,Ne,le,Pt,Le,A,$t,pe,jt,kt,Se,z,Oe,E,Et,J,je,Ut,Dt,K,xt,It,He,Q,We,de,Tt,Fe,ue,qt,Be,N,ze,ce,Ct,Je,fe,Gt,Ke,V,Qe,me,Rt,Ve,U,Mt,he,ke,At,Nt,Ee,Lt,St,Xe,X,Ye,ge,Ot,Ze,L,et,S,Ht,ve,Wt,Ft,tt,q,O,Ue,Y,Bt,De,zt,nt,C,H,xe,Z,Jt,Ie,Kt,st,G,ee,Qt,R,Vt,Te,Xt,Yt,qe,Zt,en,at;return g=new ft({}),B=new ft({}),z=new ct({props:{code:`from diffusers import DDIMPipeline
import numpy as np

model_id = "google/ddpm-cifar10-32"

# load model and scheduler
ddim = DDIMPipeline.from_pretrained(model_id)

# run pipeline for just two steps and return numpy tensor
image = ddim(num_inference_steps=2, output_type="np").images
print(np.abs(image).sum())`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),Q=new ct({props:{code:`import torch
from diffusers import DDIMPipeline
import numpy as np

model_id = "google/ddpm-cifar10-32"

# load model and scheduler
ddim = DDIMPipeline.from_pretrained(model_id)

# create a generator for reproducibility
generator = torch.Generator(device="cpu").manual_seed(0)

# run pipeline for just two steps and return numpy tensor
image = ddim(num_inference_steps=2, output_type="np", generator=generator).images
print(np.abs(image).sum())`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id)

<span class="hljs-comment"># create a generator for reproducibility</span>
generator = torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>, generator=generator).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),N=new Mn({props:{$$slots:{default:[Wn]},$$scope:{ctx:ne}}}),V=new ct({props:{code:`import torch
from diffusers import DDIMPipeline
import numpy as np

model_id = "google/ddpm-cifar10-32"

# load model and scheduler
ddim = DDIMPipeline.from_pretrained(model_id)
ddim.to("cuda")

# create a generator for reproducibility
generator = torch.Generator(device="cuda").manual_seed(0)

# run pipeline for just two steps and return numpy tensor
image = ddim(num_inference_steps=2, output_type="np", generator=generator).images
print(np.abs(image).sum())`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id)
ddim.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># create a generator for reproducibility</span>
generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>, generator=generator).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),X=new ct({props:{code:`import torch
from diffusers import DDIMPipeline
import numpy as np

model_id = "google/ddpm-cifar10-32"

# load model and scheduler
ddim = DDIMPipeline.from_pretrained(model_id)
ddim.to("cuda")

# create a generator for reproducibility
generator = torch.manual_seed(0)

# run pipeline for just two steps and return numpy tensor
image = ddim(num_inference_steps=2, output_type="np", generator=generator).images
print(np.abs(image).sum())`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id)
ddim.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># create a generator for reproducibility</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>, generator=generator).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),L=new Mn({props:{$$slots:{default:[Fn]},$$scope:{ctx:ne}}}),Y=new ft({}),Z=new ft({}),ee=new Hn({props:{name:"diffusers.utils.randn_tensor",anchor:"diffusers.utils.randn_tensor",parameters:[{name:"shape",val:": typing.Union[typing.Tuple, typing.List]"},{name:"generator",val:": typing.Union[typing.List[ForwardRef('torch.Generator')], ForwardRef('torch.Generator'), NoneType] = None"},{name:"device",val:": typing.Optional[ForwardRef('torch.device')] = None"},{name:"dtype",val:": typing.Optional[ForwardRef('torch.dtype')] = None"},{name:"layout",val:": typing.Optional[ForwardRef('torch.layout')] = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/torch_utils.py#L29"}}),{c(){f=a("meta"),w=d(),m=a("h1"),h=a("a"),D=a("span"),b(g.$$.fragment),W=d(),x=a("span"),I=l("Reproducibility"),v=d(),y=a("p"),se=l(`Before reading about reproducibility for Diffusers, it is strongly recommended to take a look at
`),F=a("a"),mt=l("PyTorch\u2019s statement about reproducibility"),ht=l("."),Ge=d(),ae=a("p"),gt=l("PyTorch states that"),Re=d(),re=a("blockquote"),ie=a("p"),_e=a("em"),vt=l("completely reproducible results are not guaranteed across PyTorch releases, individual commits, or different platforms."),wt=l(`
While one can never expect the same results across platforms, one can expect results to be reproducible
across releases, platforms, etc\u2026 within a certain tolerance. However, this tolerance strongly varies
depending on the diffusion pipeline and checkpoint.`),Me=d(),oe=a("p"),yt=l("In the following, we show how to best control sources of randomness for diffusion models."),Ae=d(),T=a("h2"),M=a("a"),Pe=a("span"),b(B.$$.fragment),bt=d(),$e=a("span"),_t=l("Inference"),Ne=d(),le=a("p"),Pt=l(`During inference, diffusion pipelines heavily rely on random sampling operations, such as the creating the
gaussian noise tensors to be denoised and adding noise to the scheduling step.`),Le=d(),A=a("p"),$t=l("Let\u2019s have a look at an example. We run the "),pe=a("a"),jt=l("DDIM pipeline"),kt=l(`
for just two inference steps and return a numpy tensor to look into the numerical values of the output.`),Se=d(),b(z.$$.fragment),Oe=d(),E=a("p"),Et=l(`Running the above prints a value of 1464.2076, but running it again prints a different
value of 1495.1768. What is going on here? Every time the pipeline is run, gaussian noise
is created and step-wise denoised. To create the gaussian noise with `),J=a("a"),je=a("code"),Ut=l("torch.randn"),Dt=l(`, a different random seed is taken every time, thus leading to a different result.
This is a desired property of diffusion pipelines, as it means that the pipeline can create a different random image every time it is run. In many cases, one would like to generate the exact same image of a certain
run, for which case an instance of a `),K=a("a"),xt=l("PyTorch generator"),It=l(" has to be passed:"),He=d(),b(Q.$$.fragment),We=d(),de=a("p"),Tt=l(`Running the above always prints a value of 1491.1711 - also upon running it again because we
define the generator object to be passed to all random functions of the pipeline.`),Fe=d(),ue=a("p"),qt=l("If you run this code snippet on your specific hardware and version, you should get a similar, if not the same, result."),Be=d(),b(N.$$.fragment),ze=d(),ce=a("p"),Ct=l(`Great! Now, we know how to write reproducible pipelines, but it gets a bit trickier since the above example only runs on the CPU. How do we also achieve reproducibility on GPU?
In short, one should not expect full reproducibility across different hardware when running pipelines on GPU
as matrix multiplications are less deterministic on GPU than on CPU and diffusion pipelines tend to require
a lot of matrix multiplications. Let\u2019s see what we can do to keep the randomness within limits across
different GPU hardware.`),Je=d(),fe=a("p"),Gt=l(`To achieve maximum speed performance, it is recommended to create the generator directly on GPU when running
the pipeline on GPU:`),Ke=d(),b(V.$$.fragment),Qe=d(),me=a("p"),Rt=l(`Running the above now prints a value of 1389.8634 - even though we\u2019re using the exact same seed!
This is unfortunate as it means we cannot reproduce the results we achieved on GPU, also on CPU.
Nevertheless, it should be expected since the GPU uses a different random number generator than the CPU.`),Ve=d(),U=a("p"),Mt=l("To circumvent this problem, we created a "),he=a("a"),ke=a("code"),At=l("randn_tensor"),Nt=l(` function, which can create random noise
on the CPU and then move the tensor to GPU if necessary. The function is used everywhere inside the pipelines allowing the user to `),Ee=a("strong"),Lt=l("always"),St=l(" pass a CPU generator even if the pipeline is run on GPU:"),Xe=d(),b(X.$$.fragment),Ye=d(),ge=a("p"),Ot=l(`Running the above now prints a value of 1491.1713, much closer to the value of 1491.1711 when
the pipeline is fully run on the CPU.`),Ze=d(),b(L.$$.fragment),et=d(),S=a("p"),Ht=l("Finally, we noticed that more complex pipelines, such as "),ve=a("a"),Wt=l("UnCLIPPipeline"),Ft=l(` are often extremely
susceptible to precision error propagation and thus one cannot expect even similar results across
different GPU hardware or PyTorch versions. In such cases, one has to make sure to run
exactly the same hardware and PyTorch version for full Reproducibility.`),tt=d(),q=a("h2"),O=a("a"),Ue=a("span"),b(Y.$$.fragment),Bt=d(),De=a("span"),zt=l("Randomness utilities"),nt=d(),C=a("h3"),H=a("a"),xe=a("span"),b(Z.$$.fragment),Jt=d(),Ie=a("span"),Kt=l("randn_tensor"),st=d(),G=a("div"),b(ee.$$.fragment),Qt=d(),R=a("p"),Vt=l("This is a helper function that allows to create random tensors on the desired "),Te=a("code"),Xt=l("device"),Yt=l(" with the desired "),qe=a("code"),Zt=l("dtype"),en=l(`. When
passing a list of generators one can seed each batched size individually. If CPU generators are passed the tensor
will always be created on CPU.`),this.h()},l(e){const s=Sn('[data-svelte="svelte-1phssyn"]',document.head);f=r(s,"META",{name:!0,content:!0}),s.forEach(t),w=u(e),m=r(e,"H1",{class:!0});var te=i(m);h=r(te,"A",{id:!0,class:!0,href:!0});var Ce=i(h);D=r(Ce,"SPAN",{});var nn=i(D);_(g.$$.fragment,nn),nn.forEach(t),Ce.forEach(t),W=u(te),x=r(te,"SPAN",{});var sn=i(x);I=p(sn,"Reproducibility"),sn.forEach(t),te.forEach(t),v=u(e),y=r(e,"P",{});var rt=i(y);se=p(rt,`Before reading about reproducibility for Diffusers, it is strongly recommended to take a look at
`),F=r(rt,"A",{href:!0,rel:!0});var an=i(F);mt=p(an,"PyTorch\u2019s statement about reproducibility"),an.forEach(t),ht=p(rt,"."),rt.forEach(t),Ge=u(e),ae=r(e,"P",{});var rn=i(ae);gt=p(rn,"PyTorch states that"),rn.forEach(t),Re=u(e),re=r(e,"BLOCKQUOTE",{});var on=i(re);ie=r(on,"P",{});var tn=i(ie);_e=r(tn,"EM",{});var ln=i(_e);vt=p(ln,"completely reproducible results are not guaranteed across PyTorch releases, individual commits, or different platforms."),ln.forEach(t),wt=p(tn,`
While one can never expect the same results across platforms, one can expect results to be reproducible
across releases, platforms, etc\u2026 within a certain tolerance. However, this tolerance strongly varies
depending on the diffusion pipeline and checkpoint.`),tn.forEach(t),on.forEach(t),Me=u(e),oe=r(e,"P",{});var pn=i(oe);yt=p(pn,"In the following, we show how to best control sources of randomness for diffusion models."),pn.forEach(t),Ae=u(e),T=r(e,"H2",{class:!0});var it=i(T);M=r(it,"A",{id:!0,class:!0,href:!0});var dn=i(M);Pe=r(dn,"SPAN",{});var un=i(Pe);_(B.$$.fragment,un),un.forEach(t),dn.forEach(t),bt=u(it),$e=r(it,"SPAN",{});var cn=i($e);_t=p(cn,"Inference"),cn.forEach(t),it.forEach(t),Ne=u(e),le=r(e,"P",{});var fn=i(le);Pt=p(fn,`During inference, diffusion pipelines heavily rely on random sampling operations, such as the creating the
gaussian noise tensors to be denoised and adding noise to the scheduling step.`),fn.forEach(t),Le=u(e),A=r(e,"P",{});var ot=i(A);$t=p(ot,"Let\u2019s have a look at an example. We run the "),pe=r(ot,"A",{href:!0});var mn=i(pe);jt=p(mn,"DDIM pipeline"),mn.forEach(t),kt=p(ot,`
for just two inference steps and return a numpy tensor to look into the numerical values of the output.`),ot.forEach(t),Se=u(e),_(z.$$.fragment,e),Oe=u(e),E=r(e,"P",{});var we=i(E);Et=p(we,`Running the above prints a value of 1464.2076, but running it again prints a different
value of 1495.1768. What is going on here? Every time the pipeline is run, gaussian noise
is created and step-wise denoised. To create the gaussian noise with `),J=r(we,"A",{href:!0,rel:!0});var hn=i(J);je=r(hn,"CODE",{});var gn=i(je);Ut=p(gn,"torch.randn"),gn.forEach(t),hn.forEach(t),Dt=p(we,`, a different random seed is taken every time, thus leading to a different result.
This is a desired property of diffusion pipelines, as it means that the pipeline can create a different random image every time it is run. In many cases, one would like to generate the exact same image of a certain
run, for which case an instance of a `),K=r(we,"A",{href:!0,rel:!0});var vn=i(K);xt=p(vn,"PyTorch generator"),vn.forEach(t),It=p(we," has to be passed:"),we.forEach(t),He=u(e),_(Q.$$.fragment,e),We=u(e),de=r(e,"P",{});var wn=i(de);Tt=p(wn,`Running the above always prints a value of 1491.1711 - also upon running it again because we
define the generator object to be passed to all random functions of the pipeline.`),wn.forEach(t),Fe=u(e),ue=r(e,"P",{});var yn=i(ue);qt=p(yn,"If you run this code snippet on your specific hardware and version, you should get a similar, if not the same, result."),yn.forEach(t),Be=u(e),_(N.$$.fragment,e),ze=u(e),ce=r(e,"P",{});var bn=i(ce);Ct=p(bn,`Great! Now, we know how to write reproducible pipelines, but it gets a bit trickier since the above example only runs on the CPU. How do we also achieve reproducibility on GPU?
In short, one should not expect full reproducibility across different hardware when running pipelines on GPU
as matrix multiplications are less deterministic on GPU than on CPU and diffusion pipelines tend to require
a lot of matrix multiplications. Let\u2019s see what we can do to keep the randomness within limits across
different GPU hardware.`),bn.forEach(t),Je=u(e),fe=r(e,"P",{});var _n=i(fe);Gt=p(_n,`To achieve maximum speed performance, it is recommended to create the generator directly on GPU when running
the pipeline on GPU:`),_n.forEach(t),Ke=u(e),_(V.$$.fragment,e),Qe=u(e),me=r(e,"P",{});var Pn=i(me);Rt=p(Pn,`Running the above now prints a value of 1389.8634 - even though we\u2019re using the exact same seed!
This is unfortunate as it means we cannot reproduce the results we achieved on GPU, also on CPU.
Nevertheless, it should be expected since the GPU uses a different random number generator than the CPU.`),Pn.forEach(t),Ve=u(e),U=r(e,"P",{});var ye=i(U);Mt=p(ye,"To circumvent this problem, we created a "),he=r(ye,"A",{href:!0});var $n=i(he);ke=r($n,"CODE",{});var jn=i(ke);At=p(jn,"randn_tensor"),jn.forEach(t),$n.forEach(t),Nt=p(ye,` function, which can create random noise
on the CPU and then move the tensor to GPU if necessary. The function is used everywhere inside the pipelines allowing the user to `),Ee=r(ye,"STRONG",{});var kn=i(Ee);Lt=p(kn,"always"),kn.forEach(t),St=p(ye," pass a CPU generator even if the pipeline is run on GPU:"),ye.forEach(t),Xe=u(e),_(X.$$.fragment,e),Ye=u(e),ge=r(e,"P",{});var En=i(ge);Ot=p(En,`Running the above now prints a value of 1491.1713, much closer to the value of 1491.1711 when
the pipeline is fully run on the CPU.`),En.forEach(t),Ze=u(e),_(L.$$.fragment,e),et=u(e),S=r(e,"P",{});var lt=i(S);Ht=p(lt,"Finally, we noticed that more complex pipelines, such as "),ve=r(lt,"A",{href:!0});var Un=i(ve);Wt=p(Un,"UnCLIPPipeline"),Un.forEach(t),Ft=p(lt,` are often extremely
susceptible to precision error propagation and thus one cannot expect even similar results across
different GPU hardware or PyTorch versions. In such cases, one has to make sure to run
exactly the same hardware and PyTorch version for full Reproducibility.`),lt.forEach(t),tt=u(e),q=r(e,"H2",{class:!0});var pt=i(q);O=r(pt,"A",{id:!0,class:!0,href:!0});var Dn=i(O);Ue=r(Dn,"SPAN",{});var xn=i(Ue);_(Y.$$.fragment,xn),xn.forEach(t),Dn.forEach(t),Bt=u(pt),De=r(pt,"SPAN",{});var In=i(De);zt=p(In,"Randomness utilities"),In.forEach(t),pt.forEach(t),nt=u(e),C=r(e,"H3",{class:!0});var dt=i(C);H=r(dt,"A",{id:!0,class:!0,href:!0});var Tn=i(H);xe=r(Tn,"SPAN",{});var qn=i(xe);_(Z.$$.fragment,qn),qn.forEach(t),Tn.forEach(t),Jt=u(dt),Ie=r(dt,"SPAN",{});var Cn=i(Ie);Kt=p(Cn,"randn_tensor"),Cn.forEach(t),dt.forEach(t),st=u(e),G=r(e,"DIV",{class:!0});var ut=i(G);_(ee.$$.fragment,ut),Qt=u(ut),R=r(ut,"P",{});var be=i(R);Vt=p(be,"This is a helper function that allows to create random tensors on the desired "),Te=r(be,"CODE",{});var Gn=i(Te);Xt=p(Gn,"device"),Gn.forEach(t),Yt=p(be," with the desired "),qe=r(be,"CODE",{});var Rn=i(qe);Zt=p(Rn,"dtype"),Rn.forEach(t),en=p(be,`. When
passing a list of generators one can seed each batched size individually. If CPU generators are passed the tensor
will always be created on CPU.`),be.forEach(t),ut.forEach(t),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(zn)),c(h,"id","reproducibility"),c(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"),c(h,"href","#reproducibility"),c(m,"class","relative group"),c(F,"href","https://pytorch.org/docs/stable/notes/randomness.html"),c(F,"rel","nofollow"),c(M,"id","inference"),c(M,"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"),c(M,"href","#inference"),c(T,"class","relative group"),c(pe,"href","./api/pipelines/ddim.mdx"),c(J,"href","https://pytorch.org/docs/stable/generated/torch.randn.html"),c(J,"rel","nofollow"),c(K,"href","https://pytorch.org/docs/stable/generated/torch.randn.html"),c(K,"rel","nofollow"),c(he,"href","#diffusers.utils.randn_tensor"),c(ve,"href","/docs/diffusers/main/en/api/pipelines/unclip#diffusers.UnCLIPPipeline"),c(O,"id","randomness-utilities"),c(O,"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"),c(O,"href","#randomness-utilities"),c(q,"class","relative group"),c(H,"id","diffusers.utils.randn_tensor"),c(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"),c(H,"href","#diffusers.utils.randn_tensor"),c(C,"class","relative group"),c(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,s){n(document.head,f),o(e,w,s),o(e,m,s),n(m,h),n(h,D),P(g,D,null),n(m,W),n(m,x),n(x,I),o(e,v,s),o(e,y,s),n(y,se),n(y,F),n(F,mt),n(y,ht),o(e,Ge,s),o(e,ae,s),n(ae,gt),o(e,Re,s),o(e,re,s),n(re,ie),n(ie,_e),n(_e,vt),n(ie,wt),o(e,Me,s),o(e,oe,s),n(oe,yt),o(e,Ae,s),o(e,T,s),n(T,M),n(M,Pe),P(B,Pe,null),n(T,bt),n(T,$e),n($e,_t),o(e,Ne,s),o(e,le,s),n(le,Pt),o(e,Le,s),o(e,A,s),n(A,$t),n(A,pe),n(pe,jt),n(A,kt),o(e,Se,s),P(z,e,s),o(e,Oe,s),o(e,E,s),n(E,Et),n(E,J),n(J,je),n(je,Ut),n(E,Dt),n(E,K),n(K,xt),n(E,It),o(e,He,s),P(Q,e,s),o(e,We,s),o(e,de,s),n(de,Tt),o(e,Fe,s),o(e,ue,s),n(ue,qt),o(e,Be,s),P(N,e,s),o(e,ze,s),o(e,ce,s),n(ce,Ct),o(e,Je,s),o(e,fe,s),n(fe,Gt),o(e,Ke,s),P(V,e,s),o(e,Qe,s),o(e,me,s),n(me,Rt),o(e,Ve,s),o(e,U,s),n(U,Mt),n(U,he),n(he,ke),n(ke,At),n(U,Nt),n(U,Ee),n(Ee,Lt),n(U,St),o(e,Xe,s),P(X,e,s),o(e,Ye,s),o(e,ge,s),n(ge,Ot),o(e,Ze,s),P(L,e,s),o(e,et,s),o(e,S,s),n(S,Ht),n(S,ve),n(ve,Wt),n(S,Ft),o(e,tt,s),o(e,q,s),n(q,O),n(O,Ue),P(Y,Ue,null),n(q,Bt),n(q,De),n(De,zt),o(e,nt,s),o(e,C,s),n(C,H),n(H,xe),P(Z,xe,null),n(C,Jt),n(C,Ie),n(Ie,Kt),o(e,st,s),o(e,G,s),P(ee,G,null),n(G,Qt),n(G,R),n(R,Vt),n(R,Te),n(Te,Xt),n(R,Yt),n(R,qe),n(qe,Zt),n(R,en),at=!0},p(e,[s]){const te={};s&2&&(te.$$scope={dirty:s,ctx:e}),N.$set(te);const Ce={};s&2&&(Ce.$$scope={dirty:s,ctx:e}),L.$set(Ce)},i(e){at||($(g.$$.fragment,e),$(B.$$.fragment,e),$(z.$$.fragment,e),$(Q.$$.fragment,e),$(N.$$.fragment,e),$(V.$$.fragment,e),$(X.$$.fragment,e),$(L.$$.fragment,e),$(Y.$$.fragment,e),$(Z.$$.fragment,e),$(ee.$$.fragment,e),at=!0)},o(e){j(g.$$.fragment,e),j(B.$$.fragment,e),j(z.$$.fragment,e),j(Q.$$.fragment,e),j(N.$$.fragment,e),j(V.$$.fragment,e),j(X.$$.fragment,e),j(L.$$.fragment,e),j(Y.$$.fragment,e),j(Z.$$.fragment,e),j(ee.$$.fragment,e),at=!1},d(e){t(f),e&&t(w),e&&t(m),k(g),e&&t(v),e&&t(y),e&&t(Ge),e&&t(ae),e&&t(Re),e&&t(re),e&&t(Me),e&&t(oe),e&&t(Ae),e&&t(T),k(B),e&&t(Ne),e&&t(le),e&&t(Le),e&&t(A),e&&t(Se),k(z,e),e&&t(Oe),e&&t(E),e&&t(He),k(Q,e),e&&t(We),e&&t(de),e&&t(Fe),e&&t(ue),e&&t(Be),k(N,e),e&&t(ze),e&&t(ce),e&&t(Je),e&&t(fe),e&&t(Ke),k(V,e),e&&t(Qe),e&&t(me),e&&t(Ve),e&&t(U),e&&t(Xe),k(X,e),e&&t(Ye),e&&t(ge),e&&t(Ze),k(L,e),e&&t(et),e&&t(S),e&&t(tt),e&&t(q),k(Y),e&&t(nt),e&&t(C),k(Z),e&&t(st),e&&t(G),k(ee)}}}const zn={local:"reproducibility",sections:[{local:"inference",title:"Inference"},{local:"randomness-utilities",sections:[{local:"diffusers.utils.randn_tensor",title:"randn_tensor"}],title:"Randomness utilities"}],title:"Reproducibility"};function Jn(ne){return On(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zn extends An{constructor(f){super();Nn(this,f,Jn,Bn,Ln,{})}}export{Zn as default,zn as metadata};
