import{s as ot,f as tt,o as rt,n as Ne}from"../chunks/scheduler.25b97de1.js";import{S as st,i as nt,g as i,s,r as f,A as at,h as c,f as t,c as n,j,u as g,x as v,k as F,y as m,a as r,v as h,d as u,t as _,w as b}from"../chunks/index.d9030fc9.js";import{T as et}from"../chunks/Tip.baa67368.js";import{D as Z}from"../chunks/Docstring.e257edda.js";import{C as jo}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Jo}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as lt}from"../chunks/PipelineTag.5f100392.js";import{H as k,E as it}from"../chunks/EditOnGithub.91d95064.js";function ct(M){let a,$="Example:",d,p,y;return p=new jo({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=$,d=s(),f(p.$$.fragment)},l(l){a=c(l,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=$),d=n(l),g(p.$$.fragment,l)},m(l,T){r(l,a,T),r(l,d,T),h(p,l,T),y=!0},p:Ne,i(l){y||(u(p.$$.fragment,l),y=!0)},o(l){_(p.$$.fragment,l),y=!1},d(l){l&&(t(a),t(d)),b(p,l)}}}function mt(M){let a,$=`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=$},l(d){a=c(d,"P",{"data-svelte-h":!0}),v(a)!=="svelte-fincs2"&&(a.innerHTML=$)},m(d,p){r(d,a,p)},p:Ne,d(d){d&&t(a)}}}function dt(M){let a,$="Example:",d,p,y;return p=new jo({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=$,d=s(),f(p.$$.fragment)},l(l){a=c(l,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=$),d=n(l),g(p.$$.fragment,l)},m(l,T){r(l,a,T),r(l,d,T),h(p,l,T),y=!0},p:Ne,i(l){y||(u(p.$$.fragment,l),y=!0)},o(l){_(p.$$.fragment,l),y=!1},d(l){l&&(t(a),t(d)),b(p,l)}}}function pt(M){let a,$=`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=$},l(d){a=c(d,"P",{"data-svelte-h":!0}),v(a)!=="svelte-fincs2"&&(a.innerHTML=$)},m(d,p){r(d,a,p)},p:Ne,d(d){d&&t(a)}}}function ft(M){let a,$="Example:",d,p,y;return p=new jo({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=$,d=s(),f(p.$$.fragment)},l(l){a=c(l,"P",{"data-svelte-h":!0}),v(a)!=="svelte-11lpom8"&&(a.textContent=$),d=n(l),g(p.$$.fragment,l)},m(l,T){r(l,a,T),r(l,d,T),h(p,l,T),y=!0},p:Ne,i(l){y||(u(p.$$.fragment,l),y=!0)},o(l){_(p.$$.fragment,l),y=!1},d(l){l&&(t(a),t(d)),b(p,l)}}}function gt(M){let a,$,d,p,y,l,T,Re,X,Uo='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.',Be,A,Wo="The abstract from the paper is the following:",Ee,D,Zo="<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>",Ge,Y,ko='The figure below illustrates the architecture of PoolFormer. Taken from the <a href="https://arxiv.org/abs/2111.11418" rel="nofollow">original paper</a>.',He,Q,No,Le,O,Ro='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>.',Ve,K,qe,ee,Bo='<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/pr_30079/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>',Se,oe,Eo='<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>',Xe,te,Ae,re,Go="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with PoolFormer.",De,se,Ye,ne,Ho='<li><a href="/docs/transformers/pr_30079/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>',Qe,ae,Lo="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.",Oe,le,Ke,w,ie,po,Fe,Vo=`This is the configuration class to store the configuration of <a href="/docs/transformers/pr_30079/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.`,fo,Me,qo=`Configuration objects inherit from <a href="/docs/transformers/pr_30079/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/pr_30079/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,go,N,eo,ce,oo,U,me,ho,R,de,uo,Ce,So="Preprocess an image or a batch of images.",to,pe,ro,I,fe,_o,xe,Xo="Constructs a PoolFormer image processor.",bo,B,ge,vo,Ie,Ao="Preprocess an image or batch of images.",so,he,no,z,ue,yo,ze,Do=`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.`,$o,C,_e,To,Je,Yo='The <a href="/docs/transformers/pr_30079/en/model_doc/poolformer#transformers.PoolFormerModel">PoolFormerModel</a> forward method, overrides the <code>__call__</code> special method.',wo,E,Po,G,ao,be,lo,P,ve,Fo,je,Qo="PoolFormer Model transformer with an image classification head on top",Mo,Ue,Oo=`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.`,Co,x,ye,xo,We,Ko='The <a href="/docs/transformers/pr_30079/en/model_doc/poolformer#transformers.PoolFormerForImageClassification">PoolFormerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Io,H,zo,L,io,$e,co,ke,mo;return y=new k({props:{title:"PoolFormer",local:"poolformer",headingTag:"h1"}}),T=new k({props:{title:"Overview",local:"overview",headingTag:"h2"}}),K=new k({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),te=new k({props:{title:"Resources",local:"resources",headingTag:"h2"}}),se=new lt({props:{pipeline:"image-classification"}}),le=new k({props:{title:"PoolFormerConfig",local:"transformers.PoolFormerConfig",headingTag:"h2"}}),ie=new Z({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/vr_30079/src/transformers/models/poolformer/configuration_poolformer.py#L30"}}),N=new Jo({props:{anchor:"transformers.PoolFormerConfig.example",$$slots:{default:[ct]},$$scope:{ctx:M}}}),ce=new k({props:{title:"PoolFormerFeatureExtractor",local:"transformers.PoolFormerFeatureExtractor",headingTag:"h2"}}),me=new Z({props:{name:"class transformers.PoolFormerFeatureExtractor",anchor:"transformers.PoolFormerFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30079/src/transformers/models/poolformer/feature_extraction_poolformer.py#L26"}}),de=new Z({props:{name:"__call__",anchor:"transformers.PoolFormerFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30079/src/transformers/image_processing_utils.py#L39"}}),pe=new k({props:{title:"PoolFormerImageProcessor",local:"transformers.PoolFormerImageProcessor",headingTag:"h2"}}),fe=new Z({props:{name:"class transformers.PoolFormerImageProcessor",anchor:"transformers.PoolFormerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Dict = 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:": Dict = None"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_rescale",val:": bool = True"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = 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/vr_30079/src/transformers/models/poolformer/image_processing_poolformer.py#L51"}}),ge=new Z({props:{name:"preprocess",anchor:"transformers.PoolFormerImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": bool = None"},{name:"size",val:": Dict = None"},{name:"crop_pct",val:": int = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],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/vr_30079/src/transformers/models/poolformer/image_processing_poolformer.py#L230"}}),he=new k({props:{title:"PoolFormerModel",local:"transformers.PoolFormerModel",headingTag:"h2"}}),ue=new Z({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/pr_30079/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/pr_30079/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/vr_30079/src/transformers/models/poolformer/modeling_poolformer.py#L299"}}),_e=new Z({props:{name:"forward",anchor:"transformers.PoolFormerModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30079/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_30079/en/model_doc/layoutlmv3#transformers.LayoutLMv3FeatureExtractor.__call__">PoolFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/vr_30079/src/transformers/models/poolformer/modeling_poolformer.py#L316",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/pr_30079/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>
`}}),E=new et({props:{$$slots:{default:[mt]},$$scope:{ctx:M}}}),G=new Jo({props:{anchor:"transformers.PoolFormerModel.forward.example",$$slots:{default:[dt]},$$scope:{ctx:M}}}),be=new k({props:{title:"PoolFormerForImageClassification",local:"transformers.PoolFormerForImageClassification",headingTag:"h2"}}),ve=new Z({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/pr_30079/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/pr_30079/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/vr_30079/src/transformers/models/poolformer/modeling_poolformer.py#L364"}}),ye=new Z({props:{name:"forward",anchor:"transformers.PoolFormerForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30079/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_30079/en/model_doc/layoutlmv3#transformers.LayoutLMv3FeatureExtractor.__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/vr_30079/src/transformers/models/poolformer/modeling_poolformer.py#L386",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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