import{s as Ko,f as et,o as ot,n as Ze}from"../chunks/scheduler.9bc65507.js";import{S as tt,i as rt,g as i,s,r as f,A as st,h as c,f as t,c as n,j,u as h,x as v,k as F,y as m,a as r,v as g,d as u,t as _,w as b}from"../chunks/index.707bf1b6.js";import{T as Oo}from"../chunks/Tip.c2ecdbf4.js";import{D as k}from"../chunks/Docstring.17db21ae.js";import{C as zo}from"../chunks/CodeBlock.54a9f38d.js";import{E as Io}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as nt}from"../chunks/PipelineTag.44585822.js";import{H as Z}from"../chunks/Heading.342b1fa6.js";function at(M){let a,$="Example:",d,p,y;return p=new zo({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),h(p.$$.fragment,l)},m(l,T){r(l,a,T),r(l,d,T),g(p,l,T),y=!0},p:Ze,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 lt(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:Ze,d(d){d&&t(a)}}}function it(M){let a,$="Example:",d,p,y;return p=new zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBvb2xGb3JtZXJNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc2FpbCUyRnBvb2xmb3JtZXJfczEyJTIyKSUwQW1vZGVsJTIwJTNEJTIwUG9vbEZvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzYWlsJTJGcG9vbGZvcm1lcl9zMTIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PoolFormerModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">512</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`,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),h(p.$$.fragment,l)},m(l,T){r(l,a,T),r(l,d,T),g(p,l,T),y=!0},p:Ze,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 ct(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:Ze,d(d){d&&t(a)}}}function mt(M){let a,$="Example:",d,p,y;return p=new zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBvb2xGb3JtZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzYWlsJTJGcG9vbGZvcm1lcl9zMTIlMjIpJTBBbW9kZWwlMjAlM0QlMjBQb29sRm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyc2FpbCUyRnBvb2xmb3JtZXJfczEyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PoolFormerForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`,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),h(p.$$.fragment,l)},m(l,T){r(l,a,T),r(l,d,T),g(p,l,T),y=!0},p:Ze,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 dt(M){let a,$,d,p,y,l,T,Ne,X,Jo='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.',Re,D,jo="The abstract from the paper is the following:",Be,A,Uo="<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>",Ee,Y,Wo='The figure below illustrates the architecture of PoolFormer. Taken from the <a href="https://arxiv.org/abs/2111.11418" rel="nofollow">original paper</a>.',Ge,Q,ko,He,O,Zo='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>.',Le,K,Ve,ee,No='<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/v4.39.1/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>',qe,oe,Ro='<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>',Se,te,Xe,re,Bo="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with PoolFormer.",De,se,Ae,ne,Eo='<li><a href="/docs/transformers/v4.39.1/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>',Ye,ae,Go="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.",Qe,le,Oe,w,ie,co,Pe,Ho=`This is the configuration class to store the configuration of <a href="/docs/transformers/v4.39.1/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.`,mo,Fe,Lo=`Configuration objects inherit from <a href="/docs/transformers/v4.39.1/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/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,po,N,Ke,ce,eo,U,me,fo,R,de,ho,Me,Vo="Preprocess an image or a batch of images.",oo,pe,to,I,fe,go,Ce,qo="Constructs a PoolFormer image processor.",uo,B,he,_o,xe,So="Preprocess an image or batch of images.",ro,ge,so,z,ue,bo,Ie,Xo=`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.`,vo,C,_e,yo,ze,Do='The <a href="/docs/transformers/v4.39.1/en/model_doc/poolformer#transformers.PoolFormerModel">PoolFormerModel</a> forward method, overrides the <code>__call__</code> special method.',$o,E,To,G,no,be,ao,P,ve,wo,Je,Ao="PoolFormer Model transformer with an image classification head on top",Po,je,Yo=`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.`,Fo,x,ye,Mo,Ue,Qo='The <a href="/docs/transformers/v4.39.1/en/model_doc/poolformer#transformers.PoolFormerForImageClassification">PoolFormerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Co,H,xo,L,lo,ke,io;return y=new Z({props:{title:"PoolFormer",local:"poolformer",headingTag:"h1"}}),T=new Z({props:{title:"Overview",local:"overview",headingTag:"h2"}}),K=new Z({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),te=new Z({props:{title:"Resources",local:"resources",headingTag:"h2"}}),se=new nt({props:{pipeline:"image-classification"}}),le=new Z({props:{title:"PoolFormerConfig",local:"transformers.PoolFormerConfig",headingTag:"h2"}}),ie=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/v4.39.1/src/transformers/models/poolformer/configuration_poolformer.py#L34"}}),N=new Io({props:{anchor:"transformers.PoolFormerConfig.example",$$slots:{default:[at]},$$scope:{ctx:M}}}),ce=new Z({props:{title:"PoolFormerFeatureExtractor",local:"transformers.PoolFormerFeatureExtractor",headingTag:"h2"}}),me=new k({props:{name:"class transformers.PoolFormerFeatureExtractor",anchor:"transformers.PoolFormerFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/poolformer/feature_extraction_poolformer.py#L26"}}),de=new k({props:{name:"__call__",anchor:"transformers.PoolFormerFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/image_processing_utils.py#L549"}}),pe=new Z({props:{title:"PoolFormerImageProcessor",local:"transformers.PoolFormerImageProcessor",headingTag:"h2"}}),fe=new k({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/v4.39.1/src/transformers/models/poolformer/image_processing_poolformer.py#L51"}}),he=new k({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/v4.39.1/src/transformers/models/poolformer/image_processing_poolformer.py#L230"}}),ge=new Z({props:{title:"PoolFormerModel",local:"transformers.PoolFormerModel",headingTag:"h2"}}),ue=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/v4.39.1/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/v4.39.1/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/v4.39.1/src/transformers/models/poolformer/modeling_poolformer.py#L304"}}),_e=new k({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/v4.39.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.39.1/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">PoolFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/poolformer/modeling_poolformer.py#L321",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/v4.39.1/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 Oo({props:{$$slots:{default:[lt]},$$scope:{ctx:M}}}),G=new Io({props:{anchor:"transformers.PoolFormerModel.forward.example",$$slots:{default:[it]},$$scope:{ctx:M}}}),be=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/v4.39.1/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/v4.39.1/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/v4.39.1/src/transformers/models/poolformer/modeling_poolformer.py#L369"}}),ye=new k({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/v4.39.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.39.1/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.39.1/src/transformers/models/poolformer/modeling_poolformer.py#L391",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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