import{S as ii,i as ci,s as mi,e as r,k as c,w as P,t as n,M as di,c as a,d as t,m,a as s,x as b,h as l,b as i,N as fi,G as e,g as p,y as w,q as F,o as $,B as y,v as pi,L as yn}from"../../chunks/vendor-hf-doc-builder.js";import{T as li}from"../../chunks/Tip-hf-doc-builder.js";import{D as ce}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Tn}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ke}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as $n}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as hi}from"../../chunks/PipelineTag-hf-doc-builder.js";function gi(D){let h,T,_,g,v;return g=new Tn({props:{code:`from transformers import PoolFormerConfig, PoolFormerModel

# Initializing a PoolFormer sail/poolformer_s12 style configuration
configuration = PoolFormerConfig()

# Initializing a model (with random weights) from the sail/poolformer_s12 style configuration
model = PoolFormerModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PoolFormerConfig, PoolFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a PoolFormer sail/poolformer_s12 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = PoolFormerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the sail/poolformer_s12 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PoolFormerModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=r("p"),T=n("Example:"),_=c(),P(g.$$.fragment)},l(d){h=a(d,"P",{});var u=s(h);T=l(u,"Example:"),u.forEach(t),_=m(d),b(g.$$.fragment,d)},m(d,u){p(d,h,u),e(h,T),p(d,_,u),w(g,d,u),v=!0},p:yn,i(d){v||(F(g.$$.fragment,d),v=!0)},o(d){$(g.$$.fragment,d),v=!1},d(d){d&&t(h),d&&t(_),y(g,d)}}}function ui(D){let h,T,_,g,v;return{c(){h=r("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){h=a(d,"P",{});var u=s(h);T=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var L=s(_);g=l(L,"Module"),L.forEach(t),v=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){p(d,h,u),e(h,T),e(h,_),e(_,g),e(h,v)},d(d){d&&t(h)}}}function _i(D){let h,T,_,g,v;return g=new Tn({props:{code:`from transformers import AutoImageProcessor, PoolFormerModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("sail/poolformer_s12")
model = PoolFormerModel.from_pretrained("sail/poolformer_s12")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PoolFormerModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;sail/poolformer_s12&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PoolFormerModel.from_pretrained(<span class="hljs-string">&quot;sail/poolformer_s12&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">512</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){h=r("p"),T=n("Example:"),_=c(),P(g.$$.fragment)},l(d){h=a(d,"P",{});var u=s(h);T=l(u,"Example:"),u.forEach(t),_=m(d),b(g.$$.fragment,d)},m(d,u){p(d,h,u),e(h,T),p(d,_,u),w(g,d,u),v=!0},p:yn,i(d){v||(F(g.$$.fragment,d),v=!0)},o(d){$(g.$$.fragment,d),v=!1},d(d){d&&t(h),d&&t(_),y(g,d)}}}function vi(D){let h,T,_,g,v;return{c(){h=r("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){h=a(d,"P",{});var u=s(h);T=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var L=s(_);g=l(L,"Module"),L.forEach(t),v=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){p(d,h,u),e(h,T),e(h,_),e(_,g),e(h,v)},d(d){d&&t(h)}}}function Pi(D){let h,T,_,g,v;return g=new Tn({props:{code:`from transformers import AutoImageProcessor, PoolFormerForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("sail/poolformer_s12")
model = PoolFormerForImageClassification.from_pretrained("sail/poolformer_s12")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PoolFormerForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;sail/poolformer_s12&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PoolFormerForImageClassification.from_pretrained(<span class="hljs-string">&quot;sail/poolformer_s12&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){h=r("p"),T=n("Example:"),_=c(),P(g.$$.fragment)},l(d){h=a(d,"P",{});var u=s(h);T=l(u,"Example:"),u.forEach(t),_=m(d),b(g.$$.fragment,d)},m(d,u){p(d,h,u),e(h,T),p(d,_,u),w(g,d,u),v=!0},p:yn,i(d){v||(F(g.$$.fragment,d),v=!0)},o(d){$(g.$$.fragment,d),v=!1},d(d){d&&t(h),d&&t(_),y(g,d)}}}function bi(D){let h,T,_,g,v,d,u,L,zr,Ht,X,me,Zo,Ae,kr,et,Ar,Bt,de,Mr,Me,jr,Dr,Ut,ho,Nr,Wt,go,ot,qr,Vt,fe,Lr,je,Sr,Rr,Gt,De,En,Yt,uo,Or,Jt,O,Ne,Hr,qe,Br,Ur,Wr,Le,Vr,_o,Gr,Yr,Jr,tt,Kr,Kt,pe,rt,E,vo,at,Xr,Qr,st,nt,Zr,ea,lt,it,oa,ta,Po,ct,ra,aa,bo,mt,sa,na,I,x,wo,la,ia,dt,ca,ma,ft,da,fa,Fo,pa,ha,$o,ga,ua,C,yo,_a,va,pt,Pa,ba,ht,wa,Fa,To,$a,ya,Eo,Ta,Ea,z,Io,Ia,xa,gt,Ca,za,ut,ka,Aa,xo,Ma,ja,Co,Da,Na,k,zo,qa,La,_t,Sa,Ra,vt,Oa,Ha,ko,Ba,Ua,Ao,Wa,Va,A,Mo,Ga,Ya,Pt,Ja,Ka,bt,Xa,Qa,jo,Za,es,Do,os,Xt,H,ts,Se,rs,as,Re,ss,ns,Qt,Q,he,wt,Oe,ls,Ft,is,Zt,No,cs,er,He,or,qo,B,Lo,ms,ds,Be,fs,ps,Ue,hs,gs,tr,So,us,rr,Z,ge,$t,We,_s,yt,vs,ar,M,Ve,Ps,ee,bs,Ro,ws,Fs,Ge,$s,ys,Ts,oe,Es,Oo,Is,xs,Ho,Cs,zs,ks,ue,sr,te,_e,Tt,Ye,As,Et,Ms,nr,re,Je,js,ve,Ke,Ds,It,Ns,lr,ae,Pe,xt,Xe,qs,Ct,Ls,ir,S,Qe,Ss,zt,Rs,Os,be,Ze,Hs,kt,Bs,cr,se,we,At,eo,Us,Mt,Ws,mr,R,oo,Vs,to,Gs,ro,Ys,Js,Ks,N,ao,Xs,ne,Qs,Bo,Zs,en,jt,on,tn,rn,Fe,an,$e,dr,le,ye,Dt,so,sn,Nt,nn,fr,j,no,ln,qt,cn,mn,lo,dn,io,fn,pn,hn,q,co,gn,ie,un,Uo,_n,vn,Lt,Pn,bn,wn,Te,Fn,Ee,pr;return d=new ke({}),Ae=new ke({}),Oe=new ke({}),He=new hi({props:{pipeline:"image-classification"}}),We=new ke({}),Ve=new ce({props:{name:"class transformers.PoolFormerConfig",anchor:"transformers.PoolFormerConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"patch_size",val:" = 16"},{name:"stride",val:" = 16"},{name:"pool_size",val:" = 3"},{name:"mlp_ratio",val:" = 4.0"},{name:"depths",val:" = [2, 2, 6, 2]"},{name:"hidden_sizes",val:" = [64, 128, 320, 512]"},{name:"patch_sizes",val:" = [7, 3, 3, 3]"},{name:"strides",val:" = [4, 2, 2, 2]"},{name:"padding",val:" = [2, 1, 1, 1]"},{name:"num_encoder_blocks",val:" = 4"},{name:"drop_path_rate",val:" = 0.0"},{name:"hidden_act",val:" = 'gelu'"},{name:"use_layer_scale",val:" = True"},{name:"layer_scale_init_value",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PoolFormerConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of channels in the input image.`,name:"num_channels"},{anchor:"transformers.PoolFormerConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size of the input patch.`,name:"patch_size"},{anchor:"transformers.PoolFormerConfig.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The stride of the input patch.`,name:"stride"},{anchor:"transformers.PoolFormerConfig.pool_size",description:`<strong>pool_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The size of the pooling window.`,name:"pool_size"},{anchor:"transformers.PoolFormerConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
The ratio of the number of channels in the output of the MLP to the number of channels in the input.`,name:"mlp_ratio"},{anchor:"transformers.PoolFormerConfig.depths",description:`<strong>depths</strong> (<code>list</code>, <em>optional</em>, defaults to <code>[2, 2, 6, 2]</code>) &#x2014;
The depth of each encoder block.`,name:"depths"},{anchor:"transformers.PoolFormerConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>list</code>, <em>optional</em>, defaults to <code>[64, 128, 320, 512]</code>) &#x2014;
The hidden sizes of each encoder block.`,name:"hidden_sizes"},{anchor:"transformers.PoolFormerConfig.patch_sizes",description:`<strong>patch_sizes</strong> (<code>list</code>, <em>optional</em>, defaults to <code>[7, 3, 3, 3]</code>) &#x2014;
The size of the input patch for each encoder block.`,name:"patch_sizes"},{anchor:"transformers.PoolFormerConfig.strides",description:`<strong>strides</strong> (<code>list</code>, <em>optional</em>, defaults to <code>[4, 2, 2, 2]</code>) &#x2014;
The stride of the input patch for each encoder block.`,name:"strides"},{anchor:"transformers.PoolFormerConfig.padding",description:`<strong>padding</strong> (<code>list</code>, <em>optional</em>, defaults to <code>[2, 1, 1, 1]</code>) &#x2014;
The padding of the input patch for each encoder block.`,name:"padding"},{anchor:"transformers.PoolFormerConfig.num_encoder_blocks",description:`<strong>num_encoder_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of encoder blocks.`,name:"num_encoder_blocks"},{anchor:"transformers.PoolFormerConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout rate for the dropout layers.`,name:"drop_path_rate"},{anchor:"transformers.PoolFormerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The activation function for the hidden layers.`,name:"hidden_act"},{anchor:"transformers.PoolFormerConfig.use_layer_scale",description:`<strong>use_layer_scale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use layer scale.`,name:"use_layer_scale"},{anchor:"transformers.PoolFormerConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The initial value for the layer scale.`,name:"layer_scale_init_value"},{anchor:"transformers.PoolFormerConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The initializer range for the weights.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/configuration_poolformer.py#L34"}}),ue=new $n({props:{anchor:"transformers.PoolFormerConfig.example",$$slots:{default:[gi]},$$scope:{ctx:D}}}),Ye=new ke({}),Je=new ce({props:{name:"class transformers.PoolFormerFeatureExtractor",anchor:"transformers.PoolFormerFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/feature_extraction_poolformer.py#L26"}}),Ke=new ce({props:{name:"__call__",anchor:"transformers.PoolFormerFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L448"}}),Xe=new ke({}),Qe=new ce({props:{name:"class transformers.PoolFormerImageProcessor",anchor:"transformers.PoolFormerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"crop_pct",val:": int = 0.9"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_rescale",val:": bool = True"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PoolFormerImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.PoolFormerImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. Can be overridden by <code>size</code> in the <code>preprocess</code> method. If crop_pct is
unset:</p>
<ul>
<li>size is <code>{&quot;height&quot;: h, &quot;width&quot;: w}</code>: the image is resized to <code>(h, w)</code>.</li>
<li>size is <code>{&quot;shortest_edge&quot;: s}</code>: the shortest edge of the image is resized to s whilst maintaining the
aspect ratio.</li>
</ul>
<p>If crop_pct is set:</p>
<ul>
<li>size is <code>{&quot;height&quot;: h, &quot;width&quot;: w}</code>: the image is resized to <code>(int(floor(h/crop_pct)), int(floor(w/crop_pct)))</code></li>
<li>size is <code>{&quot;height&quot;: c, &quot;width&quot;: c}</code>: the shortest edge of the image is resized to <code>int(floor(c/crop_pct)</code>
whilst maintaining the aspect ratio.</li>
<li>size is <code>{&quot;shortest_edge&quot;: c}</code>: the shortest edge of the image is resized to <code>int(floor(c/crop_pct)</code>
whilst maintaining the aspect ratio.</li>
</ul>`,name:"size"},{anchor:"transformers.PoolFormerImageProcessor.crop_pct",description:`<strong>crop_pct</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.9</code>) &#x2014;
Percentage of the image to crop from the center. Can be overridden by <code>crop_pct</code> in the <code>preprocess</code>
method.`,name:"crop_pct"},{anchor:"transformers.PoolFormerImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.PoolFormerImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the image
is padded with 0&#x2019;s and then center cropped. Can be overridden by <code>do_center_crop</code> in the <code>preprocess</code>
method.`,name:"do_center_crop"},{anchor:"transformers.PoolFormerImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the image after applying center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>. Can
be overridden by the <code>crop_size</code> parameter in the <code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.PoolFormerImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.PoolFormerImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.PoolFormerImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Controls whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the
<code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.PoolFormerImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.PoolFormerImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/image_processing_poolformer.py#L53"}}),Ze=new ce({props:{name:"preprocess",anchor:"transformers.PoolFormerImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"crop_pct",val:": int = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PoolFormerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after applying resize.`,name:"size"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.crop_pct",description:`<strong>crop_pct</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.crop_pct</code>) &#x2014;
Percentage of the image to crop. Only has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"crop_pct"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the image after applying center crop.`,name:"crop_size"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/image_processing_poolformer.py#L268"}}),eo=new ke({}),oo=new ce({props:{name:"class transformers.PoolFormerModel",anchor:"transformers.PoolFormerModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PoolFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerConfig">PoolFormerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/modeling_poolformer.py#L313"}}),ao=new ce({props:{name:"forward",anchor:"transformers.PoolFormerModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PoolFormerModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">PoolFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/modeling_poolformer.py#L326",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerConfig"
>PoolFormerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new li({props:{$$slots:{default:[ui]},$$scope:{ctx:D}}}),$e=new $n({props:{anchor:"transformers.PoolFormerModel.forward.example",$$slots:{default:[_i]},$$scope:{ctx:D}}}),so=new ke({}),no=new ce({props:{name:"class transformers.PoolFormerForImageClassification",anchor:"transformers.PoolFormerForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PoolFormerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerConfig">PoolFormerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/modeling_poolformer.py#L380"}}),co=new ce({props:{name:"forward",anchor:"transformers.PoolFormerForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PoolFormerForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">PoolFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.PoolFormerForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/modeling_poolformer.py#L396",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerConfig"
>PoolFormerConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new li({props:{$$slots:{default:[vi]},$$scope:{ctx:D}}}),Ee=new $n({props:{anchor:"transformers.PoolFormerForImageClassification.forward.example",$$slots:{default:[Pi]},$$scope:{ctx:D}}}),{c(){h=r("meta"),T=c(),_=r("h1"),g=r("a"),v=r("span"),P(d.$$.fragment),u=c(),L=r("span"),zr=n("PoolFormer"),Ht=c(),X=r("h2"),me=r("a"),Zo=r("span"),P(Ae.$$.fragment),kr=c(),et=r("span"),Ar=n("Overview"),Bt=c(),de=r("p"),Mr=n("The PoolFormer model was proposed in "),Me=r("a"),jr=n("MetaFormer is Actually What You Need for Vision"),Dr=n("  by Sea AI Labs. Instead of designing complicated token mixer to achieve SOTA performance, the target of this work is to demonstrate the competence of transformer models largely stem from the general architecture MetaFormer."),Ut=c(),ho=r("p"),Nr=n("The abstract from the paper is the following:"),Wt=c(),go=r("p"),ot=r("em"),qr=n("Transformers have shown great potential in computer vision tasks. A common belief is their attention-based token mixer module contributes most to their competence. However, recent works show the attention-based module in transformers can be replaced by spatial MLPs and the resulted models still perform quite well. Based on this observation, we hypothesize that the general architecture of the transformers, instead of the specific token mixer module, is more essential to the model\u2019s performance. To verify this, we deliberately replace the attention module in transformers with an embarrassingly simple spatial pooling operator to conduct only the most basic token mixing. Surprisingly, we observe that the derived model, termed as PoolFormer, achieves competitive performance on multiple computer vision tasks. For example, on ImageNet-1K, PoolFormer achieves 82.1% top-1 accuracy, surpassing well-tuned vision transformer/MLP-like baselines DeiT-B/ResMLP-B24 by 0.3%/1.1% accuracy with 35%/52% fewer parameters and 48%/60% fewer MACs. The effectiveness of PoolFormer verifies our hypothesis and urges us to initiate the concept of \u201CMetaFormer\u201D, a general architecture abstracted from transformers without specifying the token mixer. Based on the extensive experiments, we argue that MetaFormer is the key player in achieving superior results for recent transformer and MLP-like models on vision tasks. This work calls for more future research dedicated to improving MetaFormer instead of focusing on the token mixer modules. Additionally, our proposed PoolFormer could serve as a starting baseline for future MetaFormer architecture design."),Vt=c(),fe=r("p"),Lr=n("The figure below illustrates the architecture of PoolFormer. Taken from the "),je=r("a"),Sr=n("original paper"),Rr=n("."),Gt=c(),De=r("img"),Yt=c(),uo=r("p"),Or=n("Tips:"),Jt=c(),O=r("ul"),Ne=r("li"),Hr=n("PoolFormer has a hierarchical architecture, where instead of Attention, a simple Average Pooling layer is present. All checkpoints of the model can be found on the "),qe=r("a"),Br=n("hub"),Ur=n("."),Wr=c(),Le=r("li"),Vr=n("One can use "),_o=r("a"),Gr=n("PoolFormerImageProcessor"),Yr=n(" to prepare images for the model."),Jr=c(),tt=r("li"),Kr=n("As most models, PoolFormer comes in different sizes, the details of which can be found in the table below."),Kt=c(),pe=r("table"),rt=r("thead"),E=r("tr"),vo=r("th"),at=r("strong"),Xr=n("Model variant"),Qr=c(),st=r("th"),nt=r("strong"),Zr=n("Depths"),ea=c(),lt=r("th"),it=r("strong"),oa=n("Hidden sizes"),ta=c(),Po=r("th"),ct=r("strong"),ra=n("Params (M)"),aa=c(),bo=r("th"),mt=r("strong"),sa=n("ImageNet-1k Top 1"),na=c(),I=r("tbody"),x=r("tr"),wo=r("td"),la=n("s12"),ia=c(),dt=r("td"),ca=n("[2, 2, 6, 2]"),ma=c(),ft=r("td"),da=n("[64, 128, 320, 512]"),fa=c(),Fo=r("td"),pa=n("12"),ha=c(),$o=r("td"),ga=n("77.2"),ua=c(),C=r("tr"),yo=r("td"),_a=n("s24"),va=c(),pt=r("td"),Pa=n("[4, 4, 12, 4]"),ba=c(),ht=r("td"),wa=n("[64, 128, 320, 512]"),Fa=c(),To=r("td"),$a=n("21"),ya=c(),Eo=r("td"),Ta=n("80.3"),Ea=c(),z=r("tr"),Io=r("td"),Ia=n("s36"),xa=c(),gt=r("td"),Ca=n("[6, 6, 18, 6]"),za=c(),ut=r("td"),ka=n("[64, 128, 320, 512]"),Aa=c(),xo=r("td"),Ma=n("31"),ja=c(),Co=r("td"),Da=n("81.4"),Na=c(),k=r("tr"),zo=r("td"),qa=n("m36"),La=c(),_t=r("td"),Sa=n("[6, 6, 18, 6]"),Ra=c(),vt=r("td"),Oa=n("[96, 192, 384, 768]"),Ha=c(),ko=r("td"),Ba=n("56"),Ua=c(),Ao=r("td"),Wa=n("82.1"),Va=c(),A=r("tr"),Mo=r("td"),Ga=n("m48"),Ya=c(),Pt=r("td"),Ja=n("[8, 8, 24, 8]"),Ka=c(),bt=r("td"),Xa=n("[96, 192, 384, 768]"),Qa=c(),jo=r("td"),Za=n("73"),es=c(),Do=r("td"),os=n("82.5"),Xt=c(),H=r("p"),ts=n("This model was contributed by "),Se=r("a"),rs=n("heytanay"),as=n(". The original code can be found "),Re=r("a"),ss=n("here"),ns=n("."),Qt=c(),Q=r("h2"),he=r("a"),wt=r("span"),P(Oe.$$.fragment),ls=c(),Ft=r("span"),is=n("Resources"),Zt=c(),No=r("p"),cs=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with PoolFormer."),er=c(),P(He.$$.fragment),or=c(),qo=r("ul"),B=r("li"),Lo=r("a"),ms=n("PoolFormerForImageClassification"),ds=n(" is supported by this "),Be=r("a"),fs=n("example script"),ps=n(" and "),Ue=r("a"),hs=n("notebook"),gs=n("."),tr=c(),So=r("p"),us=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),rr=c(),Z=r("h2"),ge=r("a"),$t=r("span"),P(We.$$.fragment),_s=c(),yt=r("span"),vs=n("PoolFormerConfig"),ar=c(),M=r("div"),P(Ve.$$.fragment),Ps=c(),ee=r("p"),bs=n("This is the configuration class to store the configuration of "),Ro=r("a"),ws=n("PoolFormerModel"),Fs=n(`. It is used to instantiate a
PoolFormer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the PoolFormer
`),Ge=r("a"),$s=n("sail/poolformer_s12"),ys=n(" architecture."),Ts=c(),oe=r("p"),Es=n("Configuration objects inherit from "),Oo=r("a"),Is=n("PretrainedConfig"),xs=n(` and can be used to control the model outputs. Read the
documentation from `),Ho=r("a"),Cs=n("PretrainedConfig"),zs=n(" for more information."),ks=c(),P(ue.$$.fragment),sr=c(),te=r("h2"),_e=r("a"),Tt=r("span"),P(Ye.$$.fragment),As=c(),Et=r("span"),Ms=n("PoolFormerFeatureExtractor"),nr=c(),re=r("div"),P(Je.$$.fragment),js=c(),ve=r("div"),P(Ke.$$.fragment),Ds=c(),It=r("p"),Ns=n("Preprocess an image or a batch of images."),lr=c(),ae=r("h2"),Pe=r("a"),xt=r("span"),P(Xe.$$.fragment),qs=c(),Ct=r("span"),Ls=n("PoolFormerImageProcessor"),ir=c(),S=r("div"),P(Qe.$$.fragment),Ss=c(),zt=r("p"),Rs=n("Constructs a PoolFormer image processor."),Os=c(),be=r("div"),P(Ze.$$.fragment),Hs=c(),kt=r("p"),Bs=n("Preprocess an image or batch of images."),cr=c(),se=r("h2"),we=r("a"),At=r("span"),P(eo.$$.fragment),Us=c(),Mt=r("span"),Ws=n("PoolFormerModel"),mr=c(),R=r("div"),P(oo.$$.fragment),Vs=c(),to=r("p"),Gs=n(`The bare PoolFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ro=r("a"),Ys=n("torch.nn.Module"),Js=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ks=c(),N=r("div"),P(ao.$$.fragment),Xs=c(),ne=r("p"),Qs=n("The "),Bo=r("a"),Zs=n("PoolFormerModel"),en=n(" forward method, overrides the "),jt=r("code"),on=n("__call__"),tn=n(" special method."),rn=c(),P(Fe.$$.fragment),an=c(),P($e.$$.fragment),dr=c(),le=r("h2"),ye=r("a"),Dt=r("span"),P(so.$$.fragment),sn=c(),Nt=r("span"),nn=n("PoolFormerForImageClassification"),fr=c(),j=r("div"),P(no.$$.fragment),ln=c(),qt=r("p"),cn=n("PoolFormer Model transformer with an image classification head on top"),mn=c(),lo=r("p"),dn=n("This model is a PyTorch "),io=r("a"),fn=n("torch.nn.Module"),pn=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hn=c(),q=r("div"),P(co.$$.fragment),gn=c(),ie=r("p"),un=n("The "),Uo=r("a"),_n=n("PoolFormerForImageClassification"),vn=n(" forward method, overrides the "),Lt=r("code"),Pn=n("__call__"),bn=n(" special method."),wn=c(),P(Te.$$.fragment),Fn=c(),P(Ee.$$.fragment),this.h()},l(o){const f=di('[data-svelte="svelte-1phssyn"]',document.head);h=a(f,"META",{name:!0,content:!0}),f.forEach(t),T=m(o),_=a(o,"H1",{class:!0});var mo=s(_);g=a(mo,"A",{id:!0,class:!0,href:!0});var St=s(g);v=a(St,"SPAN",{});var Rt=s(v);b(d.$$.fragment,Rt),Rt.forEach(t),St.forEach(t),u=m(mo),L=a(mo,"SPAN",{});var Ot=s(L);zr=l(Ot,"PoolFormer"),Ot.forEach(t),mo.forEach(t),Ht=m(o),X=a(o,"H2",{class:!0});var fo=s(X);me=a(fo,"A",{id:!0,class:!0,href:!0});var In=s(me);Zo=a(In,"SPAN",{});var xn=s(Zo);b(Ae.$$.fragment,xn),xn.forEach(t),In.forEach(t),kr=m(fo),et=a(fo,"SPAN",{});var Cn=s(et);Ar=l(Cn,"Overview"),Cn.forEach(t),fo.forEach(t),Bt=m(o),de=a(o,"P",{});var hr=s(de);Mr=l(hr,"The PoolFormer model was proposed in "),Me=a(hr,"A",{href:!0,rel:!0});var zn=s(Me);jr=l(zn,"MetaFormer is Actually What You Need for Vision"),zn.forEach(t),Dr=l(hr,"  by Sea AI Labs. Instead of designing complicated token mixer to achieve SOTA performance, the target of this work is to demonstrate the competence of transformer models largely stem from the general architecture MetaFormer."),hr.forEach(t),Ut=m(o),ho=a(o,"P",{});var kn=s(ho);Nr=l(kn,"The abstract from the paper is the following:"),kn.forEach(t),Wt=m(o),go=a(o,"P",{});var An=s(go);ot=a(An,"EM",{});var Mn=s(ot);qr=l(Mn,"Transformers have shown great potential in computer vision tasks. A common belief is their attention-based token mixer module contributes most to their competence. However, recent works show the attention-based module in transformers can be replaced by spatial MLPs and the resulted models still perform quite well. Based on this observation, we hypothesize that the general architecture of the transformers, instead of the specific token mixer module, is more essential to the model\u2019s performance. To verify this, we deliberately replace the attention module in transformers with an embarrassingly simple spatial pooling operator to conduct only the most basic token mixing. Surprisingly, we observe that the derived model, termed as PoolFormer, achieves competitive performance on multiple computer vision tasks. For example, on ImageNet-1K, PoolFormer achieves 82.1% top-1 accuracy, surpassing well-tuned vision transformer/MLP-like baselines DeiT-B/ResMLP-B24 by 0.3%/1.1% accuracy with 35%/52% fewer parameters and 48%/60% fewer MACs. The effectiveness of PoolFormer verifies our hypothesis and urges us to initiate the concept of \u201CMetaFormer\u201D, a general architecture abstracted from transformers without specifying the token mixer. Based on the extensive experiments, we argue that MetaFormer is the key player in achieving superior results for recent transformer and MLP-like models on vision tasks. This work calls for more future research dedicated to improving MetaFormer instead of focusing on the token mixer modules. Additionally, our proposed PoolFormer could serve as a starting baseline for future MetaFormer architecture design."),Mn.forEach(t),An.forEach(t),Vt=m(o),fe=a(o,"P",{});var gr=s(fe);Lr=l(gr,"The figure below illustrates the architecture of PoolFormer. Taken from the "),je=a(gr,"A",{href:!0,rel:!0});var jn=s(je);Sr=l(jn,"original paper"),jn.forEach(t),Rr=l(gr,"."),gr.forEach(t),Gt=m(o),De=a(o,"IMG",{width:!0,src:!0}),Yt=m(o),uo=a(o,"P",{});var Dn=s(uo);Or=l(Dn,"Tips:"),Dn.forEach(t),Jt=m(o),O=a(o,"UL",{});var Wo=s(O);Ne=a(Wo,"LI",{});var ur=s(Ne);Hr=l(ur,"PoolFormer has a hierarchical architecture, where instead of Attention, a simple Average Pooling layer is present. All checkpoints of the model can be found on the "),qe=a(ur,"A",{href:!0,rel:!0});var Nn=s(qe);Br=l(Nn,"hub"),Nn.forEach(t),Ur=l(ur,"."),ur.forEach(t),Wr=m(Wo),Le=a(Wo,"LI",{});var _r=s(Le);Vr=l(_r,"One can use "),_o=a(_r,"A",{href:!0});var qn=s(_o);Gr=l(qn,"PoolFormerImageProcessor"),qn.forEach(t),Yr=l(_r," to prepare images for the model."),_r.forEach(t),Jr=m(Wo),tt=a(Wo,"LI",{});var Ln=s(tt);Kr=l(Ln,"As most models, PoolFormer comes in different sizes, the details of which can be found in the table below."),Ln.forEach(t),Wo.forEach(t),Kt=m(o),pe=a(o,"TABLE",{});var vr=s(pe);rt=a(vr,"THEAD",{});var Sn=s(rt);E=a(Sn,"TR",{});var U=s(E);vo=a(U,"TH",{align:!0});var Rn=s(vo);at=a(Rn,"STRONG",{});var On=s(at);Xr=l(On,"Model variant"),On.forEach(t),Rn.forEach(t),Qr=m(U),st=a(U,"TH",{});var Hn=s(st);nt=a(Hn,"STRONG",{});var Bn=s(nt);Zr=l(Bn,"Depths"),Bn.forEach(t),Hn.forEach(t),ea=m(U),lt=a(U,"TH",{});var Un=s(lt);it=a(Un,"STRONG",{});var Wn=s(it);oa=l(Wn,"Hidden sizes"),Wn.forEach(t),Un.forEach(t),ta=m(U),Po=a(U,"TH",{align:!0});var Vn=s(Po);ct=a(Vn,"STRONG",{});var Gn=s(ct);ra=l(Gn,"Params (M)"),Gn.forEach(t),Vn.forEach(t),aa=m(U),bo=a(U,"TH",{align:!0});var Yn=s(bo);mt=a(Yn,"STRONG",{});var Jn=s(mt);sa=l(Jn,"ImageNet-1k Top 1"),Jn.forEach(t),Yn.forEach(t),U.forEach(t),Sn.forEach(t),na=m(vr),I=a(vr,"TBODY",{});var W=s(I);x=a(W,"TR",{});var V=s(x);wo=a(V,"TD",{align:!0});var Kn=s(wo);la=l(Kn,"s12"),Kn.forEach(t),ia=m(V),dt=a(V,"TD",{});var Xn=s(dt);ca=l(Xn,"[2, 2, 6, 2]"),Xn.forEach(t),ma=m(V),ft=a(V,"TD",{});var Qn=s(ft);da=l(Qn,"[64, 128, 320, 512]"),Qn.forEach(t),fa=m(V),Fo=a(V,"TD",{align:!0});var Zn=s(Fo);pa=l(Zn,"12"),Zn.forEach(t),ha=m(V),$o=a(V,"TD",{align:!0});var el=s($o);ga=l(el,"77.2"),el.forEach(t),V.forEach(t),ua=m(W),C=a(W,"TR",{});var G=s(C);yo=a(G,"TD",{align:!0});var ol=s(yo);_a=l(ol,"s24"),ol.forEach(t),va=m(G),pt=a(G,"TD",{});var tl=s(pt);Pa=l(tl,"[4, 4, 12, 4]"),tl.forEach(t),ba=m(G),ht=a(G,"TD",{});var rl=s(ht);wa=l(rl,"[64, 128, 320, 512]"),rl.forEach(t),Fa=m(G),To=a(G,"TD",{align:!0});var al=s(To);$a=l(al,"21"),al.forEach(t),ya=m(G),Eo=a(G,"TD",{align:!0});var sl=s(Eo);Ta=l(sl,"80.3"),sl.forEach(t),G.forEach(t),Ea=m(W),z=a(W,"TR",{});var Y=s(z);Io=a(Y,"TD",{align:!0});var nl=s(Io);Ia=l(nl,"s36"),nl.forEach(t),xa=m(Y),gt=a(Y,"TD",{});var ll=s(gt);Ca=l(ll,"[6, 6, 18, 6]"),ll.forEach(t),za=m(Y),ut=a(Y,"TD",{});var il=s(ut);ka=l(il,"[64, 128, 320, 512]"),il.forEach(t),Aa=m(Y),xo=a(Y,"TD",{align:!0});var cl=s(xo);Ma=l(cl,"31"),cl.forEach(t),ja=m(Y),Co=a(Y,"TD",{align:!0});var ml=s(Co);Da=l(ml,"81.4"),ml.forEach(t),Y.forEach(t),Na=m(W),k=a(W,"TR",{});var J=s(k);zo=a(J,"TD",{align:!0});var dl=s(zo);qa=l(dl,"m36"),dl.forEach(t),La=m(J),_t=a(J,"TD",{});var fl=s(_t);Sa=l(fl,"[6, 6, 18, 6]"),fl.forEach(t),Ra=m(J),vt=a(J,"TD",{});var pl=s(vt);Oa=l(pl,"[96, 192, 384, 768]"),pl.forEach(t),Ha=m(J),ko=a(J,"TD",{align:!0});var hl=s(ko);Ba=l(hl,"56"),hl.forEach(t),Ua=m(J),Ao=a(J,"TD",{align:!0});var gl=s(Ao);Wa=l(gl,"82.1"),gl.forEach(t),J.forEach(t),Va=m(W),A=a(W,"TR",{});var K=s(A);Mo=a(K,"TD",{align:!0});var ul=s(Mo);Ga=l(ul,"m48"),ul.forEach(t),Ya=m(K),Pt=a(K,"TD",{});var _l=s(Pt);Ja=l(_l,"[8, 8, 24, 8]"),_l.forEach(t),Ka=m(K),bt=a(K,"TD",{});var vl=s(bt);Xa=l(vl,"[96, 192, 384, 768]"),vl.forEach(t),Qa=m(K),jo=a(K,"TD",{align:!0});var Pl=s(jo);Za=l(Pl,"73"),Pl.forEach(t),es=m(K),Do=a(K,"TD",{align:!0});var bl=s(Do);os=l(bl,"82.5"),bl.forEach(t),K.forEach(t),W.forEach(t),vr.forEach(t),Xt=m(o),H=a(o,"P",{});var Vo=s(H);ts=l(Vo,"This model was contributed by "),Se=a(Vo,"A",{href:!0,rel:!0});var wl=s(Se);rs=l(wl,"heytanay"),wl.forEach(t),as=l(Vo,". The original code can be found "),Re=a(Vo,"A",{href:!0,rel:!0});var Fl=s(Re);ss=l(Fl,"here"),Fl.forEach(t),ns=l(Vo,"."),Vo.forEach(t),Qt=m(o),Q=a(o,"H2",{class:!0});var Pr=s(Q);he=a(Pr,"A",{id:!0,class:!0,href:!0});var $l=s(he);wt=a($l,"SPAN",{});var yl=s(wt);b(Oe.$$.fragment,yl),yl.forEach(t),$l.forEach(t),ls=m(Pr),Ft=a(Pr,"SPAN",{});var Tl=s(Ft);is=l(Tl,"Resources"),Tl.forEach(t),Pr.forEach(t),Zt=m(o),No=a(o,"P",{});var El=s(No);cs=l(El,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with PoolFormer."),El.forEach(t),er=m(o),b(He.$$.fragment,o),or=m(o),qo=a(o,"UL",{});var Il=s(qo);B=a(Il,"LI",{});var po=s(B);Lo=a(po,"A",{href:!0});var xl=s(Lo);ms=l(xl,"PoolFormerForImageClassification"),xl.forEach(t),ds=l(po," is supported by this "),Be=a(po,"A",{href:!0,rel:!0});var Cl=s(Be);fs=l(Cl,"example script"),Cl.forEach(t),ps=l(po," and "),Ue=a(po,"A",{href:!0,rel:!0});var zl=s(Ue);hs=l(zl,"notebook"),zl.forEach(t),gs=l(po,"."),po.forEach(t),Il.forEach(t),tr=m(o),So=a(o,"P",{});var kl=s(So);us=l(kl,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),kl.forEach(t),rr=m(o),Z=a(o,"H2",{class:!0});var br=s(Z);ge=a(br,"A",{id:!0,class:!0,href:!0});var Al=s(ge);$t=a(Al,"SPAN",{});var Ml=s($t);b(We.$$.fragment,Ml),Ml.forEach(t),Al.forEach(t),_s=m(br),yt=a(br,"SPAN",{});var jl=s(yt);vs=l(jl,"PoolFormerConfig"),jl.forEach(t),br.forEach(t),ar=m(o),M=a(o,"DIV",{class:!0});var Ie=s(M);b(Ve.$$.fragment,Ie),Ps=m(Ie),ee=a(Ie,"P",{});var Go=s(ee);bs=l(Go,"This is the configuration class to store the configuration of "),Ro=a(Go,"A",{href:!0});var Dl=s(Ro);ws=l(Dl,"PoolFormerModel"),Dl.forEach(t),Fs=l(Go,`. It is used to instantiate a
PoolFormer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the PoolFormer
`),Ge=a(Go,"A",{href:!0,rel:!0});var Nl=s(Ge);$s=l(Nl,"sail/poolformer_s12"),Nl.forEach(t),ys=l(Go," architecture."),Go.forEach(t),Ts=m(Ie),oe=a(Ie,"P",{});var Yo=s(oe);Es=l(Yo,"Configuration objects inherit from "),Oo=a(Yo,"A",{href:!0});var ql=s(Oo);Is=l(ql,"PretrainedConfig"),ql.forEach(t),xs=l(Yo,` and can be used to control the model outputs. Read the
documentation from `),Ho=a(Yo,"A",{href:!0});var Ll=s(Ho);Cs=l(Ll,"PretrainedConfig"),Ll.forEach(t),zs=l(Yo," for more information."),Yo.forEach(t),ks=m(Ie),b(ue.$$.fragment,Ie),Ie.forEach(t),sr=m(o),te=a(o,"H2",{class:!0});var wr=s(te);_e=a(wr,"A",{id:!0,class:!0,href:!0});var Sl=s(_e);Tt=a(Sl,"SPAN",{});var Rl=s(Tt);b(Ye.$$.fragment,Rl),Rl.forEach(t),Sl.forEach(t),As=m(wr),Et=a(wr,"SPAN",{});var Ol=s(Et);Ms=l(Ol,"PoolFormerFeatureExtractor"),Ol.forEach(t),wr.forEach(t),nr=m(o),re=a(o,"DIV",{class:!0});var Fr=s(re);b(Je.$$.fragment,Fr),js=m(Fr),ve=a(Fr,"DIV",{class:!0});var $r=s(ve);b(Ke.$$.fragment,$r),Ds=m($r),It=a($r,"P",{});var Hl=s(It);Ns=l(Hl,"Preprocess an image or a batch of images."),Hl.forEach(t),$r.forEach(t),Fr.forEach(t),lr=m(o),ae=a(o,"H2",{class:!0});var yr=s(ae);Pe=a(yr,"A",{id:!0,class:!0,href:!0});var Bl=s(Pe);xt=a(Bl,"SPAN",{});var Ul=s(xt);b(Xe.$$.fragment,Ul),Ul.forEach(t),Bl.forEach(t),qs=m(yr),Ct=a(yr,"SPAN",{});var Wl=s(Ct);Ls=l(Wl,"PoolFormerImageProcessor"),Wl.forEach(t),yr.forEach(t),ir=m(o),S=a(o,"DIV",{class:!0});var Jo=s(S);b(Qe.$$.fragment,Jo),Ss=m(Jo),zt=a(Jo,"P",{});var Vl=s(zt);Rs=l(Vl,"Constructs a PoolFormer image processor."),Vl.forEach(t),Os=m(Jo),be=a(Jo,"DIV",{class:!0});var Tr=s(be);b(Ze.$$.fragment,Tr),Hs=m(Tr),kt=a(Tr,"P",{});var Gl=s(kt);Bs=l(Gl,"Preprocess an image or batch of images."),Gl.forEach(t),Tr.forEach(t),Jo.forEach(t),cr=m(o),se=a(o,"H2",{class:!0});var Er=s(se);we=a(Er,"A",{id:!0,class:!0,href:!0});var Yl=s(we);At=a(Yl,"SPAN",{});var Jl=s(At);b(eo.$$.fragment,Jl),Jl.forEach(t),Yl.forEach(t),Us=m(Er),Mt=a(Er,"SPAN",{});var Kl=s(Mt);Ws=l(Kl,"PoolFormerModel"),Kl.forEach(t),Er.forEach(t),mr=m(o),R=a(o,"DIV",{class:!0});var Ko=s(R);b(oo.$$.fragment,Ko),Vs=m(Ko),to=a(Ko,"P",{});var Ir=s(to);Gs=l(Ir,`The bare PoolFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ro=a(Ir,"A",{href:!0,rel:!0});var Xl=s(ro);Ys=l(Xl,"torch.nn.Module"),Xl.forEach(t),Js=l(Ir,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ir.forEach(t),Ks=m(Ko),N=a(Ko,"DIV",{class:!0});var xe=s(N);b(ao.$$.fragment,xe),Xs=m(xe),ne=a(xe,"P",{});var Xo=s(ne);Qs=l(Xo,"The "),Bo=a(Xo,"A",{href:!0});var Ql=s(Bo);Zs=l(Ql,"PoolFormerModel"),Ql.forEach(t),en=l(Xo," forward method, overrides the "),jt=a(Xo,"CODE",{});var Zl=s(jt);on=l(Zl,"__call__"),Zl.forEach(t),tn=l(Xo," special method."),Xo.forEach(t),rn=m(xe),b(Fe.$$.fragment,xe),an=m(xe),b($e.$$.fragment,xe),xe.forEach(t),Ko.forEach(t),dr=m(o),le=a(o,"H2",{class:!0});var xr=s(le);ye=a(xr,"A",{id:!0,class:!0,href:!0});var ei=s(ye);Dt=a(ei,"SPAN",{});var oi=s(Dt);b(so.$$.fragment,oi),oi.forEach(t),ei.forEach(t),sn=m(xr),Nt=a(xr,"SPAN",{});var ti=s(Nt);nn=l(ti,"PoolFormerForImageClassification"),ti.forEach(t),xr.forEach(t),fr=m(o),j=a(o,"DIV",{class:!0});var Ce=s(j);b(no.$$.fragment,Ce),ln=m(Ce),qt=a(Ce,"P",{});var ri=s(qt);cn=l(ri,"PoolFormer Model transformer with an image classification head on top"),ri.forEach(t),mn=m(Ce),lo=a(Ce,"P",{});var Cr=s(lo);dn=l(Cr,"This model is a PyTorch "),io=a(Cr,"A",{href:!0,rel:!0});var ai=s(io);fn=l(ai,"torch.nn.Module"),ai.forEach(t),pn=l(Cr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cr.forEach(t),hn=m(Ce),q=a(Ce,"DIV",{class:!0});var ze=s(q);b(co.$$.fragment,ze),gn=m(ze),ie=a(ze,"P",{});var Qo=s(ie);un=l(Qo,"The "),Uo=a(Qo,"A",{href:!0});var si=s(Uo);_n=l(si,"PoolFormerForImageClassification"),si.forEach(t),vn=l(Qo," forward method, overrides the "),Lt=a(Qo,"CODE",{});var ni=s(Lt);Pn=l(ni,"__call__"),ni.forEach(t),bn=l(Qo," special method."),Qo.forEach(t),wn=m(ze),b(Te.$$.fragment,ze),Fn=m(ze),b(Ee.$$.fragment,ze),ze.forEach(t),Ce.forEach(t),this.h()},h(){i(h,"name","hf:doc:metadata"),i(h,"content",JSON.stringify(wi)),i(g,"id","poolformer"),i(g,"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"),i(g,"href","#poolformer"),i(_,"class","relative group"),i(me,"id","overview"),i(me,"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"),i(me,"href","#overview"),i(X,"class","relative group"),i(Me,"href","https://arxiv.org/abs/2111.11418"),i(Me,"rel","nofollow"),i(je,"href","https://arxiv.org/abs/2111.11418"),i(je,"rel","nofollow"),i(De,"width","600"),fi(De.src,En="https://user-images.githubusercontent.com/15921929/142746124-1ab7635d-2536-4a0e-ad43-b4fe2c5a525d.png")||i(De,"src",En),i(qe,"href","https://huggingface.co/models?other=poolformer"),i(qe,"rel","nofollow"),i(_o,"href","/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerImageProcessor"),i(vo,"align","center"),i(Po,"align","center"),i(bo,"align","center"),i(wo,"align","center"),i(Fo,"align","center"),i($o,"align","center"),i(yo,"align","center"),i(To,"align","center"),i(Eo,"align","center"),i(Io,"align","center"),i(xo,"align","center"),i(Co,"align","center"),i(zo,"align","center"),i(ko,"align","center"),i(Ao,"align","center"),i(Mo,"align","center"),i(jo,"align","center"),i(Do,"align","center"),i(Se,"href","https://huggingface.co/heytanay"),i(Se,"rel","nofollow"),i(Re,"href","https://github.com/sail-sg/poolformer"),i(Re,"rel","nofollow"),i(he,"id","resources"),i(he,"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"),i(he,"href","#resources"),i(Q,"class","relative group"),i(Lo,"href","/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerForImageClassification"),i(Be,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),i(Be,"rel","nofollow"),i(Ue,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),i(Ue,"rel","nofollow"),i(ge,"id","transformers.PoolFormerConfig"),i(ge,"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"),i(ge,"href","#transformers.PoolFormerConfig"),i(Z,"class","relative group"),i(Ro,"href","/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerModel"),i(Ge,"href","https://huggingface.co/sail/poolformer_s12"),i(Ge,"rel","nofollow"),i(Oo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),i(Ho,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),i(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(_e,"id","transformers.PoolFormerFeatureExtractor"),i(_e,"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"),i(_e,"href","#transformers.PoolFormerFeatureExtractor"),i(te,"class","relative group"),i(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Pe,"id","transformers.PoolFormerImageProcessor"),i(Pe,"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"),i(Pe,"href","#transformers.PoolFormerImageProcessor"),i(ae,"class","relative group"),i(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(we,"id","transformers.PoolFormerModel"),i(we,"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"),i(we,"href","#transformers.PoolFormerModel"),i(se,"class","relative group"),i(ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(ro,"rel","nofollow"),i(Bo,"href","/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerModel"),i(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ye,"id","transformers.PoolFormerForImageClassification"),i(ye,"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"),i(ye,"href","#transformers.PoolFormerForImageClassification"),i(le,"class","relative group"),i(io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(io,"rel","nofollow"),i(Uo,"href","/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerForImageClassification"),i(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,f){e(document.head,h),p(o,T,f),p(o,_,f),e(_,g),e(g,v),w(d,v,null),e(_,u),e(_,L),e(L,zr),p(o,Ht,f),p(o,X,f),e(X,me),e(me,Zo),w(Ae,Zo,null),e(X,kr),e(X,et),e(et,Ar),p(o,Bt,f),p(o,de,f),e(de,Mr),e(de,Me),e(Me,jr),e(de,Dr),p(o,Ut,f),p(o,ho,f),e(ho,Nr),p(o,Wt,f),p(o,go,f),e(go,ot),e(ot,qr),p(o,Vt,f),p(o,fe,f),e(fe,Lr),e(fe,je),e(je,Sr),e(fe,Rr),p(o,Gt,f),p(o,De,f),p(o,Yt,f),p(o,uo,f),e(uo,Or),p(o,Jt,f),p(o,O,f),e(O,Ne),e(Ne,Hr),e(Ne,qe),e(qe,Br),e(Ne,Ur),e(O,Wr),e(O,Le),e(Le,Vr),e(Le,_o),e(_o,Gr),e(Le,Yr),e(O,Jr),e(O,tt),e(tt,Kr),p(o,Kt,f),p(o,pe,f),e(pe,rt),e(rt,E),e(E,vo),e(vo,at),e(at,Xr),e(E,Qr),e(E,st),e(st,nt),e(nt,Zr),e(E,ea),e(E,lt),e(lt,it),e(it,oa),e(E,ta),e(E,Po),e(Po,ct),e(ct,ra),e(E,aa),e(E,bo),e(bo,mt),e(mt,sa),e(pe,na),e(pe,I),e(I,x),e(x,wo),e(wo,la),e(x,ia),e(x,dt),e(dt,ca),e(x,ma),e(x,ft),e(ft,da),e(x,fa),e(x,Fo),e(Fo,pa),e(x,ha),e(x,$o),e($o,ga),e(I,ua),e(I,C),e(C,yo),e(yo,_a),e(C,va),e(C,pt),e(pt,Pa),e(C,ba),e(C,ht),e(ht,wa),e(C,Fa),e(C,To),e(To,$a),e(C,ya),e(C,Eo),e(Eo,Ta),e(I,Ea),e(I,z),e(z,Io),e(Io,Ia),e(z,xa),e(z,gt),e(gt,Ca),e(z,za),e(z,ut),e(ut,ka),e(z,Aa),e(z,xo),e(xo,Ma),e(z,ja),e(z,Co),e(Co,Da),e(I,Na),e(I,k),e(k,zo),e(zo,qa),e(k,La),e(k,_t),e(_t,Sa),e(k,Ra),e(k,vt),e(vt,Oa),e(k,Ha),e(k,ko),e(ko,Ba),e(k,Ua),e(k,Ao),e(Ao,Wa),e(I,Va),e(I,A),e(A,Mo),e(Mo,Ga),e(A,Ya),e(A,Pt),e(Pt,Ja),e(A,Ka),e(A,bt),e(bt,Xa),e(A,Qa),e(A,jo),e(jo,Za),e(A,es),e(A,Do),e(Do,os),p(o,Xt,f),p(o,H,f),e(H,ts),e(H,Se),e(Se,rs),e(H,as),e(H,Re),e(Re,ss),e(H,ns),p(o,Qt,f),p(o,Q,f),e(Q,he),e(he,wt),w(Oe,wt,null),e(Q,ls),e(Q,Ft),e(Ft,is),p(o,Zt,f),p(o,No,f),e(No,cs),p(o,er,f),w(He,o,f),p(o,or,f),p(o,qo,f),e(qo,B),e(B,Lo),e(Lo,ms),e(B,ds),e(B,Be),e(Be,fs),e(B,ps),e(B,Ue),e(Ue,hs),e(B,gs),p(o,tr,f),p(o,So,f),e(So,us),p(o,rr,f),p(o,Z,f),e(Z,ge),e(ge,$t),w(We,$t,null),e(Z,_s),e(Z,yt),e(yt,vs),p(o,ar,f),p(o,M,f),w(Ve,M,null),e(M,Ps),e(M,ee),e(ee,bs),e(ee,Ro),e(Ro,ws),e(ee,Fs),e(ee,Ge),e(Ge,$s),e(ee,ys),e(M,Ts),e(M,oe),e(oe,Es),e(oe,Oo),e(Oo,Is),e(oe,xs),e(oe,Ho),e(Ho,Cs),e(oe,zs),e(M,ks),w(ue,M,null),p(o,sr,f),p(o,te,f),e(te,_e),e(_e,Tt),w(Ye,Tt,null),e(te,As),e(te,Et),e(Et,Ms),p(o,nr,f),p(o,re,f),w(Je,re,null),e(re,js),e(re,ve),w(Ke,ve,null),e(ve,Ds),e(ve,It),e(It,Ns),p(o,lr,f),p(o,ae,f),e(ae,Pe),e(Pe,xt),w(Xe,xt,null),e(ae,qs),e(ae,Ct),e(Ct,Ls),p(o,ir,f),p(o,S,f),w(Qe,S,null),e(S,Ss),e(S,zt),e(zt,Rs),e(S,Os),e(S,be),w(Ze,be,null),e(be,Hs),e(be,kt),e(kt,Bs),p(o,cr,f),p(o,se,f),e(se,we),e(we,At),w(eo,At,null),e(se,Us),e(se,Mt),e(Mt,Ws),p(o,mr,f),p(o,R,f),w(oo,R,null),e(R,Vs),e(R,to),e(to,Gs),e(to,ro),e(ro,Ys),e(to,Js),e(R,Ks),e(R,N),w(ao,N,null),e(N,Xs),e(N,ne),e(ne,Qs),e(ne,Bo),e(Bo,Zs),e(ne,en),e(ne,jt),e(jt,on),e(ne,tn),e(N,rn),w(Fe,N,null),e(N,an),w($e,N,null),p(o,dr,f),p(o,le,f),e(le,ye),e(ye,Dt),w(so,Dt,null),e(le,sn),e(le,Nt),e(Nt,nn),p(o,fr,f),p(o,j,f),w(no,j,null),e(j,ln),e(j,qt),e(qt,cn),e(j,mn),e(j,lo),e(lo,dn),e(lo,io),e(io,fn),e(lo,pn),e(j,hn),e(j,q),w(co,q,null),e(q,gn),e(q,ie),e(ie,un),e(ie,Uo),e(Uo,_n),e(ie,vn),e(ie,Lt),e(Lt,Pn),e(ie,bn),e(q,wn),w(Te,q,null),e(q,Fn),w(Ee,q,null),pr=!0},p(o,[f]){const mo={};f&2&&(mo.$$scope={dirty:f,ctx:o}),ue.$set(mo);const St={};f&2&&(St.$$scope={dirty:f,ctx:o}),Fe.$set(St);const Rt={};f&2&&(Rt.$$scope={dirty:f,ctx:o}),$e.$set(Rt);const Ot={};f&2&&(Ot.$$scope={dirty:f,ctx:o}),Te.$set(Ot);const fo={};f&2&&(fo.$$scope={dirty:f,ctx:o}),Ee.$set(fo)},i(o){pr||(F(d.$$.fragment,o),F(Ae.$$.fragment,o),F(Oe.$$.fragment,o),F(He.$$.fragment,o),F(We.$$.fragment,o),F(Ve.$$.fragment,o),F(ue.$$.fragment,o),F(Ye.$$.fragment,o),F(Je.$$.fragment,o),F(Ke.$$.fragment,o),F(Xe.$$.fragment,o),F(Qe.$$.fragment,o),F(Ze.$$.fragment,o),F(eo.$$.fragment,o),F(oo.$$.fragment,o),F(ao.$$.fragment,o),F(Fe.$$.fragment,o),F($e.$$.fragment,o),F(so.$$.fragment,o),F(no.$$.fragment,o),F(co.$$.fragment,o),F(Te.$$.fragment,o),F(Ee.$$.fragment,o),pr=!0)},o(o){$(d.$$.fragment,o),$(Ae.$$.fragment,o),$(Oe.$$.fragment,o),$(He.$$.fragment,o),$(We.$$.fragment,o),$(Ve.$$.fragment,o),$(ue.$$.fragment,o),$(Ye.$$.fragment,o),$(Je.$$.fragment,o),$(Ke.$$.fragment,o),$(Xe.$$.fragment,o),$(Qe.$$.fragment,o),$(Ze.$$.fragment,o),$(eo.$$.fragment,o),$(oo.$$.fragment,o),$(ao.$$.fragment,o),$(Fe.$$.fragment,o),$($e.$$.fragment,o),$(so.$$.fragment,o),$(no.$$.fragment,o),$(co.$$.fragment,o),$(Te.$$.fragment,o),$(Ee.$$.fragment,o),pr=!1},d(o){t(h),o&&t(T),o&&t(_),y(d),o&&t(Ht),o&&t(X),y(Ae),o&&t(Bt),o&&t(de),o&&t(Ut),o&&t(ho),o&&t(Wt),o&&t(go),o&&t(Vt),o&&t(fe),o&&t(Gt),o&&t(De),o&&t(Yt),o&&t(uo),o&&t(Jt),o&&t(O),o&&t(Kt),o&&t(pe),o&&t(Xt),o&&t(H),o&&t(Qt),o&&t(Q),y(Oe),o&&t(Zt),o&&t(No),o&&t(er),y(He,o),o&&t(or),o&&t(qo),o&&t(tr),o&&t(So),o&&t(rr),o&&t(Z),y(We),o&&t(ar),o&&t(M),y(Ve),y(ue),o&&t(sr),o&&t(te),y(Ye),o&&t(nr),o&&t(re),y(Je),y(Ke),o&&t(lr),o&&t(ae),y(Xe),o&&t(ir),o&&t(S),y(Qe),y(Ze),o&&t(cr),o&&t(se),y(eo),o&&t(mr),o&&t(R),y(oo),y(ao),y(Fe),y($e),o&&t(dr),o&&t(le),y(so),o&&t(fr),o&&t(j),y(no),y(co),y(Te),y(Ee)}}}const wi={local:"poolformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.PoolFormerConfig",title:"PoolFormerConfig"},{local:"transformers.PoolFormerFeatureExtractor",title:"PoolFormerFeatureExtractor"},{local:"transformers.PoolFormerImageProcessor",title:"PoolFormerImageProcessor"},{local:"transformers.PoolFormerModel",title:"PoolFormerModel"},{local:"transformers.PoolFormerForImageClassification",title:"PoolFormerForImageClassification"}],title:"PoolFormer"};function Fi(D){return pi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zi extends ii{constructor(h){super();ci(this,h,Fi,bi,mi,{})}}export{zi as default,wi as metadata};
