import{s as st,A as nt,o as at,n as Re}from"../chunks/scheduler.01eeda35.js";import{S as lt,i as it,g as i,s,r as f,A as ct,h as c,f as t,c as n,j,u as g,x as y,k as w,y as m,a as r,v as h,d as u,t as _,w as b}from"../chunks/index.6dd51b66.js";import{T as rt}from"../chunks/Tip.de9bae2b.js";import{D as k}from"../chunks/Docstring.cb556860.js";import{C as Wo}from"../chunks/CodeBlock.19ec9b8c.js";import{E as Uo}from"../chunks/ExampleCodeBlock.69db56ad.js";import{P as mt}from"../chunks/PipelineTag.5efc345e.js";import{H as Z,E as dt}from"../chunks/index.58fe8f9d.js";function pt(M){let a,T="Example:",d,p,v;return p=new Wo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBvb2xGb3JtZXJDb25maWclMkMlMjBQb29sRm9ybWVyTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwUG9vbEZvcm1lciUyMHNhaWwlMkZwb29sZm9ybWVyX3MxMiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBQb29sRm9ybWVyQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMHNhaWwlMkZwb29sZm9ybWVyX3MxMiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwUG9vbEZvcm1lck1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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`,wrap:!1}}),{c(){a=i("p"),a.textContent=T,d=s(),f(p.$$.fragment)},l(l){a=c(l,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=T),d=n(l),g(p.$$.fragment,l)},m(l,$){r(l,a,$),r(l,d,$),h(p,l,$),v=!0},p:Re,i(l){v||(u(p.$$.fragment,l),v=!0)},o(l){_(p.$$.fragment,l),v=!1},d(l){l&&(t(a),t(d)),b(p,l)}}}function ft(M){let a,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){a=i("p"),a.innerHTML=T},l(d){a=c(d,"P",{"data-svelte-h":!0}),y(a)!=="svelte-fincs2"&&(a.innerHTML=T)},m(d,p){r(d,a,p)},p:Re,d(d){d&&t(a)}}}function gt(M){let a,T="Example:",d,p,v;return p=new Wo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBvb2xGb3JtZXJNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc2FpbCUyRnBvb2xmb3JtZXJfczEyJTIyKSUwQW1vZGVsJTIwJTNEJTIwUG9vbEZvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzYWlsJTJGcG9vbGZvcm1lcl9zMTIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",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>, trust_remote_code=<span class="hljs-literal">True</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>]`,wrap:!1}}),{c(){a=i("p"),a.textContent=T,d=s(),f(p.$$.fragment)},l(l){a=c(l,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=T),d=n(l),g(p.$$.fragment,l)},m(l,$){r(l,a,$),r(l,d,$),h(p,l,$),v=!0},p:Re,i(l){v||(u(p.$$.fragment,l),v=!0)},o(l){_(p.$$.fragment,l),v=!1},d(l){l&&(t(a),t(d)),b(p,l)}}}function ht(M){let a,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){a=i("p"),a.innerHTML=T},l(d){a=c(d,"P",{"data-svelte-h":!0}),y(a)!=="svelte-fincs2"&&(a.innerHTML=T)},m(d,p){r(d,a,p)},p:Re,d(d){d&&t(a)}}}function ut(M){let a,T="Example:",d,p,v;return p=new Wo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBvb2xGb3JtZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzYWlsJTJGcG9vbGZvcm1lcl9zMTIlMjIpJTBBbW9kZWwlMjAlM0QlMjBQb29sRm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyc2FpbCUyRnBvb2xmb3JtZXJfczEyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",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>, trust_remote_code=<span class="hljs-literal">True</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`,wrap:!1}}),{c(){a=i("p"),a.textContent=T,d=s(),f(p.$$.fragment)},l(l){a=c(l,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=T),d=n(l),g(p.$$.fragment,l)},m(l,$){r(l,a,$),r(l,d,$),h(p,l,$),v=!0},p:Re,i(l){v||(u(p.$$.fragment,l),v=!0)},o(l){_(p.$$.fragment,l),v=!1},d(l){l&&(t(a),t(d)),b(p,l)}}}function _t(M){let a,T,d,p,v,l,$,ko='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',Ee,X,Be,D,Zo='The PoolFormer model was proposed in <a href="https://arxiv.org/abs/2111.11418" rel="nofollow">MetaFormer is Actually What You Need for Vision</a>  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.',Ge,A,No="The abstract from the paper is the following:",He,Y,Ro="<em>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’s 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 “MetaFormer”, 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.</em>",Le,Q,Eo='The figure below illustrates the architecture of PoolFormer. Taken from the <a href="https://arxiv.org/abs/2111.11418" rel="nofollow">original paper</a>.',Ve,O,Bo,qe,K,Go='This model was contributed by <a href="https://huggingface.co/heytanay" rel="nofollow">heytanay</a>. The original code can be found <a href="https://github.com/sail-sg/poolformer" rel="nofollow">here</a>.',Se,ee,Xe,oe,Ho='<li>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 <a href="https://huggingface.co/models?other=poolformer" rel="nofollow">hub</a>.</li> <li>One can use <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerImageProcessor">PoolFormerImageProcessor</a> to prepare images for the model.</li> <li>As most models, PoolFormer comes in different sizes, the details of which can be found in the table below.</li>',De,te,Lo='<thead><tr><th align="center"><strong>Model variant</strong></th> <th><strong>Depths</strong></th> <th><strong>Hidden sizes</strong></th> <th align="center"><strong>Params (M)</strong></th> <th align="center"><strong>ImageNet-1k Top 1</strong></th></tr></thead> <tbody><tr><td align="center">s12</td> <td>[2, 2, 6, 2]</td> <td>[64, 128, 320, 512]</td> <td align="center">12</td> <td align="center">77.2</td></tr> <tr><td align="center">s24</td> <td>[4, 4, 12, 4]</td> <td>[64, 128, 320, 512]</td> <td align="center">21</td> <td align="center">80.3</td></tr> <tr><td align="center">s36</td> <td>[6, 6, 18, 6]</td> <td>[64, 128, 320, 512]</td> <td align="center">31</td> <td align="center">81.4</td></tr> <tr><td align="center">m36</td> <td>[6, 6, 18, 6]</td> <td>[96, 192, 384, 768]</td> <td align="center">56</td> <td align="center">82.1</td></tr> <tr><td align="center">m48</td> <td>[8, 8, 24, 8]</td> <td>[96, 192, 384, 768]</td> <td align="center">73</td> <td align="center">82.5</td></tr></tbody>',Ae,re,Ye,se,Vo="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with PoolFormer.",Qe,ne,Oe,ae,qo='<li><a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerForImageClassification">PoolFormerForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',Ke,le,So="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",eo,ie,oo,P,ce,go,Me,Xo=`This is the configuration class to store the configuration of <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerModel">PoolFormerModel</a>. 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
<a href="https://huggingface.co/sail/poolformer_s12" rel="nofollow">sail/poolformer_s12</a> architecture.`,ho,Ce,Do=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,uo,N,to,me,ro,U,de,_o,R,pe,bo,xe,Ao="Preprocess an image or a batch of images.",so,fe,no,I,ge,yo,Ie,Yo="Constructs a PoolFormer image processor.",vo,E,he,$o,ze,Qo="Preprocess an image or batch of images.",ao,ue,lo,z,_e,To,Je,Oo=`The bare PoolFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,wo,C,be,Po,je,Ko='The <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerModel">PoolFormerModel</a> forward method, overrides the <code>__call__</code> special method.',Fo,B,Mo,G,io,ye,co,F,ve,Co,Ue,et="PoolFormer Model transformer with an image classification head on top",xo,We,ot=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Io,x,$e,zo,ke,tt='The <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerForImageClassification">PoolFormerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Jo,H,jo,L,mo,Te,po,Ne,fo;return v=new Z({props:{title:"PoolFormer",local:"poolformer",headingTag:"h1"}}),X=new Z({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ee=new Z({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),re=new Z({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ne=new mt({props:{pipeline:"image-classification"}}),ie=new Z({props:{title:"PoolFormerConfig",local:"transformers.PoolFormerConfig",headingTag:"h2"}}),ce=new k({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-05) &#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#L30"}}),N=new Uo({props:{anchor:"transformers.PoolFormerConfig.example",$$slots:{default:[pt]},$$scope:{ctx:M}}}),me=new Z({props:{title:"PoolFormerFeatureExtractor",local:"transformers.PoolFormerFeatureExtractor",headingTag:"h2"}}),de=new k({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"}}),pe=new k({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#L40"}}),fe=new Z({props:{title:"PoolFormerImageProcessor",local:"transformers.PoolFormerImageProcessor",headingTag:"h2"}}),ge=new k({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 0.9) &#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>Resampling.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.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_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.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#L50"}}),he=new k({props:{name:"preprocess",anchor:"transformers.PoolFormerImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"crop_pct",val:": typing.Optional[int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[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[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"}],parametersDescription:[{anchor:"transformers.PoolFormerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,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"},{anchor:"transformers.PoolFormerImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/poolformer/image_processing_poolformer.py#L212"}}),ue=new Z({props:{title:"PoolFormerModel",local:"transformers.PoolFormerModel",headingTag:"h2"}}),_e=new k({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#L303"}}),be=new k({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/vilt#transformers.ViltFeatureExtractor.__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#L320",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.BaseModelOutputWithNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),B=new rt({props:{$$slots:{default:[ft]},$$scope:{ctx:M}}}),G=new Uo({props:{anchor:"transformers.PoolFormerModel.forward.example",$$slots:{default:[gt]},$$scope:{ctx:M}}}),ye=new Z({props:{title:"PoolFormerForImageClassification",local:"transformers.PoolFormerForImageClassification",headingTag:"h2"}}),ve=new k({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#L368"}}),$e=new k({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/vilt#transformers.ViltFeatureExtractor.__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#L390",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<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>
`}}),H=new rt({props:{$$slots:{default:[ht]},$$scope:{ctx:M}}}),L=new Uo({props:{anchor:"transformers.PoolFormerForImageClassification.forward.example",$$slots:{default:[ut]},$$scope:{ctx:M}}}),Te=new dt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/poolformer.md"}}),{c(){a=i("meta"),T=s(),d=i("p"),p=s(),f(v.$$.fragment),l=s(),$=i("div"),$.innerHTML=ko,Ee=s(),f(X.$$.fragment),Be=s(),D=i("p"),D.innerHTML=Zo,Ge=s(),A=i("p"),A.textContent=No,He=s(),Y=i("p"),Y.innerHTML=Ro,Le=s(),Q=i("p"),Q.innerHTML=Eo,Ve=s(),O=i("img"),qe=s(),K=i("p"),K.innerHTML=Go,Se=s(),f(ee.$$.fragment),Xe=s(),oe=i("ul"),oe.innerHTML=Ho,De=s(),te=i("table"),te.innerHTML=Lo,Ae=s(),f(re.$$.fragment),Ye=s(),se=i("p"),se.textContent=Vo,Qe=s(),f(ne.$$.fragment),Oe=s(),ae=i("ul"),ae.innerHTML=qo,Ke=s(),le=i("p"),le.textContent=So,eo=s(),f(ie.$$.fragment),oo=s(),P=i("div"),f(ce.$$.fragment),go=s(),Me=i("p"),Me.innerHTML=Xo,ho=s(),Ce=i("p"),Ce.innerHTML=Do,uo=s(),f(N.$$.fragment),to=s(),f(me.$$.fragment),ro=s(),U=i("div"),f(de.$$.fragment),_o=s(),R=i("div"),f(pe.$$.fragment),bo=s(),xe=i("p"),xe.textContent=Ao,so=s(),f(fe.$$.fragment),no=s(),I=i("div"),f(ge.$$.fragment),yo=s(),Ie=i("p"),Ie.textContent=Yo,vo=s(),E=i("div"),f(he.$$.fragment),$o=s(),ze=i("p"),ze.textContent=Qo,ao=s(),f(ue.$$.fragment),lo=s(),z=i("div"),f(_e.$$.fragment),To=s(),Je=i("p"),Je.innerHTML=Oo,wo=s(),C=i("div"),f(be.$$.fragment),Po=s(),je=i("p"),je.innerHTML=Ko,Fo=s(),f(B.$$.fragment),Mo=s(),f(G.$$.fragment),io=s(),f(ye.$$.fragment),co=s(),F=i("div"),f(ve.$$.fragment),Co=s(),Ue=i("p"),Ue.textContent=et,xo=s(),We=i("p"),We.innerHTML=ot,Io=s(),x=i("div"),f($e.$$.fragment),zo=s(),ke=i("p"),ke.innerHTML=tt,Jo=s(),f(H.$$.fragment),jo=s(),f(L.$$.fragment),mo=s(),f(Te.$$.fragment),po=s(),Ne=i("p"),this.h()},l(e){const o=ct("svelte-u9bgzb",document.head);a=c(o,"META",{name:!0,content:!0}),o.forEach(t),T=n(e),d=c(e,"P",{}),j(d).forEach(t),p=n(e),g(v.$$.fragment,e),l=n(e),$=c(e,"DIV",{class:!0,"data-svelte-h":!0}),y($)!=="svelte-13t8s2t"&&($.innerHTML=ko),Ee=n(e),g(X.$$.fragment,e),Be=n(e),D=c(e,"P",{"data-svelte-h":!0}),y(D)!=="svelte-uoy3hb"&&(D.innerHTML=Zo),Ge=n(e),A=c(e,"P",{"data-svelte-h":!0}),y(A)!=="svelte-vfdo9a"&&(A.textContent=No),He=n(e),Y=c(e,"P",{"data-svelte-h":!0}),y(Y)!=="svelte-11momc2"&&(Y.innerHTML=Ro),Le=n(e),Q=c(e,"P",{"data-svelte-h":!0}),y(Q)!=="svelte-dr24j9"&&(Q.innerHTML=Eo),Ve=n(e),O=c(e,"IMG",{width:!0,src:!0}),qe=n(e),K=c(e,"P",{"data-svelte-h":!0}),y(K)!=="svelte-1vh5cee"&&(K.innerHTML=Go),Se=n(e),g(ee.$$.fragment,e),Xe=n(e),oe=c(e,"UL",{"data-svelte-h":!0}),y(oe)!=="svelte-18bbxi8"&&(oe.innerHTML=Ho),De=n(e),te=c(e,"TABLE",{"data-svelte-h":!0}),y(te)!=="svelte-ohzfem"&&(te.innerHTML=Lo),Ae=n(e),g(re.$$.fragment,e),Ye=n(e),se=c(e,"P",{"data-svelte-h":!0}),y(se)!=="svelte-1somjfw"&&(se.textContent=Vo),Qe=n(e),g(ne.$$.fragment,e),Oe=n(e),ae=c(e,"UL",{"data-svelte-h":!0}),y(ae)!=="svelte-1xz6k9i"&&(ae.innerHTML=qo),Ke=n(e),le=c(e,"P",{"data-svelte-h":!0}),y(le)!=="svelte-1xesile"&&(le.textContent=So),eo=n(e),g(ie.$$.fragment,e),oo=n(e),P=c(e,"DIV",{class:!0});var J=j(P);g(ce.$$.fragment,J),go=n(J),Me=c(J,"P",{"data-svelte-h":!0}),y(Me)!=="svelte-1qclv6b"&&(Me.innerHTML=Xo),ho=n(J),Ce=c(J,"P",{"data-svelte-h":!0}),y(Ce)!=="svelte-o55m63"&&(Ce.innerHTML=Do),uo=n(J),g(N.$$.fragment,J),J.forEach(t),to=n(e),g(me.$$.fragment,e),ro=n(e),U=c(e,"DIV",{class:!0});var we=j(U);g(de.$$.fragment,we),_o=n(we),R=c(we,"DIV",{class:!0});var Pe=j(R);g(pe.$$.fragment,Pe),bo=n(Pe),xe=c(Pe,"P",{"data-svelte-h":!0}),y(xe)!=="svelte-khengj"&&(xe.textContent=Ao),Pe.forEach(t),we.forEach(t),so=n(e),g(fe.$$.fragment,e),no=n(e),I=c(e,"DIV",{class:!0});var W=j(I);g(ge.$$.fragment,W),yo=n(W),Ie=c(W,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-dhy8rj"&&(Ie.textContent=Yo),vo=n(W),E=c(W,"DIV",{class:!0});var Fe=j(E);g(he.$$.fragment,Fe),$o=n(Fe),ze=c(Fe,"P",{"data-svelte-h":!0}),y(ze)!=="svelte-1x3yxsa"&&(ze.textContent=Qo),Fe.forEach(t),W.forEach(t),ao=n(e),g(ue.$$.fragment,e),lo=n(e),z=c(e,"DIV",{class:!0});var Ze=j(z);g(_e.$$.fragment,Ze),To=n(Ze),Je=c(Ze,"P",{"data-svelte-h":!0}),y(Je)!=="svelte-1bdtzc7"&&(Je.innerHTML=Oo),wo=n(Ze),C=c(Ze,"DIV",{class:!0});var V=j(C);g(be.$$.fragment,V),Po=n(V),je=c(V,"P",{"data-svelte-h":!0}),y(je)!=="svelte-171r792"&&(je.innerHTML=Ko),Fo=n(V),g(B.$$.fragment,V),Mo=n(V),g(G.$$.fragment,V),V.forEach(t),Ze.forEach(t),io=n(e),g(ye.$$.fragment,e),co=n(e),F=c(e,"DIV",{class:!0});var q=j(F);g(ve.$$.fragment,q),Co=n(q),Ue=c(q,"P",{"data-svelte-h":!0}),y(Ue)!=="svelte-7k9kh1"&&(Ue.textContent=et),xo=n(q),We=c(q,"P",{"data-svelte-h":!0}),y(We)!=="svelte-68lg8f"&&(We.innerHTML=ot),Io=n(q),x=c(q,"DIV",{class:!0});var S=j(x);g($e.$$.fragment,S),zo=n(S),ke=c(S,"P",{"data-svelte-h":!0}),y(ke)!=="svelte-xpee8k"&&(ke.innerHTML=tt),Jo=n(S),g(H.$$.fragment,S),jo=n(S),g(L.$$.fragment,S),S.forEach(t),q.forEach(t),mo=n(e),g(Te.$$.fragment,e),po=n(e),Ne=c(e,"P",{}),j(Ne).forEach(t),this.h()},h(){w(a,"name","hf:doc:metadata"),w(a,"content",bt),w($,"class","flex flex-wrap space-x-1"),w(O,"width","600"),nt(O.src,Bo="https://user-images.githubusercontent.com/15921929/142746124-1ab7635d-2536-4a0e-ad43-b4fe2c5a525d.png")||w(O,"src",Bo),w(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(F,"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,o){m(document.head,a),r(e,T,o),r(e,d,o),r(e,p,o),h(v,e,o),r(e,l,o),r(e,$,o),r(e,Ee,o),h(X,e,o),r(e,Be,o),r(e,D,o),r(e,Ge,o),r(e,A,o),r(e,He,o),r(e,Y,o),r(e,Le,o),r(e,Q,o),r(e,Ve,o),r(e,O,o),r(e,qe,o),r(e,K,o),r(e,Se,o),h(ee,e,o),r(e,Xe,o),r(e,oe,o),r(e,De,o),r(e,te,o),r(e,Ae,o),h(re,e,o),r(e,Ye,o),r(e,se,o),r(e,Qe,o),h(ne,e,o),r(e,Oe,o),r(e,ae,o),r(e,Ke,o),r(e,le,o),r(e,eo,o),h(ie,e,o),r(e,oo,o),r(e,P,o),h(ce,P,null),m(P,go),m(P,Me),m(P,ho),m(P,Ce),m(P,uo),h(N,P,null),r(e,to,o),h(me,e,o),r(e,ro,o),r(e,U,o),h(de,U,null),m(U,_o),m(U,R),h(pe,R,null),m(R,bo),m(R,xe),r(e,so,o),h(fe,e,o),r(e,no,o),r(e,I,o),h(ge,I,null),m(I,yo),m(I,Ie),m(I,vo),m(I,E),h(he,E,null),m(E,$o),m(E,ze),r(e,ao,o),h(ue,e,o),r(e,lo,o),r(e,z,o),h(_e,z,null),m(z,To),m(z,Je),m(z,wo),m(z,C),h(be,C,null),m(C,Po),m(C,je),m(C,Fo),h(B,C,null),m(C,Mo),h(G,C,null),r(e,io,o),h(ye,e,o),r(e,co,o),r(e,F,o),h(ve,F,null),m(F,Co),m(F,Ue),m(F,xo),m(F,We),m(F,Io),m(F,x),h($e,x,null),m(x,zo),m(x,ke),m(x,Jo),h(H,x,null),m(x,jo),h(L,x,null),r(e,mo,o),h(Te,e,o),r(e,po,o),r(e,Ne,o),fo=!0},p(e,[o]){const J={};o&2&&(J.$$scope={dirty:o,ctx:e}),N.$set(J);const we={};o&2&&(we.$$scope={dirty:o,ctx:e}),B.$set(we);const Pe={};o&2&&(Pe.$$scope={dirty:o,ctx:e}),G.$set(Pe);const W={};o&2&&(W.$$scope={dirty:o,ctx:e}),H.$set(W);const Fe={};o&2&&(Fe.$$scope={dirty:o,ctx:e}),L.$set(Fe)},i(e){fo||(u(v.$$.fragment,e),u(X.$$.fragment,e),u(ee.$$.fragment,e),u(re.$$.fragment,e),u(ne.$$.fragment,e),u(ie.$$.fragment,e),u(ce.$$.fragment,e),u(N.$$.fragment,e),u(me.$$.fragment,e),u(de.$$.fragment,e),u(pe.$$.fragment,e),u(fe.$$.fragment,e),u(ge.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(B.$$.fragment,e),u(G.$$.fragment,e),u(ye.$$.fragment,e),u(ve.$$.fragment,e),u($e.$$.fragment,e),u(H.$$.fragment,e),u(L.$$.fragment,e),u(Te.$$.fragment,e),fo=!0)},o(e){_(v.$$.fragment,e),_(X.$$.fragment,e),_(ee.$$.fragment,e),_(re.$$.fragment,e),_(ne.$$.fragment,e),_(ie.$$.fragment,e),_(ce.$$.fragment,e),_(N.$$.fragment,e),_(me.$$.fragment,e),_(de.$$.fragment,e),_(pe.$$.fragment,e),_(fe.$$.fragment,e),_(ge.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(be.$$.fragment,e),_(B.$$.fragment,e),_(G.$$.fragment,e),_(ye.$$.fragment,e),_(ve.$$.fragment,e),_($e.$$.fragment,e),_(H.$$.fragment,e),_(L.$$.fragment,e),_(Te.$$.fragment,e),fo=!1},d(e){e&&(t(T),t(d),t(p),t(l),t($),t(Ee),t(Be),t(D),t(Ge),t(A),t(He),t(Y),t(Le),t(Q),t(Ve),t(O),t(qe),t(K),t(Se),t(Xe),t(oe),t(De),t(te),t(Ae),t(Ye),t(se),t(Qe),t(Oe),t(ae),t(Ke),t(le),t(eo),t(oo),t(P),t(to),t(ro),t(U),t(so),t(no),t(I),t(ao),t(lo),t(z),t(io),t(co),t(F),t(mo),t(po),t(Ne)),t(a),b(v,e),b(X,e),b(ee,e),b(re,e),b(ne,e),b(ie,e),b(ce),b(N),b(me,e),b(de),b(pe),b(fe,e),b(ge),b(he),b(ue,e),b(_e),b(be),b(B),b(G),b(ye,e),b(ve),b($e),b(H),b(L),b(Te,e)}}}const bt='{"title":"PoolFormer","local":"poolformer","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"PoolFormerConfig","local":"transformers.PoolFormerConfig","sections":[],"depth":2},{"title":"PoolFormerFeatureExtractor","local":"transformers.PoolFormerFeatureExtractor","sections":[],"depth":2},{"title":"PoolFormerImageProcessor","local":"transformers.PoolFormerImageProcessor","sections":[],"depth":2},{"title":"PoolFormerModel","local":"transformers.PoolFormerModel","sections":[],"depth":2},{"title":"PoolFormerForImageClassification","local":"transformers.PoolFormerForImageClassification","sections":[],"depth":2}],"depth":1}';function yt(M){return at(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xt extends lt{constructor(a){super(),it(this,a,yt,_t,st,{})}}export{xt as component};
