import{s as on,o as nn,n as ae}from"../chunks/scheduler.9bc65507.js";import{S as sn,i as an,g as a,s as d,u as w,A as rn,h as r,f as t,c,j as f,v as _,y as u,k as h,o as i,a as l,w as b,d as y,t as M,x as T}from"../chunks/index.78c82d43.js";import{T as Rt}from"../chunks/Tip.87d55b76.js";import{D as Ze}from"../chunks/Docstring.f3d04bd2.js";import{C as Vt}from"../chunks/CodeBlock.48618ec2.js";import{I as Ne}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Pt}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as ln}from"../chunks/PipelineTag.75b0f707.js";function dn(C){let o,v="Example:",p,m,g;return m=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFN3aW52MkNvbmZpZyUyQyUyMFN3aW52Mk1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFN3aW52MiUyMG1pY3Jvc29mdCUyRnN3aW52Mi10aW55LXBhdGNoNC13aW5kb3c4LTI1NiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBTd2ludjJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbWljcm9zb2Z0JTJGc3dpbnYyLXRpbnktcGF0Y2g0LXdpbmRvdzgtMjU2JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTd2ludjJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Swinv2Config, Swinv2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Swinv2 microsoft/swinv2-tiny-patch4-window8-256 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Swinv2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/swinv2-tiny-patch4-window8-256 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2Model(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){o=a("p"),o.textContent=v,p=d(),w(m.$$.fragment)},l(s){o=r(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-11lpom8"&&(o.textContent=v),p=c(s),_(m.$$.fragment,s)},m(s,$){l(s,o,$),l(s,p,$),b(m,s,$),g=!0},p:ae,i(s){g||(y(m.$$.fragment,s),g=!0)},o(s){M(m.$$.fragment,s),g=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function cn(C){let o,v=`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(){o=a("p"),o.innerHTML=v},l(p){o=r(p,"P",{"data-svelte-h":!0}),u(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){l(p,o,m)},p:ae,d(p){p&&t(o)}}}function pn(C){let o,v="Example:",p,m,g;return m=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW52Mk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZzd2ludjItdGlueS1wYXRjaDQtd2luZG93OC0yNTYlMjIpJTBBbW9kZWwlMjAlM0QlMjBTd2ludjJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbnYyLXRpbnktcGF0Y2g0LXdpbmRvdzgtMjU2JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swinv2Model
<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;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2Model.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&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">64</span>, <span class="hljs-number">768</span>]`}}),{c(){o=a("p"),o.textContent=v,p=d(),w(m.$$.fragment)},l(s){o=r(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-11lpom8"&&(o.textContent=v),p=c(s),_(m.$$.fragment,s)},m(s,$){l(s,o,$),l(s,p,$),b(m,s,$),g=!0},p:ae,i(s){g||(y(m.$$.fragment,s),g=!0)},o(s){M(m.$$.fragment,s),g=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function mn(C){let o,v=`Note that we provide a script to pre-train this model on custom data in our <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining" rel="nofollow">examples
directory</a>.`;return{c(){o=a("p"),o.innerHTML=v},l(p){o=r(p,"P",{"data-svelte-h":!0}),u(o)!=="svelte-7i3y9o"&&(o.innerHTML=v)},m(p,m){l(p,o,m)},p:ae,d(p){p&&t(o)}}}function hn(C){let o,v=`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(){o=a("p"),o.innerHTML=v},l(p){o=r(p,"P",{"data-svelte-h":!0}),u(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){l(p,o,m)},p:ae,d(p){p&&t(o)}}}function un(C){let o,v="Examples:",p,m,g;return m=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW52MkZvck1hc2tlZEltYWdlTW9kZWxpbmclMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbnYyLXRpbnktcGF0Y2g0LXdpbmRvdzgtMjU2JTIyKSUwQW1vZGVsJTIwJTNEJTIwU3dpbnYyRm9yTWFza2VkSW1hZ2VNb2RlbGluZy5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbnYyLXRpbnktcGF0Y2g0LXdpbmRvdzgtMjU2JTIyKSUwQSUwQW51bV9wYXRjaGVzJTIwJTNEJTIwKG1vZGVsLmNvbmZpZy5pbWFnZV9zaXplJTIwJTJGJTJGJTIwbW9kZWwuY29uZmlnLnBhdGNoX3NpemUpJTIwKiolMjAyJTBBcGl4ZWxfdmFsdWVzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikucGl4ZWxfdmFsdWVzJTBBJTIzJTIwY3JlYXRlJTIwcmFuZG9tJTIwYm9vbGVhbiUyMG1hc2slMjBvZiUyMHNoYXBlJTIwKGJhdGNoX3NpemUlMkMlMjBudW1fcGF0Y2hlcyklMEFib29sX21hc2tlZF9wb3MlMjAlM0QlMjB0b3JjaC5yYW5kaW50KGxvdyUzRDAlMkMlMjBoaWdoJTNEMiUyQyUyMHNpemUlM0QoMSUyQyUyMG51bV9wYXRjaGVzKSkuYm9vbCgpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKHBpeGVsX3ZhbHVlcyUyQyUyMGJvb2xfbWFza2VkX3BvcyUzRGJvb2xfbWFza2VkX3BvcyklMEFsb3NzJTJDJTIwcmVjb25zdHJ1Y3RlZF9waXhlbF92YWx1ZXMlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMkMlMjBvdXRwdXRzLnJlY29uc3RydWN0aW9uJTBBbGlzdChyZWNvbnN0cnVjdGVkX3BpeGVsX3ZhbHVlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swinv2ForMaskedImageModeling
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2ForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create random boolean mask of shape (batch_size, num_patches)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = torch.randint(low=<span class="hljs-number">0</span>, high=<span class="hljs-number">2</span>, size=(<span class="hljs-number">1</span>, num_patches)).<span class="hljs-built_in">bool</span>()

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss, reconstructed_pixel_values = outputs.loss, outputs.reconstruction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(reconstructed_pixel_values.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">256</span>, <span class="hljs-number">256</span>]`}}),{c(){o=a("p"),o.textContent=v,p=d(),w(m.$$.fragment)},l(s){o=r(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-kvfsh7"&&(o.textContent=v),p=c(s),_(m.$$.fragment,s)},m(s,$){l(s,o,$),l(s,p,$),b(m,s,$),g=!0},p:ae,i(s){g||(y(m.$$.fragment,s),g=!0)},o(s){M(m.$$.fragment,s),g=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function fn(C){let o,v=`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(){o=a("p"),o.innerHTML=v},l(p){o=r(p,"P",{"data-svelte-h":!0}),u(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){l(p,o,m)},p:ae,d(p){p&&t(o)}}}function gn(C){let o,v="Example:",p,m,g;return m=new Vt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW52MkZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnN3aW52Mi10aW55LXBhdGNoNC13aW5kb3c4LTI1NiUyMiklMEFtb2RlbCUyMCUzRCUyMFN3aW52MkZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnN3aW52Mi10aW55LXBhdGNoNC13aW5kb3c4LTI1NiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swinv2ForImageClassification
<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;microsoft/swinv2-tiny-patch4-window8-256&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swinv2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/swinv2-tiny-patch4-window8-256&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])
Egyptian cat`}}),{c(){o=a("p"),o.textContent=v,p=d(),w(m.$$.fragment)},l(s){o=r(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-11lpom8"&&(o.textContent=v),p=c(s),_(m.$$.fragment,s)},m(s,$){l(s,o,$),l(s,p,$),b(m,s,$),g=!0},p:ae,i(s){g||(y(m.$$.fragment,s),g=!0)},o(s){M(m.$$.fragment,s),g=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function vn(C){let o,v,p,m,g,s,$,re,Et,ze,_o="Swin Transformer V2",ht,W,X,tt,ie,Yt,Be,bo="Overview",ut,le,yo='The Swin Transformer V2 model was proposed in <a href="https://arxiv.org/abs/2111.09883" rel="nofollow">Swin Transformer V2: Scaling Up Capacity and Resolution</a> by Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, Baining Guo.',ft,de,Mo="The abstract from the paper is the following:",gt,ce,To="<em>Large-scale NLP models have been shown to significantly improve the performance on language tasks with no signs of saturation. They also demonstrate amazing few-shot capabilities like that of human beings. This paper aims to explore large-scale models in computer vision. We tackle three major issues in training and application of large vision models, including training instability, resolution gaps between pre-training and fine-tuning, and hunger on labelled data. Three main techniques are proposed: 1) a residual-post-norm method combined with cosine attention to improve training stability; 2) A log-spaced continuous position bias method to effectively transfer models pre-trained using low-resolution images to downstream tasks with high-resolution inputs; 3) A self-supervised pre-training method, SimMIM, to reduce the needs of vast labeled images. Through these techniques, this paper successfully trained a 3 billion-parameter Swin Transformer V2 model, which is the largest dense vision model to date, and makes it capable of training with images of up to 1,536×1,536 resolution. It set new performance records on 4 representative vision tasks, including ImageNet-V2 image classification, COCO object detection, ADE20K semantic segmentation, and Kinetics-400 video action classification. Also note our training is much more efficient than that in Google’s billion-level visual models, which consumes 40 times less labelled data and 40 times less training time.</em>",vt,pe,$o="Tips:",wt,me,Co='<li>One can use the <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> API to prepare images for the model.</li>',_t,he,ko=`This model was contributed by <a href="https://huggingface.co/nandwalritik" rel="nofollow">nandwalritik</a>.
The original code can be found <a href="https://github.com/microsoft/Swin-Transformer" rel="nofollow">here</a>.`,bt,Z,R,ot,ue,Ht,Ge,So="Resources",yt,fe,jo="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Swin Transformer v2.",Mt,ge,Tt,ve,xo='<li><a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2ForImageClassification">Swinv2ForImageClassification</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>',$t,we,Fo="Besides that:",Ct,_e,Io='<li><a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2ForMaskedImageModeling">Swinv2ForMaskedImageModeling</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining" rel="nofollow">example script</a>.</li>',kt,be,Jo="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.",St,N,P,nt,ye,Lt,Xe,Uo="Swinv2Config",jt,S,Me,Qt,Re,Wo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2Model">Swinv2Model</a>. It is used to instantiate a Swin
Transformer v2 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 Swin Transformer v2
<a href="https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256" rel="nofollow">microsoft/swinv2-tiny-patch4-window8-256</a>
architecture.`,At,Pe,Zo=`Configuration objects inherit from <a href="/docs/transformers/v4.33.3/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.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,qt,V,xt,z,E,st,Te,Ot,Ve,No="Swinv2Model",Ft,J,$e,Dt,Ee,zo=`The bare Swinv2 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.`,Kt,x,Ce,eo,Ye,Bo='The <a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2Model">Swinv2Model</a> forward method, overrides the <code>__call__</code> special method.',to,Y,oo,H,It,B,L,at,ke,no,He,Go="Swinv2ForMaskedImageModeling",Jt,k,Se,so,Le,Xo=`Swinv2 Model with a decoder on top for masked image modeling, as proposed in
<a href="https://arxiv.org/abs/2111.09886" rel="nofollow">SimMIM</a>.`,ao,Q,ro,Qe,Ro=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,io,F,je,lo,Ae,Po='The <a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2ForMaskedImageModeling">Swinv2ForMaskedImageModeling</a> forward method, overrides the <code>__call__</code> special method.',co,A,po,q,Ut,G,O,rt,xe,mo,qe,Vo="Swinv2ForImageClassification",Wt,j,Fe,ho,Oe,Eo=`Swinv2 Model transformer with an image classification head on top (a linear layer on top of the final hidden state
of the [CLS] token) e.g. for ImageNet.`,uo,De,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,I,Ie,go,Ke,Ho='The <a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2ForImageClassification">Swinv2ForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',vo,D,wo,K,Zt,it,Nt;return re=new Ne({}),ie=new Ne({}),ue=new Ne({}),ge=new ln({props:{pipeline:"image-classification"}}),ye=new Ne({}),Me=new Ze({props:{name:"class transformers.Swinv2Config",anchor:"transformers.Swinv2Config",parameters:[{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 4"},{name:"num_channels",val:" = 3"},{name:"embed_dim",val:" = 96"},{name:"depths",val:" = [2, 2, 6, 2]"},{name:"num_heads",val:" = [3, 6, 12, 24]"},{name:"window_size",val:" = 7"},{name:"mlp_ratio",val:" = 4.0"},{name:"qkv_bias",val:" = True"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"drop_path_rate",val:" = 0.1"},{name:"hidden_act",val:" = 'gelu'"},{name:"use_absolute_embeddings",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"encoder_stride",val:" = 32"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Swinv2Config.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.Swinv2Config.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Swinv2Config.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.Swinv2Config.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 96) &#x2014;
Dimensionality of patch embedding.`,name:"embed_dim"},{anchor:"transformers.Swinv2Config.depths",description:`<strong>depths</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[2, 2, 6, 2]</code>) &#x2014;
Depth of each layer in the Transformer encoder.`,name:"depths"},{anchor:"transformers.Swinv2Config.num_heads",description:`<strong>num_heads</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[3, 6, 12, 24]</code>) &#x2014;
Number of attention heads in each layer of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.Swinv2Config.window_size",description:`<strong>window_size</strong> (<code>int</code>, <em>optional</em>, defaults to 7) &#x2014;
Size of windows.`,name:"window_size"},{anchor:"transformers.Swinv2Config.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Ratio of MLP hidden dimensionality to embedding dimensionality.`,name:"mlp_ratio"},{anchor:"transformers.Swinv2Config.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not a learnable bias should be added to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.Swinv2Config.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings and encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.Swinv2Config.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.Swinv2Config.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Stochastic depth rate.`,name:"drop_path_rate"},{anchor:"transformers.Swinv2Config.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Swinv2Config.use_absolute_embeddings",description:`<strong>use_absolute_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add absolute position embeddings to the patch embeddings.`,name:"use_absolute_embeddings"},{anchor:"transformers.Swinv2Config.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Swinv2Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Swinv2Config.encoder_stride",description:`<strong>encoder_stride</strong> (<code>int</code>, <code>optional</code>, defaults to 32) &#x2014;
Factor to increase the spatial resolution by in the decoder head for masked image modeling.`,name:"encoder_stride"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/swinv2/configuration_swinv2.py#L30"}}),V=new Pt({props:{anchor:"transformers.Swinv2Config.example",$$slots:{default:[dn]},$$scope:{ctx:C}}}),Te=new Ne({}),$e=new Ze({props:{name:"class transformers.Swinv2Model",anchor:"transformers.Swinv2Model",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"},{name:"use_mask_token",val:" = False"}],parametersDescription:[{anchor:"transformers.Swinv2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2Config">Swinv2Config</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.33.3/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.33.3/src/transformers/models/swinv2/modeling_swinv2.py#L1024"}}),Ce=new Ze({props:{name:"forward",anchor:"transformers.Swinv2Model.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Swinv2Model.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.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.3/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.Swinv2Model.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Swinv2Model.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Swinv2Model.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Swinv2Model.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Swinv2Model.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/swinv2/modeling_swinv2.py#L1051",returnDescription:`
<p>A <code>transformers.models.swinv2.modeling_swinv2.Swinv2ModelOutput</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.33.3/en/model_doc/swinv2#transformers.Swinv2Config"
>Swinv2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>, <em>optional</em>, returned when <code>add_pooling_layer=True</code> is passed) — Average pooling of the last layer hidden-state.</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 + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>reshaped_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 + one for the output of each stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.swinv2.modeling_swinv2.Swinv2ModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new Rt({props:{$$slots:{default:[cn]},$$scope:{ctx:C}}}),H=new Pt({props:{anchor:"transformers.Swinv2Model.forward.example",$$slots:{default:[pn]},$$scope:{ctx:C}}}),ke=new Ne({}),Se=new Ze({props:{name:"class transformers.Swinv2ForMaskedImageModeling",anchor:"transformers.Swinv2ForMaskedImageModeling",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Swinv2ForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2Config">Swinv2Config</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.33.3/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.33.3/src/transformers/models/swinv2/modeling_swinv2.py#L1135"}}),Q=new Rt({props:{$$slots:{default:[mn]},$$scope:{ctx:C}}}),je=new Ze({props:{name:"forward",anchor:"transformers.Swinv2ForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Swinv2ForMaskedImageModeling.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.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.3/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/swinv2/modeling_swinv2.py#L1152",returnDescription:`
<p>A <code>transformers.models.swinv2.modeling_swinv2.Swinv2MaskedImageModelingOutput</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.33.3/en/model_doc/swinv2#transformers.Swinv2Config"
>Swinv2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>bool_masked_pos</code> is provided) — Masked image modeling (MLM) loss.</p>
</li>
<li>
<p><strong>reconstruction</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — Reconstructed pixel values.</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 + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>reshaped_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 + one for the output of each stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.swinv2.modeling_swinv2.Swinv2MaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),A=new Rt({props:{$$slots:{default:[hn]},$$scope:{ctx:C}}}),q=new Pt({props:{anchor:"transformers.Swinv2ForMaskedImageModeling.forward.example",$$slots:{default:[un]},$$scope:{ctx:C}}}),xe=new Ne({}),Fe=new Ze({props:{name:"class transformers.Swinv2ForImageClassification",anchor:"transformers.Swinv2ForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Swinv2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/swinv2#transformers.Swinv2Config">Swinv2Config</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.33.3/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.33.3/src/transformers/models/swinv2/modeling_swinv2.py#L1247"}}),Ie=new Ze({props:{name:"forward",anchor:"transformers.Swinv2ForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Swinv2ForImageClassification.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.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.3/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.Swinv2ForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Swinv2ForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Swinv2ForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Swinv2ForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Swinv2ForImageClassification.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.33.3/src/transformers/models/swinv2/modeling_swinv2.py#L1262",returnDescription:`
<p>A <code>transformers.models.swinv2.modeling_swinv2.Swinv2ImageClassifierOutput</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.33.3/en/model_doc/swinv2#transformers.Swinv2Config"
>Swinv2Config</a>) and inputs.</p>
<ul>
<li>
<p><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.</p>
</li>
<li>
<p><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).</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 + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>reshaped_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 + one for the output of each stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.swinv2.modeling_swinv2.Swinv2ImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new Rt({props:{$$slots:{default:[fn]},$$scope:{ctx:C}}}),K=new Pt({props:{anchor:"transformers.Swinv2ForImageClassification.forward.example",$$slots:{default:[gn]},$$scope:{ctx:C}}}),{c(){o=a("meta"),v=d(),p=a("p"),m=d(),g=a("h1"),s=a("a"),$=a("span"),w(re.$$.fragment),Et=d(),ze=a("span"),ze.textContent=_o,ht=d(),W=a("h2"),X=a("a"),tt=a("span"),w(ie.$$.fragment),Yt=d(),Be=a("span"),Be.textContent=bo,ut=d(),le=a("p"),le.innerHTML=yo,ft=d(),de=a("p"),de.textContent=Mo,gt=d(),ce=a("p"),ce.innerHTML=To,vt=d(),pe=a("p"),pe.textContent=$o,wt=d(),me=a("ul"),me.innerHTML=Co,_t=d(),he=a("p"),he.innerHTML=ko,bt=d(),Z=a("h2"),R=a("a"),ot=a("span"),w(ue.$$.fragment),Ht=d(),Ge=a("span"),Ge.textContent=So,yt=d(),fe=a("p"),fe.textContent=jo,Mt=d(),w(ge.$$.fragment),Tt=d(),ve=a("ul"),ve.innerHTML=xo,$t=d(),we=a("p"),we.textContent=Fo,Ct=d(),_e=a("ul"),_e.innerHTML=Io,kt=d(),be=a("p"),be.textContent=Jo,St=d(),N=a("h2"),P=a("a"),nt=a("span"),w(ye.$$.fragment),Lt=d(),Xe=a("span"),Xe.textContent=Uo,jt=d(),S=a("div"),w(Me.$$.fragment),Qt=d(),Re=a("p"),Re.innerHTML=Wo,At=d(),Pe=a("p"),Pe.innerHTML=Zo,qt=d(),w(V.$$.fragment),xt=d(),z=a("h2"),E=a("a"),st=a("span"),w(Te.$$.fragment),Ot=d(),Ve=a("span"),Ve.textContent=No,Ft=d(),J=a("div"),w($e.$$.fragment),Dt=d(),Ee=a("p"),Ee.innerHTML=zo,Kt=d(),x=a("div"),w(Ce.$$.fragment),eo=d(),Ye=a("p"),Ye.innerHTML=Bo,to=d(),w(Y.$$.fragment),oo=d(),w(H.$$.fragment),It=d(),B=a("h2"),L=a("a"),at=a("span"),w(ke.$$.fragment),no=d(),He=a("span"),He.textContent=Go,Jt=d(),k=a("div"),w(Se.$$.fragment),so=d(),Le=a("p"),Le.innerHTML=Xo,ao=d(),w(Q.$$.fragment),ro=d(),Qe=a("p"),Qe.innerHTML=Ro,io=d(),F=a("div"),w(je.$$.fragment),lo=d(),Ae=a("p"),Ae.innerHTML=Po,co=d(),w(A.$$.fragment),po=d(),w(q.$$.fragment),Ut=d(),G=a("h2"),O=a("a"),rt=a("span"),w(xe.$$.fragment),mo=d(),qe=a("span"),qe.textContent=Vo,Wt=d(),j=a("div"),w(Fe.$$.fragment),ho=d(),Oe=a("p"),Oe.textContent=Eo,uo=d(),De=a("p"),De.innerHTML=Yo,fo=d(),I=a("div"),w(Ie.$$.fragment),go=d(),Ke=a("p"),Ke.innerHTML=Ho,vo=d(),w(D.$$.fragment),wo=d(),w(K.$$.fragment),Zt=d(),it=a("p"),this.h()},l(e){const n=rn("svelte-1phssyn",document.head);o=r(n,"META",{name:!0,content:!0}),n.forEach(t),v=c(e),p=r(e,"P",{}),f(p).forEach(t),m=c(e),g=r(e,"H1",{class:!0});var Je=f(g);s=r(Je,"A",{id:!0,class:!0,href:!0});var lt=f(s);$=r(lt,"SPAN",{});var dt=f($);_(re.$$.fragment,dt),dt.forEach(t),lt.forEach(t),Et=c(Je),ze=r(Je,"SPAN",{"data-svelte-h":!0}),u(ze)!=="svelte-1tnhl9p"&&(ze.textContent=_o),Je.forEach(t),ht=c(e),W=r(e,"H2",{class:!0});var Ue=f(W);X=r(Ue,"A",{id:!0,class:!0,href:!0});var ct=f(X);tt=r(ct,"SPAN",{});var pt=f(tt);_(ie.$$.fragment,pt),pt.forEach(t),ct.forEach(t),Yt=c(Ue),Be=r(Ue,"SPAN",{"data-svelte-h":!0}),u(Be)!=="svelte-1jsw1pg"&&(Be.textContent=bo),Ue.forEach(t),ut=c(e),le=r(e,"P",{"data-svelte-h":!0}),u(le)!=="svelte-vxlvb8"&&(le.innerHTML=yo),ft=c(e),de=r(e,"P",{"data-svelte-h":!0}),u(de)!=="svelte-vfdo9a"&&(de.textContent=Mo),gt=c(e),ce=r(e,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-11y9zge"&&(ce.innerHTML=To),vt=c(e),pe=r(e,"P",{"data-svelte-h":!0}),u(pe)!=="svelte-axv494"&&(pe.textContent=$o),wt=c(e),me=r(e,"UL",{"data-svelte-h":!0}),u(me)!=="svelte-i04w72"&&(me.innerHTML=Co),_t=c(e),he=r(e,"P",{"data-svelte-h":!0}),u(he)!=="svelte-1ifw3nq"&&(he.innerHTML=ko),bt=c(e),Z=r(e,"H2",{class:!0});var We=f(Z);R=r(We,"A",{id:!0,class:!0,href:!0});var mt=f(R);ot=r(mt,"SPAN",{});var Lo=f(ot);_(ue.$$.fragment,Lo),Lo.forEach(t),mt.forEach(t),Ht=c(We),Ge=r(We,"SPAN",{"data-svelte-h":!0}),u(Ge)!=="svelte-w4zzv6"&&(Ge.textContent=So),We.forEach(t),yt=c(e),fe=r(e,"P",{"data-svelte-h":!0}),u(fe)!=="svelte-1p7rh05"&&(fe.textContent=jo),Mt=c(e),_(ge.$$.fragment,e),Tt=c(e),ve=r(e,"UL",{"data-svelte-h":!0}),u(ve)!=="svelte-eg5wim"&&(ve.innerHTML=xo),$t=c(e),we=r(e,"P",{"data-svelte-h":!0}),u(we)!=="svelte-1k821ua"&&(we.textContent=Fo),Ct=c(e),_e=r(e,"UL",{"data-svelte-h":!0}),u(_e)!=="svelte-13k2vu0"&&(_e.innerHTML=Io),kt=c(e),be=r(e,"P",{"data-svelte-h":!0}),u(be)!=="svelte-1xesile"&&(be.textContent=Jo),St=c(e),N=r(e,"H2",{class:!0});var zt=f(N);P=r(zt,"A",{id:!0,class:!0,href:!0});var Qo=f(P);nt=r(Qo,"SPAN",{});var Ao=f(nt);_(ye.$$.fragment,Ao),Ao.forEach(t),Qo.forEach(t),Lt=c(zt),Xe=r(zt,"SPAN",{"data-svelte-h":!0}),u(Xe)!=="svelte-1ylugd0"&&(Xe.textContent=Uo),zt.forEach(t),jt=c(e),S=r(e,"DIV",{class:!0});var ee=f(S);_(Me.$$.fragment,ee),Qt=c(ee),Re=r(ee,"P",{"data-svelte-h":!0}),u(Re)!=="svelte-1yq9m2i"&&(Re.innerHTML=Wo),At=c(ee),Pe=r(ee,"P",{"data-svelte-h":!0}),u(Pe)!=="svelte-cfh5wl"&&(Pe.innerHTML=Zo),qt=c(ee),_(V.$$.fragment,ee),ee.forEach(t),xt=c(e),z=r(e,"H2",{class:!0});var Bt=f(z);E=r(Bt,"A",{id:!0,class:!0,href:!0});var qo=f(E);st=r(qo,"SPAN",{});var Oo=f(st);_(Te.$$.fragment,Oo),Oo.forEach(t),qo.forEach(t),Ot=c(Bt),Ve=r(Bt,"SPAN",{"data-svelte-h":!0}),u(Ve)!=="svelte-sis1wl"&&(Ve.textContent=No),Bt.forEach(t),Ft=c(e),J=r(e,"DIV",{class:!0});var et=f(J);_($e.$$.fragment,et),Dt=c(et),Ee=r(et,"P",{"data-svelte-h":!0}),u(Ee)!=="svelte-24f4e1"&&(Ee.innerHTML=zo),Kt=c(et),x=r(et,"DIV",{class:!0});var te=f(x);_(Ce.$$.fragment,te),eo=c(te),Ye=r(te,"P",{"data-svelte-h":!0}),u(Ye)!=="svelte-25vlac"&&(Ye.innerHTML=Bo),to=c(te),_(Y.$$.fragment,te),oo=c(te),_(H.$$.fragment,te),te.forEach(t),et.forEach(t),It=c(e),B=r(e,"H2",{class:!0});var Gt=f(B);L=r(Gt,"A",{id:!0,class:!0,href:!0});var Do=f(L);at=r(Do,"SPAN",{});var Ko=f(at);_(ke.$$.fragment,Ko),Ko.forEach(t),Do.forEach(t),no=c(Gt),He=r(Gt,"SPAN",{"data-svelte-h":!0}),u(He)!=="svelte-mjof1y"&&(He.textContent=Go),Gt.forEach(t),Jt=c(e),k=r(e,"DIV",{class:!0});var U=f(k);_(Se.$$.fragment,U),so=c(U),Le=r(U,"P",{"data-svelte-h":!0}),u(Le)!=="svelte-npirve"&&(Le.innerHTML=Xo),ao=c(U),_(Q.$$.fragment,U),ro=c(U),Qe=r(U,"P",{"data-svelte-h":!0}),u(Qe)!=="svelte-68lg8f"&&(Qe.innerHTML=Ro),io=c(U),F=r(U,"DIV",{class:!0});var oe=f(F);_(je.$$.fragment,oe),lo=c(oe),Ae=r(oe,"P",{"data-svelte-h":!0}),u(Ae)!=="svelte-tuqos2"&&(Ae.innerHTML=Po),co=c(oe),_(A.$$.fragment,oe),po=c(oe),_(q.$$.fragment,oe),oe.forEach(t),U.forEach(t),Ut=c(e),G=r(e,"H2",{class:!0});var Xt=f(G);O=r(Xt,"A",{id:!0,class:!0,href:!0});var en=f(O);rt=r(en,"SPAN",{});var tn=f(rt);_(xe.$$.fragment,tn),tn.forEach(t),en.forEach(t),mo=c(Xt),qe=r(Xt,"SPAN",{"data-svelte-h":!0}),u(qe)!=="svelte-uxmv0y"&&(qe.textContent=Vo),Xt.forEach(t),Wt=c(e),j=r(e,"DIV",{class:!0});var ne=f(j);_(Fe.$$.fragment,ne),ho=c(ne),Oe=r(ne,"P",{"data-svelte-h":!0}),u(Oe)!=="svelte-13r27gg"&&(Oe.textContent=Eo),uo=c(ne),De=r(ne,"P",{"data-svelte-h":!0}),u(De)!=="svelte-68lg8f"&&(De.innerHTML=Yo),fo=c(ne),I=r(ne,"DIV",{class:!0});var se=f(I);_(Ie.$$.fragment,se),go=c(se),Ke=r(se,"P",{"data-svelte-h":!0}),u(Ke)!=="svelte-thgob2"&&(Ke.innerHTML=Ho),vo=c(se),_(D.$$.fragment,se),wo=c(se),_(K.$$.fragment,se),se.forEach(t),ne.forEach(t),Zt=c(e),it=r(e,"P",{}),f(it).forEach(t),this.h()},h(){h(o,"name","hf:doc:metadata"),h(o,"content",JSON.stringify(wn)),h(s,"id","swin-transformer-v2"),h(s,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(s,"href","#swin-transformer-v2"),h(g,"class","relative group"),h(X,"id","overview"),h(X,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(X,"href","#overview"),h(W,"class","relative group"),h(R,"id","resources"),h(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(R,"href","#resources"),h(Z,"class","relative group"),h(P,"id","transformers.Swinv2Config"),h(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(P,"href","#transformers.Swinv2Config"),h(N,"class","relative group"),h(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(E,"id","transformers.Swinv2Model"),h(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(E,"href","#transformers.Swinv2Model"),h(z,"class","relative group"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"id","transformers.Swinv2ForMaskedImageModeling"),h(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(L,"href","#transformers.Swinv2ForMaskedImageModeling"),h(B,"class","relative group"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(O,"id","transformers.Swinv2ForImageClassification"),h(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(O,"href","#transformers.Swinv2ForImageClassification"),h(G,"class","relative group"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){i(document.head,o),l(e,v,n),l(e,p,n),l(e,m,n),l(e,g,n),i(g,s),i(s,$),b(re,$,null),i(g,Et),i(g,ze),l(e,ht,n),l(e,W,n),i(W,X),i(X,tt),b(ie,tt,null),i(W,Yt),i(W,Be),l(e,ut,n),l(e,le,n),l(e,ft,n),l(e,de,n),l(e,gt,n),l(e,ce,n),l(e,vt,n),l(e,pe,n),l(e,wt,n),l(e,me,n),l(e,_t,n),l(e,he,n),l(e,bt,n),l(e,Z,n),i(Z,R),i(R,ot),b(ue,ot,null),i(Z,Ht),i(Z,Ge),l(e,yt,n),l(e,fe,n),l(e,Mt,n),b(ge,e,n),l(e,Tt,n),l(e,ve,n),l(e,$t,n),l(e,we,n),l(e,Ct,n),l(e,_e,n),l(e,kt,n),l(e,be,n),l(e,St,n),l(e,N,n),i(N,P),i(P,nt),b(ye,nt,null),i(N,Lt),i(N,Xe),l(e,jt,n),l(e,S,n),b(Me,S,null),i(S,Qt),i(S,Re),i(S,At),i(S,Pe),i(S,qt),b(V,S,null),l(e,xt,n),l(e,z,n),i(z,E),i(E,st),b(Te,st,null),i(z,Ot),i(z,Ve),l(e,Ft,n),l(e,J,n),b($e,J,null),i(J,Dt),i(J,Ee),i(J,Kt),i(J,x),b(Ce,x,null),i(x,eo),i(x,Ye),i(x,to),b(Y,x,null),i(x,oo),b(H,x,null),l(e,It,n),l(e,B,n),i(B,L),i(L,at),b(ke,at,null),i(B,no),i(B,He),l(e,Jt,n),l(e,k,n),b(Se,k,null),i(k,so),i(k,Le),i(k,ao),b(Q,k,null),i(k,ro),i(k,Qe),i(k,io),i(k,F),b(je,F,null),i(F,lo),i(F,Ae),i(F,co),b(A,F,null),i(F,po),b(q,F,null),l(e,Ut,n),l(e,G,n),i(G,O),i(O,rt),b(xe,rt,null),i(G,mo),i(G,qe),l(e,Wt,n),l(e,j,n),b(Fe,j,null),i(j,ho),i(j,Oe),i(j,uo),i(j,De),i(j,fo),i(j,I),b(Ie,I,null),i(I,go),i(I,Ke),i(I,vo),b(D,I,null),i(I,wo),b(K,I,null),l(e,Zt,n),l(e,it,n),Nt=!0},p(e,[n]){const Je={};n&2&&(Je.$$scope={dirty:n,ctx:e}),V.$set(Je);const lt={};n&2&&(lt.$$scope={dirty:n,ctx:e}),Y.$set(lt);const dt={};n&2&&(dt.$$scope={dirty:n,ctx:e}),H.$set(dt);const Ue={};n&2&&(Ue.$$scope={dirty:n,ctx:e}),Q.$set(Ue);const ct={};n&2&&(ct.$$scope={dirty:n,ctx:e}),A.$set(ct);const pt={};n&2&&(pt.$$scope={dirty:n,ctx:e}),q.$set(pt);const We={};n&2&&(We.$$scope={dirty:n,ctx:e}),D.$set(We);const mt={};n&2&&(mt.$$scope={dirty:n,ctx:e}),K.$set(mt)},i(e){Nt||(y(re.$$.fragment,e),y(ie.$$.fragment,e),y(ue.$$.fragment,e),y(ge.$$.fragment,e),y(ye.$$.fragment,e),y(Me.$$.fragment,e),y(V.$$.fragment,e),y(Te.$$.fragment,e),y($e.$$.fragment,e),y(Ce.$$.fragment,e),y(Y.$$.fragment,e),y(H.$$.fragment,e),y(ke.$$.fragment,e),y(Se.$$.fragment,e),y(Q.$$.fragment,e),y(je.$$.fragment,e),y(A.$$.fragment,e),y(q.$$.fragment,e),y(xe.$$.fragment,e),y(Fe.$$.fragment,e),y(Ie.$$.fragment,e),y(D.$$.fragment,e),y(K.$$.fragment,e),Nt=!0)},o(e){M(re.$$.fragment,e),M(ie.$$.fragment,e),M(ue.$$.fragment,e),M(ge.$$.fragment,e),M(ye.$$.fragment,e),M(Me.$$.fragment,e),M(V.$$.fragment,e),M(Te.$$.fragment,e),M($e.$$.fragment,e),M(Ce.$$.fragment,e),M(Y.$$.fragment,e),M(H.$$.fragment,e),M(ke.$$.fragment,e),M(Se.$$.fragment,e),M(Q.$$.fragment,e),M(je.$$.fragment,e),M(A.$$.fragment,e),M(q.$$.fragment,e),M(xe.$$.fragment,e),M(Fe.$$.fragment,e),M(Ie.$$.fragment,e),M(D.$$.fragment,e),M(K.$$.fragment,e),Nt=!1},d(e){e&&(t(v),t(p),t(m),t(g),t(ht),t(W),t(ut),t(le),t(ft),t(de),t(gt),t(ce),t(vt),t(pe),t(wt),t(me),t(_t),t(he),t(bt),t(Z),t(yt),t(fe),t(Mt),t(Tt),t(ve),t($t),t(we),t(Ct),t(_e),t(kt),t(be),t(St),t(N),t(jt),t(S),t(xt),t(z),t(Ft),t(J),t(It),t(B),t(Jt),t(k),t(Ut),t(G),t(Wt),t(j),t(Zt),t(it)),t(o),T(re),T(ie),T(ue),T(ge,e),T(ye),T(Me),T(V),T(Te),T($e),T(Ce),T(Y),T(H),T(ke),T(Se),T(Q),T(je),T(A),T(q),T(xe),T(Fe),T(Ie),T(D),T(K)}}}const wn={local:"swin-transformer-v2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.Swinv2Config",title:"Swinv2Config"},{local:"transformers.Swinv2Model",title:"Swinv2Model"},{local:"transformers.Swinv2ForMaskedImageModeling",title:"Swinv2ForMaskedImageModeling"},{local:"transformers.Swinv2ForImageClassification",title:"Swinv2ForImageClassification"}],title:"Swin Transformer V2"};function _n(C){return nn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class jn extends sn{constructor(o){super(),an(this,o,_n,vn,on,{})}}export{jn as component};
