import{S as nd,i as ad,s as rd,e as n,k as u,w as v,t as r,M as ld,c as a,d as o,m as g,a as i,x as y,h as l,b as c,N as id,G as e,g as w,y as M,q as T,o as $,B as S,v as dd,L as Dt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Qt}from"../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Lt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ht}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as cd}from"../../chunks/PipelineTag-hf-doc-builder.js";function pd(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFN3aW5Db25maWclMkMlMjBTd2luTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwU3dpbiUyMG1pY3Jvc29mdCUyRnN3aW4tdGlueS1wYXRjaDQtd2luZG93Ny0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU3dpbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBtaWNyb3NvZnQlMkZzd2luLXRpbnktcGF0Y2g0LXdpbmRvdzctMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTd2luTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SwinConfig, SwinModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Swin microsoft/swin-tiny-patch4-window7-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SwinConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/swin-tiny-patch4-window7-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwinModel(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(){d=n("p"),b=r("Example:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Example:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function hd(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var k=i(f);m=l(k,"Module"),k.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function md(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW5Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbi10aW55LXBhdGNoNC13aW5kb3c3LTIyNCUyMiklMEFtb2RlbCUyMCUzRCUyMFN3aW5Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbi10aW55LXBhdGNoNC13aW5kb3c3LTIyNCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SwinModel
<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/swin-tiny-patch4-window7-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwinModel.from_pretrained(<span class="hljs-string">&quot;microsoft/swin-tiny-patch4-window7-224&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">49</span>, <span class="hljs-number">768</span>]`}}),{c(){d=n("p"),b=r("Example:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Example:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function fd(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Note that we provide a script to pre-train this model on custom data in our "),f=n("a"),m=r(`examples
directory`),_=r("."),this.h()},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Note that we provide a script to pre-train this model on custom data in our "),f=a(p,"A",{href:!0,rel:!0});var k=i(f);m=l(k,`examples
directory`),k.forEach(o),_=l(p,"."),p.forEach(o),this.h()},h(){c(f,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(f,"rel","nofollow")},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function ud(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var k=i(f);m=l(k,"Module"),k.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function gd(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW5Gb3JNYXNrZWRJbWFnZU1vZGVsaW5nJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnN3aW4tYmFzZS1zaW1taW0td2luZG93Ni0xOTIlMjIpJTBBbW9kZWwlMjAlM0QlMjBTd2luRm9yTWFza2VkSW1hZ2VNb2RlbGluZy5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbi1iYXNlLXNpbW1pbS13aW5kb3c2LTE5MiUyMiklMEElMEFudW1fcGF0Y2hlcyUyMCUzRCUyMChtb2RlbC5jb25maWcuaW1hZ2Vfc2l6ZSUyMCUyRiUyRiUyMG1vZGVsLmNvbmZpZy5wYXRjaF9zaXplKSUyMCoqJTIwMiUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQSUyMyUyMGNyZWF0ZSUyMHJhbmRvbSUyMGJvb2xlYW4lMjBtYXNrJTIwb2YlMjBzaGFwZSUyMChiYXRjaF9zaXplJTJDJTIwbnVtX3BhdGNoZXMpJTBBYm9vbF9tYXNrZWRfcG9zJTIwJTNEJTIwdG9yY2gucmFuZGludChsb3clM0QwJTJDJTIwaGlnaCUzRDIlMkMlMjBzaXplJTNEKDElMkMlMjBudW1fcGF0Y2hlcykpLmJvb2woKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChwaXhlbF92YWx1ZXMlMkMlMjBib29sX21hc2tlZF9wb3MlM0Rib29sX21hc2tlZF9wb3MpJTBBbG9zcyUyQyUyMHJlY29uc3RydWN0ZWRfcGl4ZWxfdmFsdWVzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTJDJTIwb3V0cHV0cy5yZWNvbnN0cnVjdGlvbiUwQWxpc3QocmVjb25zdHJ1Y3RlZF9waXhlbF92YWx1ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SwinForMaskedImageModeling
<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/swin-base-simmim-window6-192&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwinForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;microsoft/swin-base-simmim-window6-192&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">192</span>, <span class="hljs-number">192</span>]`}}),{c(){d=n("p"),b=r("Examples:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Examples:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function wd(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var k=i(f);m=l(k,"Module"),k.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function _d(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW5Gb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZzd2luLXRpbnktcGF0Y2g0LXdpbmRvdzctMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwU3dpbkZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnN3aW4tdGlueS1wYXRjaDQtd2luZG93Ny0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SwinForImageClassification
<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/swin-tiny-patch4-window7-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwinForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/swin-tiny-patch4-window7-224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){d=n("p"),b=r("Example:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Example:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function bd(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var k=i(f);m=l(k,"Module"),k.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function vd(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU3dpbk1vZGVsJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbi10aW55LXBhdGNoNC13aW5kb3c3LTIyNCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGU3dpbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZzd2luLXRpbnktcGF0Y2g0LXdpbmRvdzctMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFSwinModel
<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/swin-tiny-patch4-window7-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSwinModel.from_pretrained(<span class="hljs-string">&quot;microsoft/swin-tiny-patch4-window7-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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">49</span>, <span class="hljs-number">768</span>]`}}),{c(){d=n("p"),b=r("Example:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Example:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function yd(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var k=i(f);m=l(k,"Module"),k.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function Md(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU3dpbkZvck1hc2tlZEltYWdlTW9kZWxpbmclMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3dpbi10aW55LXBhdGNoNC13aW5kb3c3LTIyNCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGU3dpbkZvck1hc2tlZEltYWdlTW9kZWxpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnN3aW4tdGlueS1wYXRjaDQtd2luZG93Ny0yMjQlMjIpJTBBJTBBbnVtX3BhdGNoZXMlMjAlM0QlMjAobW9kZWwuY29uZmlnLmltYWdlX3NpemUlMjAlMkYlMkYlMjBtb2RlbC5jb25maWcucGF0Y2hfc2l6ZSklMjAqKiUyMDIlMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKS5waXhlbF92YWx1ZXMlMEElMjMlMjBjcmVhdGUlMjByYW5kb20lMjBib29sZWFuJTIwbWFzayUyMG9mJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9wYXRjaGVzKSUwQWJvb2xfbWFza2VkX3BvcyUyMCUzRCUyMHRmLnJhbmRvbS51bmlmb3JtKCgxJTJDJTIwbnVtX3BhdGNoZXMpKSUyMCUzRSUzRCUyMDAuNSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChwaXhlbF92YWx1ZXMlMkMlMjBib29sX21hc2tlZF9wb3MlM0Rib29sX21hc2tlZF9wb3MpJTBBbG9zcyUyQyUyMHJlY29uc3RydWN0ZWRfcGl4ZWxfdmFsdWVzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTJDJTIwb3V0cHV0cy5yZWNvbnN0cnVjdGlvbiUwQWxpc3QocmVjb25zdHJ1Y3RlZF9waXhlbF92YWx1ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFSwinForMaskedImageModeling
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<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/swin-tiny-patch4-window7-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSwinForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;microsoft/swin-tiny-patch4-window7-224&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;tf&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 = tf.random.uniform((<span class="hljs-number">1</span>, num_patches)) &gt;= <span class="hljs-number">0.5</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">224</span>, <span class="hljs-number">224</span>]`}}),{c(){d=n("p"),b=r("Examples:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Examples:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function Td(F){let d,b,f,m,_;return{c(){d=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(p,"CODE",{});var k=i(f);m=l(k,"Module"),k.forEach(o),_=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(s,p){w(s,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(s){s&&o(d)}}}function $d(F){let d,b,f,m,_;return m=new Lt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGU3dpbkZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnN3aW4tdGlueS1wYXRjaDQtd2luZG93Ny0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlN3aW5Gb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZzd2luLXRpbnktcGF0Y2g0LXdpbmRvdzctMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFSwinForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<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/swin-tiny-patch4-window7-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSwinForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/swin-tiny-patch4-window7-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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 = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){d=n("p"),b=r("Example:"),f=u(),v(m.$$.fragment)},l(s){d=a(s,"P",{});var p=i(d);b=l(p,"Example:"),p.forEach(o),f=g(s),y(m.$$.fragment,s)},m(s,p){w(s,d,p),e(d,b),w(s,f,p),M(m,s,p),_=!0},p:Dt,i(s){_||(T(m.$$.fragment,s),_=!0)},o(s){$(m.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(f),S(m,s)}}}function Sd(F){let d,b,f,m,_,s,p,k,Tn,ks,H,me,Jo,Le,$n,Zo,Sn,js,fe,Fn,Oe,kn,jn,Is,Ot,In,Es,Kt,No,En,Cs,eo,Cn,Us,V,Ke,Un,to,Wn,Jn,Zn,et,Nn,xo,xn,zn,Gn,j,Bn,zo,Rn,An,Go,Xn,Pn,Bo,Vn,Yn,Ro,qn,Qn,Ao,Hn,Dn,Xo,Ln,On,Po,Kn,ea,Ws,ue,zl,Js,ge,ta,oo,oa,sa,Zs,Z,na,tt,aa,ra,ot,la,ia,st,da,ca,Ns,D,we,Vo,nt,pa,Yo,ha,xs,so,ma,zs,at,Gs,_e,Y,no,fa,ua,rt,ga,wa,lt,_a,ba,va,ao,ya,ro,Ma,Bs,lo,Ta,Rs,io,be,co,$a,Sa,it,Fa,ka,As,po,ja,Xs,L,ve,qo,dt,Ia,Qo,Ea,Ps,C,ct,Ca,O,Ua,ho,Wa,Ja,pt,Za,Na,xa,K,za,mo,Ga,Ba,fo,Ra,Aa,Xa,ye,Vs,ee,Me,Ho,ht,Pa,Do,Va,Ys,A,mt,Ya,ft,qa,ut,Qa,Ha,Da,N,gt,La,te,Oa,uo,Ka,er,Lo,tr,or,sr,Te,nr,$e,qs,oe,Se,Oo,wt,ar,Ko,rr,Qs,E,_t,lr,bt,ir,vt,dr,cr,pr,Fe,hr,yt,mr,Mt,fr,ur,gr,x,Tt,wr,se,_r,go,br,vr,es,yr,Mr,Tr,ke,$r,je,Hs,ne,Ie,ts,$t,Sr,os,Fr,Ds,U,St,kr,ss,jr,Ir,Ft,Er,kt,Cr,Ur,Wr,z,jt,Jr,ae,Zr,wo,Nr,xr,ns,zr,Gr,Br,Ee,Rr,Ce,Ls,re,Ue,as,It,Ar,rs,Xr,Os,X,Et,Pr,Ct,Vr,Ut,Yr,qr,Qr,G,Wt,Hr,le,Dr,_o,Lr,Or,ls,Kr,el,tl,We,ol,Je,Ks,ie,Ze,is,Jt,sl,ds,nl,en,P,Zt,al,de,rl,Nt,ll,il,xt,dl,cl,pl,B,zt,hl,ce,ml,bo,fl,ul,cs,gl,wl,_l,Ne,bl,xe,tn,pe,ze,ps,Gt,vl,hs,yl,on,W,Bt,Ml,ms,Tl,$l,Rt,Sl,At,Fl,kl,jl,R,Xt,Il,he,El,vo,Cl,Ul,fs,Wl,Jl,Zl,Ge,Nl,Be,sn;return s=new Q({}),Le=new Q({}),nt=new Q({}),at=new cd({props:{pipeline:"image-classification"}}),dt=new Q({}),ct=new J({props:{name:"class transformers.SwinConfig",anchor:"transformers.SwinConfig",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:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SwinConfig.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.SwinConfig.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.SwinConfig.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.SwinConfig.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.SwinConfig.depths",description:`<strong>depths</strong> (<code>list(int)</code>, <em>optional</em>, defaults to [2, 2, 6, 2]) &#x2014;
Depth of each layer in the Transformer encoder.`,name:"depths"},{anchor:"transformers.SwinConfig.num_heads",description:`<strong>num_heads</strong> (<code>list(int)</code>, <em>optional</em>, defaults to [3, 6, 12, 24]) &#x2014;
Number of attention heads in each layer of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.SwinConfig.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.SwinConfig.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.SwinConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
Whether or not a learnable bias should be added to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.SwinConfig.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.SwinConfig.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.SwinConfig.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.SwinConfig.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.SwinConfig.use_absolute_embeddings",description:`<strong>use_absolute_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to False) &#x2014;
Whether or not to add absolute position embeddings to the patch embeddings.`,name:"use_absolute_embeddings"},{anchor:"transformers.SwinConfig.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.SwinConfig.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.SwinConfig.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"},{anchor:"transformers.SwinConfig.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). If unset and <code>out_indices</code> is set, will default to the
corresponding stages. If unset and <code>out_indices</code> is unset, will default to the last stage.`,name:"out_features"},{anchor:"transformers.SwinConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and <code>out_features</code> is set, will default to the corresponding stages.
If unset and <code>out_features</code> is unset, will default to the last stage.`,name:"out_indices"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/swin/configuration_swin.py#L38"}}),ye=new Ht({props:{anchor:"transformers.SwinConfig.example",$$slots:{default:[pd]},$$scope:{ctx:F}}}),ht=new Q({}),mt=new J({props:{name:"class transformers.SwinModel",anchor:"transformers.SwinModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"},{name:"use_mask_token",val:" = False"}],parametersDescription:[{anchor:"transformers.SwinModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinConfig">SwinConfig</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.32.0/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.32.0/src/transformers/models/swin/modeling_swin.py#L946"}}),gt=new J({props:{name:"forward",anchor:"transformers.SwinModel.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.SwinModel.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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SwinModel.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.SwinModel.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.SwinModel.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.SwinModel.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SwinModel.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.32.0/src/transformers/models/swin/modeling_swin.py#L973",returnDescription:`
<p>A <code>transformers.models.swin.modeling_swin.SwinModelOutput</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.32.0/en/model_doc/swin#transformers.SwinConfig"
>SwinConfig</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>) \u2014 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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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.swin.modeling_swin.SwinModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new Qt({props:{$$slots:{default:[hd]},$$scope:{ctx:F}}}),$e=new Ht({props:{anchor:"transformers.SwinModel.forward.example",$$slots:{default:[md]},$$scope:{ctx:F}}}),wt=new Q({}),_t=new J({props:{name:"class transformers.SwinForMaskedImageModeling",anchor:"transformers.SwinForMaskedImageModeling",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SwinForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinConfig">SwinConfig</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.32.0/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.32.0/src/transformers/models/swin/modeling_swin.py#L1055"}}),Fe=new Qt({props:{$$slots:{default:[fd]},$$scope:{ctx:F}}}),Tt=new J({props:{name:"forward",anchor:"transformers.SwinForMaskedImageModeling.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.SwinForMaskedImageModeling.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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SwinForMaskedImageModeling.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.SwinForMaskedImageModeling.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.SwinForMaskedImageModeling.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.SwinForMaskedImageModeling.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SwinForMaskedImageModeling.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.32.0/src/transformers/models/swin/modeling_swin.py#L1072",returnDescription:`
<p>A <code>transformers.models.swin.modeling_swin.SwinMaskedImageModelingOutput</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.32.0/en/model_doc/swin#transformers.SwinConfig"
>SwinConfig</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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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.swin.modeling_swin.SwinMaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new Qt({props:{$$slots:{default:[ud]},$$scope:{ctx:F}}}),je=new Ht({props:{anchor:"transformers.SwinForMaskedImageModeling.forward.example",$$slots:{default:[gd]},$$scope:{ctx:F}}}),$t=new Q({}),St=new J({props:{name:"class transformers.SwinForImageClassification",anchor:"transformers.SwinForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SwinForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinConfig">SwinConfig</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.32.0/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.32.0/src/transformers/models/swin/modeling_swin.py#L1166"}}),jt=new J({props:{name:"forward",anchor:"transformers.SwinForImageClassification.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.SwinForImageClassification.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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SwinForImageClassification.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.SwinForImageClassification.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.SwinForImageClassification.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.SwinForImageClassification.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SwinForImageClassification.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.32.0/src/transformers/models/swin/modeling_swin.py#L1181",returnDescription:`
<p>A <code>transformers.models.swin.modeling_swin.SwinImageClassifierOutput</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.32.0/en/model_doc/swin#transformers.SwinConfig"
>SwinConfig</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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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.swin.modeling_swin.SwinImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ee=new Qt({props:{$$slots:{default:[wd]},$$scope:{ctx:F}}}),Ce=new Ht({props:{anchor:"transformers.SwinForImageClassification.forward.example",$$slots:{default:[_d]},$$scope:{ctx:F}}}),It=new Q({}),Et=new J({props:{name:"class transformers.TFSwinModel",anchor:"transformers.TFSwinModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSwinModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinConfig">SwinConfig</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.32.0/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.32.0/src/transformers/models/swin/modeling_tf_swin.py#L1173"}}),Wt=new J({props:{name:"call",anchor:"transformers.TFSwinModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"bool_masked_pos",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFSwinModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.TFSwinModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFSwinModel.call.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.TFSwinModel.call.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.TFSwinModel.call.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFSwinModel.call.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>tf.Tensor</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.32.0/src/transformers/models/swin/modeling_tf_swin.py#L1181",returnDescription:`
<p>A <code>transformers.models.swin.modeling_tf_swin.TFSwinModelOutput</code> or a tuple of <code>tf.Tensor</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.32.0/en/model_doc/swin#transformers.SwinConfig"
>SwinConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>, <em>optional</em>, returned when <code>add_pooling_layer=True</code> is passed) \u2014 Average pooling of the last layer hidden-state.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</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.swin.modeling_tf_swin.TFSwinModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),We=new Qt({props:{$$slots:{default:[bd]},$$scope:{ctx:F}}}),Je=new Ht({props:{anchor:"transformers.TFSwinModel.call.example",$$slots:{default:[vd]},$$scope:{ctx:F}}}),Jt=new Q({}),Zt=new J({props:{name:"class transformers.TFSwinForMaskedImageModeling",anchor:"transformers.TFSwinForMaskedImageModeling",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSwinForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinConfig">SwinConfig</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.32.0/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.32.0/src/transformers/models/swin/modeling_tf_swin.py#L1276"}}),zt=new J({props:{name:"call",anchor:"transformers.TFSwinForMaskedImageModeling.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"bool_masked_pos",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFSwinForMaskedImageModeling.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.TFSwinForMaskedImageModeling.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFSwinForMaskedImageModeling.call.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.TFSwinForMaskedImageModeling.call.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.TFSwinForMaskedImageModeling.call.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFSwinForMaskedImageModeling.call.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>tf.Tensor</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.32.0/src/transformers/models/swin/modeling_tf_swin.py#L1284",returnDescription:`
<p>A <code>transformers.models.swin.modeling_tf_swin.TFSwinMaskedImageModelingOutput</code> or a tuple of <code>tf.Tensor</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.32.0/en/model_doc/swin#transformers.SwinConfig"
>SwinConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>bool_masked_pos</code> is provided) \u2014 Masked image modeling (MLM) loss.</p>
</li>
<li>
<p><strong>reconstruction</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Reconstructed pixel values.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</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.swin.modeling_tf_swin.TFSwinMaskedImageModelingOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ne=new Qt({props:{$$slots:{default:[yd]},$$scope:{ctx:F}}}),xe=new Ht({props:{anchor:"transformers.TFSwinForMaskedImageModeling.call.example",$$slots:{default:[Md]},$$scope:{ctx:F}}}),Gt=new Q({}),Bt=new J({props:{name:"class transformers.TFSwinForImageClassification",anchor:"transformers.TFSwinForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSwinForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinConfig">SwinConfig</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.32.0/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.32.0/src/transformers/models/swin/modeling_tf_swin.py#L1388"}}),Xt=new J({props:{name:"call",anchor:"transformers.TFSwinForImageClassification.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFSwinForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.TFSwinForImageClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFSwinForImageClassification.call.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.TFSwinForImageClassification.call.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.TFSwinForImageClassification.call.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFSwinForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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.32.0/src/transformers/models/swin/modeling_tf_swin.py#L1402",returnDescription:`
<p>A <code>transformers.models.swin.modeling_tf_swin.TFSwinImageClassifierOutput</code> or a tuple of <code>tf.Tensor</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.32.0/en/model_doc/swin#transformers.SwinConfig"
>SwinConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</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.swin.modeling_tf_swin.TFSwinImageClassifierOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ge=new Qt({props:{$$slots:{default:[Td]},$$scope:{ctx:F}}}),Be=new Ht({props:{anchor:"transformers.TFSwinForImageClassification.call.example",$$slots:{default:[$d]},$$scope:{ctx:F}}}),{c(){d=n("meta"),b=u(),f=n("h1"),m=n("a"),_=n("span"),v(s.$$.fragment),p=u(),k=n("span"),Tn=r("Swin Transformer"),ks=u(),H=n("h2"),me=n("a"),Jo=n("span"),v(Le.$$.fragment),$n=u(),Zo=n("span"),Sn=r("Overview"),js=u(),fe=n("p"),Fn=r("The Swin Transformer was proposed in "),Oe=n("a"),kn=r("Swin Transformer: Hierarchical Vision Transformer using Shifted Windows"),jn=r(`
by Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, Baining Guo.`),Is=u(),Ot=n("p"),In=r("The abstract from the paper is the following:"),Es=u(),Kt=n("p"),No=n("em"),En=r(`This paper presents a new vision Transformer, called Swin Transformer, that capably serves as a general-purpose backbone
for computer vision. Challenges in adapting Transformer from language to vision arise from differences between the two domains,
such as large variations in the scale of visual entities and the high resolution of pixels in images compared to words in text.
To address these differences, we propose a hierarchical Transformer whose representation is computed with \\bold{S}hifted
\\bold{win}dows. The shifted windowing scheme brings greater efficiency by limiting self-attention computation to non-overlapping
local windows while also allowing for cross-window connection. This hierarchical architecture has the flexibility to model at
various scales and has linear computational complexity with respect to image size. These qualities of Swin Transformer make it
compatible with a broad range of vision tasks, including image classification (87.3 top-1 accuracy on ImageNet-1K) and dense
prediction tasks such as object detection (58.7 box AP and 51.1 mask AP on COCO test-dev) and semantic segmentation
(53.5 mIoU on ADE20K val). Its performance surpasses the previous state-of-the-art by a large margin of +2.7 box AP and
+2.6 mask AP on COCO, and +3.2 mIoU on ADE20K, demonstrating the potential of Transformer-based models as vision backbones.
The hierarchical design and the shifted window approach also prove beneficial for all-MLP architectures.`),Cs=u(),eo=n("p"),Cn=r("Tips:"),Us=u(),V=n("ul"),Ke=n("li"),Un=r("One can use the "),to=n("a"),Wn=r("AutoImageProcessor"),Jn=r(" API to prepare images for the model."),Zn=u(),et=n("li"),Nn=r("Swin pads the inputs supporting any input height and width (if divisible by "),xo=n("code"),xn=r("32"),zn=r(")."),Gn=u(),j=n("li"),Bn=r("Swin can be used as a "),zo=n("em"),Rn=r("backbone"),An=r(". When "),Go=n("code"),Xn=r("output_hidden_states = True"),Pn=r(", it will output both "),Bo=n("code"),Vn=r("hidden_states"),Yn=r(" and "),Ro=n("code"),qn=r("reshaped_hidden_states"),Qn=r(". The "),Ao=n("code"),Hn=r("reshaped_hidden_states"),Dn=r(" have a shape of "),Xo=n("code"),Ln=r("(batch, num_channels, height, width)"),On=r(" rather than "),Po=n("code"),Kn=r("(batch_size, sequence_length, num_channels)"),ea=r("."),Ws=u(),ue=n("img"),Js=u(),ge=n("small"),ta=r("Swin Transformer architecture. Taken from the "),oo=n("a"),oa=r("original paper"),sa=r("."),Zs=u(),Z=n("p"),na=r("This model was contributed by "),tt=n("a"),aa=r("novice03"),ra=r(". The Tensorflow version of this model was contributed by "),ot=n("a"),la=r("amyeroberts"),ia=r(". The original code can be found "),st=n("a"),da=r("here"),ca=r("."),Ns=u(),D=n("h2"),we=n("a"),Vo=n("span"),v(nt.$$.fragment),pa=u(),Yo=n("span"),ha=r("Resources"),xs=u(),so=n("p"),ma=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Swin Transformer."),zs=u(),v(at.$$.fragment),Gs=u(),_e=n("ul"),Y=n("li"),no=n("a"),fa=r("SwinForImageClassification"),ua=r(" is supported by this "),rt=n("a"),ga=r("example script"),wa=r(" and "),lt=n("a"),_a=r("notebook"),ba=r("."),va=u(),ao=n("li"),ya=r("See also: "),ro=n("a"),Ma=r("Image classification task guide"),Bs=u(),lo=n("p"),Ta=r("Besides that:"),Rs=u(),io=n("ul"),be=n("li"),co=n("a"),$a=r("SwinForMaskedImageModeling"),Sa=r(" is supported by this "),it=n("a"),Fa=r("example script"),ka=r("."),As=u(),po=n("p"),ja=r("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Xs=u(),L=n("h2"),ve=n("a"),qo=n("span"),v(dt.$$.fragment),Ia=u(),Qo=n("span"),Ea=r("SwinConfig"),Ps=u(),C=n("div"),v(ct.$$.fragment),Ca=u(),O=n("p"),Ua=r("This is the configuration class to store the configuration of a "),ho=n("a"),Wa=r("SwinModel"),Ja=r(`. It is used to instantiate a Swin
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
`),pt=n("a"),Za=r("microsoft/swin-tiny-patch4-window7-224"),Na=r(`
architecture.`),xa=u(),K=n("p"),za=r("Configuration objects inherit from "),mo=n("a"),Ga=r("PretrainedConfig"),Ba=r(` and can be used to control the model outputs. Read the
documentation from `),fo=n("a"),Ra=r("PretrainedConfig"),Aa=r(" for more information."),Xa=u(),v(ye.$$.fragment),Vs=u(),ee=n("h2"),Me=n("a"),Ho=n("span"),v(ht.$$.fragment),Pa=u(),Do=n("span"),Va=r("SwinModel"),Ys=u(),A=n("div"),v(mt.$$.fragment),Ya=u(),ft=n("p"),qa=r(`The bare Swin Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ut=n("a"),Qa=r("torch.nn.Module"),Ha=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Da=u(),N=n("div"),v(gt.$$.fragment),La=u(),te=n("p"),Oa=r("The "),uo=n("a"),Ka=r("SwinModel"),er=r(" forward method, overrides the "),Lo=n("code"),tr=r("__call__"),or=r(" special method."),sr=u(),v(Te.$$.fragment),nr=u(),v($e.$$.fragment),qs=u(),oe=n("h2"),Se=n("a"),Oo=n("span"),v(wt.$$.fragment),ar=u(),Ko=n("span"),rr=r("SwinForMaskedImageModeling"),Qs=u(),E=n("div"),v(_t.$$.fragment),lr=u(),bt=n("p"),ir=r("Swin Model with a decoder on top for masked image modeling, as proposed in "),vt=n("a"),dr=r("SimMIM"),cr=r("."),pr=u(),v(Fe.$$.fragment),hr=u(),yt=n("p"),mr=r("This model is a PyTorch "),Mt=n("a"),fr=r("torch.nn.Module"),ur=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gr=u(),x=n("div"),v(Tt.$$.fragment),wr=u(),se=n("p"),_r=r("The "),go=n("a"),br=r("SwinForMaskedImageModeling"),vr=r(" forward method, overrides the "),es=n("code"),yr=r("__call__"),Mr=r(" special method."),Tr=u(),v(ke.$$.fragment),$r=u(),v(je.$$.fragment),Hs=u(),ne=n("h2"),Ie=n("a"),ts=n("span"),v($t.$$.fragment),Sr=u(),os=n("span"),Fr=r("SwinForImageClassification"),Ds=u(),U=n("div"),v(St.$$.fragment),kr=u(),ss=n("p"),jr=r(`Swin 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.`),Ir=u(),Ft=n("p"),Er=r("This model is a PyTorch "),kt=n("a"),Cr=r("torch.nn.Module"),Ur=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wr=u(),z=n("div"),v(jt.$$.fragment),Jr=u(),ae=n("p"),Zr=r("The "),wo=n("a"),Nr=r("SwinForImageClassification"),xr=r(" forward method, overrides the "),ns=n("code"),zr=r("__call__"),Gr=r(" special method."),Br=u(),v(Ee.$$.fragment),Rr=u(),v(Ce.$$.fragment),Ls=u(),re=n("h2"),Ue=n("a"),as=n("span"),v(It.$$.fragment),Ar=u(),rs=n("span"),Xr=r("TFSwinModel"),Os=u(),X=n("div"),v(Et.$$.fragment),Pr=u(),Ct=n("p"),Vr=r(`The bare Swin Model transformer outputting raw hidden-states without any specific head on top.
This model is a Tensorflow
`),Ut=n("a"),Yr=r("tf.keras.layers.Layer"),qr=r(` sub-class. Use it as a
regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
behavior.`),Qr=u(),G=n("div"),v(Wt.$$.fragment),Hr=u(),le=n("p"),Dr=r("The "),_o=n("a"),Lr=r("TFSwinModel"),Or=r(" forward method, overrides the "),ls=n("code"),Kr=r("__call__"),el=r(" special method."),tl=u(),v(We.$$.fragment),ol=u(),v(Je.$$.fragment),Ks=u(),ie=n("h2"),Ze=n("a"),is=n("span"),v(Jt.$$.fragment),sl=u(),ds=n("span"),nl=r("TFSwinForMaskedImageModeling"),en=u(),P=n("div"),v(Zt.$$.fragment),al=u(),de=n("p"),rl=r("Swin Model with a decoder on top for masked image modeling, as proposed in "),Nt=n("a"),ll=r("SimMIM"),il=r(`.
This model is a Tensorflow
`),xt=n("a"),dl=r("tf.keras.layers.Layer"),cl=r(` sub-class. Use it as a
regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
behavior.`),pl=u(),B=n("div"),v(zt.$$.fragment),hl=u(),ce=n("p"),ml=r("The "),bo=n("a"),fl=r("TFSwinForMaskedImageModeling"),ul=r(" forward method, overrides the "),cs=n("code"),gl=r("__call__"),wl=r(" special method."),_l=u(),v(Ne.$$.fragment),bl=u(),v(xe.$$.fragment),tn=u(),pe=n("h2"),ze=n("a"),ps=n("span"),v(Gt.$$.fragment),vl=u(),hs=n("span"),yl=r("TFSwinForImageClassification"),on=u(),W=n("div"),v(Bt.$$.fragment),Ml=u(),ms=n("p"),Tl=r(`Swin 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.`),$l=u(),Rt=n("p"),Sl=r(`This model is a Tensorflow
`),At=n("a"),Fl=r("tf.keras.layers.Layer"),kl=r(` sub-class. Use it as a
regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
behavior.`),jl=u(),R=n("div"),v(Xt.$$.fragment),Il=u(),he=n("p"),El=r("The "),vo=n("a"),Cl=r("TFSwinForImageClassification"),Ul=r(" forward method, overrides the "),fs=n("code"),Wl=r("__call__"),Jl=r(" special method."),Zl=u(),v(Ge.$$.fragment),Nl=u(),v(Be.$$.fragment),this.h()},l(t){const h=ld('[data-svelte="svelte-1phssyn"]',document.head);d=a(h,"META",{name:!0,content:!0}),h.forEach(o),b=g(t),f=a(t,"H1",{class:!0});var Pt=i(f);m=a(Pt,"A",{id:!0,class:!0,href:!0});var us=i(m);_=a(us,"SPAN",{});var gs=i(_);y(s.$$.fragment,gs),gs.forEach(o),us.forEach(o),p=g(Pt),k=a(Pt,"SPAN",{});var ws=i(k);Tn=l(ws,"Swin Transformer"),ws.forEach(o),Pt.forEach(o),ks=g(t),H=a(t,"H2",{class:!0});var Vt=i(H);me=a(Vt,"A",{id:!0,class:!0,href:!0});var _s=i(me);Jo=a(_s,"SPAN",{});var bs=i(Jo);y(Le.$$.fragment,bs),bs.forEach(o),_s.forEach(o),$n=g(Vt),Zo=a(Vt,"SPAN",{});var vs=i(Zo);Sn=l(vs,"Overview"),vs.forEach(o),Vt.forEach(o),js=g(t),fe=a(t,"P",{});var Yt=i(fe);Fn=l(Yt,"The Swin Transformer was proposed in "),Oe=a(Yt,"A",{href:!0,rel:!0});var ys=i(Oe);kn=l(ys,"Swin Transformer: Hierarchical Vision Transformer using Shifted Windows"),ys.forEach(o),jn=l(Yt,`
by Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, Baining Guo.`),Yt.forEach(o),Is=g(t),Ot=a(t,"P",{});var Ms=i(Ot);In=l(Ms,"The abstract from the paper is the following:"),Ms.forEach(o),Es=g(t),Kt=a(t,"P",{});var Ts=i(Kt);No=a(Ts,"EM",{});var $s=i(No);En=l($s,`This paper presents a new vision Transformer, called Swin Transformer, that capably serves as a general-purpose backbone
for computer vision. Challenges in adapting Transformer from language to vision arise from differences between the two domains,
such as large variations in the scale of visual entities and the high resolution of pixels in images compared to words in text.
To address these differences, we propose a hierarchical Transformer whose representation is computed with \\bold{S}hifted
\\bold{win}dows. The shifted windowing scheme brings greater efficiency by limiting self-attention computation to non-overlapping
local windows while also allowing for cross-window connection. This hierarchical architecture has the flexibility to model at
various scales and has linear computational complexity with respect to image size. These qualities of Swin Transformer make it
compatible with a broad range of vision tasks, including image classification (87.3 top-1 accuracy on ImageNet-1K) and dense
prediction tasks such as object detection (58.7 box AP and 51.1 mask AP on COCO test-dev) and semantic segmentation
(53.5 mIoU on ADE20K val). Its performance surpasses the previous state-of-the-art by a large margin of +2.7 box AP and
+2.6 mask AP on COCO, and +3.2 mIoU on ADE20K, demonstrating the potential of Transformer-based models as vision backbones.
The hierarchical design and the shifted window approach also prove beneficial for all-MLP architectures.`),$s.forEach(o),Ts.forEach(o),Cs=g(t),eo=a(t,"P",{});var Ss=i(eo);Cn=l(Ss,"Tips:"),Ss.forEach(o),Us=g(t),V=a(t,"UL",{});var yo=i(V);Ke=a(yo,"LI",{});var nn=i(Ke);Un=l(nn,"One can use the "),to=a(nn,"A",{href:!0});var Gl=i(to);Wn=l(Gl,"AutoImageProcessor"),Gl.forEach(o),Jn=l(nn," API to prepare images for the model."),nn.forEach(o),Zn=g(yo),et=a(yo,"LI",{});var an=i(et);Nn=l(an,"Swin pads the inputs supporting any input height and width (if divisible by "),xo=a(an,"CODE",{});var Bl=i(xo);xn=l(Bl,"32"),Bl.forEach(o),zn=l(an,")."),an.forEach(o),Gn=g(yo),j=a(yo,"LI",{});var I=i(j);Bn=l(I,"Swin can be used as a "),zo=a(I,"EM",{});var Rl=i(zo);Rn=l(Rl,"backbone"),Rl.forEach(o),An=l(I,". When "),Go=a(I,"CODE",{});var Al=i(Go);Xn=l(Al,"output_hidden_states = True"),Al.forEach(o),Pn=l(I,", it will output both "),Bo=a(I,"CODE",{});var Xl=i(Bo);Vn=l(Xl,"hidden_states"),Xl.forEach(o),Yn=l(I," and "),Ro=a(I,"CODE",{});var Pl=i(Ro);qn=l(Pl,"reshaped_hidden_states"),Pl.forEach(o),Qn=l(I,". The "),Ao=a(I,"CODE",{});var Vl=i(Ao);Hn=l(Vl,"reshaped_hidden_states"),Vl.forEach(o),Dn=l(I," have a shape of "),Xo=a(I,"CODE",{});var Yl=i(Xo);Ln=l(Yl,"(batch, num_channels, height, width)"),Yl.forEach(o),On=l(I," rather than "),Po=a(I,"CODE",{});var ql=i(Po);Kn=l(ql,"(batch_size, sequence_length, num_channels)"),ql.forEach(o),ea=l(I,"."),I.forEach(o),yo.forEach(o),Ws=g(t),ue=a(t,"IMG",{src:!0,alt:!0,width:!0}),Js=g(t),ge=a(t,"SMALL",{});var rn=i(ge);ta=l(rn,"Swin Transformer architecture. Taken from the "),oo=a(rn,"A",{href:!0});var Ql=i(oo);oa=l(Ql,"original paper"),Ql.forEach(o),sa=l(rn,"."),rn.forEach(o),Zs=g(t),Z=a(t,"P",{});var Re=i(Z);na=l(Re,"This model was contributed by "),tt=a(Re,"A",{href:!0,rel:!0});var Hl=i(tt);aa=l(Hl,"novice03"),Hl.forEach(o),ra=l(Re,". The Tensorflow version of this model was contributed by "),ot=a(Re,"A",{href:!0,rel:!0});var Dl=i(ot);la=l(Dl,"amyeroberts"),Dl.forEach(o),ia=l(Re,". The original code can be found "),st=a(Re,"A",{href:!0,rel:!0});var Ll=i(st);da=l(Ll,"here"),Ll.forEach(o),ca=l(Re,"."),Re.forEach(o),Ns=g(t),D=a(t,"H2",{class:!0});var ln=i(D);we=a(ln,"A",{id:!0,class:!0,href:!0});var Ol=i(we);Vo=a(Ol,"SPAN",{});var Kl=i(Vo);y(nt.$$.fragment,Kl),Kl.forEach(o),Ol.forEach(o),pa=g(ln),Yo=a(ln,"SPAN",{});var ei=i(Yo);ha=l(ei,"Resources"),ei.forEach(o),ln.forEach(o),xs=g(t),so=a(t,"P",{});var ti=i(so);ma=l(ti,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Swin Transformer."),ti.forEach(o),zs=g(t),y(at.$$.fragment,t),Gs=g(t),_e=a(t,"UL",{});var dn=i(_e);Y=a(dn,"LI",{});var qt=i(Y);no=a(qt,"A",{href:!0});var oi=i(no);fa=l(oi,"SwinForImageClassification"),oi.forEach(o),ua=l(qt," is supported by this "),rt=a(qt,"A",{href:!0,rel:!0});var si=i(rt);ga=l(si,"example script"),si.forEach(o),wa=l(qt," and "),lt=a(qt,"A",{href:!0,rel:!0});var ni=i(lt);_a=l(ni,"notebook"),ni.forEach(o),ba=l(qt,"."),qt.forEach(o),va=g(dn),ao=a(dn,"LI",{});var xl=i(ao);ya=l(xl,"See also: "),ro=a(xl,"A",{href:!0});var ai=i(ro);Ma=l(ai,"Image classification task guide"),ai.forEach(o),xl.forEach(o),dn.forEach(o),Bs=g(t),lo=a(t,"P",{});var ri=i(lo);Ta=l(ri,"Besides that:"),ri.forEach(o),Rs=g(t),io=a(t,"UL",{});var li=i(io);be=a(li,"LI",{});var Fs=i(be);co=a(Fs,"A",{href:!0});var ii=i(co);$a=l(ii,"SwinForMaskedImageModeling"),ii.forEach(o),Sa=l(Fs," is supported by this "),it=a(Fs,"A",{href:!0,rel:!0});var di=i(it);Fa=l(di,"example script"),di.forEach(o),ka=l(Fs,"."),Fs.forEach(o),li.forEach(o),As=g(t),po=a(t,"P",{});var ci=i(po);ja=l(ci,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ci.forEach(o),Xs=g(t),L=a(t,"H2",{class:!0});var cn=i(L);ve=a(cn,"A",{id:!0,class:!0,href:!0});var pi=i(ve);qo=a(pi,"SPAN",{});var hi=i(qo);y(dt.$$.fragment,hi),hi.forEach(o),pi.forEach(o),Ia=g(cn),Qo=a(cn,"SPAN",{});var mi=i(Qo);Ea=l(mi,"SwinConfig"),mi.forEach(o),cn.forEach(o),Ps=g(t),C=a(t,"DIV",{class:!0});var Ae=i(C);y(ct.$$.fragment,Ae),Ca=g(Ae),O=a(Ae,"P",{});var Mo=i(O);Ua=l(Mo,"This is the configuration class to store the configuration of a "),ho=a(Mo,"A",{href:!0});var fi=i(ho);Wa=l(fi,"SwinModel"),fi.forEach(o),Ja=l(Mo,`. It is used to instantiate a Swin
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
`),pt=a(Mo,"A",{href:!0,rel:!0});var ui=i(pt);Za=l(ui,"microsoft/swin-tiny-patch4-window7-224"),ui.forEach(o),Na=l(Mo,`
architecture.`),Mo.forEach(o),xa=g(Ae),K=a(Ae,"P",{});var To=i(K);za=l(To,"Configuration objects inherit from "),mo=a(To,"A",{href:!0});var gi=i(mo);Ga=l(gi,"PretrainedConfig"),gi.forEach(o),Ba=l(To,` and can be used to control the model outputs. Read the
documentation from `),fo=a(To,"A",{href:!0});var wi=i(fo);Ra=l(wi,"PretrainedConfig"),wi.forEach(o),Aa=l(To," for more information."),To.forEach(o),Xa=g(Ae),y(ye.$$.fragment,Ae),Ae.forEach(o),Vs=g(t),ee=a(t,"H2",{class:!0});var pn=i(ee);Me=a(pn,"A",{id:!0,class:!0,href:!0});var _i=i(Me);Ho=a(_i,"SPAN",{});var bi=i(Ho);y(ht.$$.fragment,bi),bi.forEach(o),_i.forEach(o),Pa=g(pn),Do=a(pn,"SPAN",{});var vi=i(Do);Va=l(vi,"SwinModel"),vi.forEach(o),pn.forEach(o),Ys=g(t),A=a(t,"DIV",{class:!0});var $o=i(A);y(mt.$$.fragment,$o),Ya=g($o),ft=a($o,"P",{});var hn=i(ft);qa=l(hn,`The bare Swin Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ut=a(hn,"A",{href:!0,rel:!0});var yi=i(ut);Qa=l(yi,"torch.nn.Module"),yi.forEach(o),Ha=l(hn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hn.forEach(o),Da=g($o),N=a($o,"DIV",{class:!0});var Xe=i(N);y(gt.$$.fragment,Xe),La=g(Xe),te=a(Xe,"P",{});var So=i(te);Oa=l(So,"The "),uo=a(So,"A",{href:!0});var Mi=i(uo);Ka=l(Mi,"SwinModel"),Mi.forEach(o),er=l(So," forward method, overrides the "),Lo=a(So,"CODE",{});var Ti=i(Lo);tr=l(Ti,"__call__"),Ti.forEach(o),or=l(So," special method."),So.forEach(o),sr=g(Xe),y(Te.$$.fragment,Xe),nr=g(Xe),y($e.$$.fragment,Xe),Xe.forEach(o),$o.forEach(o),qs=g(t),oe=a(t,"H2",{class:!0});var mn=i(oe);Se=a(mn,"A",{id:!0,class:!0,href:!0});var $i=i(Se);Oo=a($i,"SPAN",{});var Si=i(Oo);y(wt.$$.fragment,Si),Si.forEach(o),$i.forEach(o),ar=g(mn),Ko=a(mn,"SPAN",{});var Fi=i(Ko);rr=l(Fi,"SwinForMaskedImageModeling"),Fi.forEach(o),mn.forEach(o),Qs=g(t),E=a(t,"DIV",{class:!0});var q=i(E);y(_t.$$.fragment,q),lr=g(q),bt=a(q,"P",{});var fn=i(bt);ir=l(fn,"Swin Model with a decoder on top for masked image modeling, as proposed in "),vt=a(fn,"A",{href:!0,rel:!0});var ki=i(vt);dr=l(ki,"SimMIM"),ki.forEach(o),cr=l(fn,"."),fn.forEach(o),pr=g(q),y(Fe.$$.fragment,q),hr=g(q),yt=a(q,"P",{});var un=i(yt);mr=l(un,"This model is a PyTorch "),Mt=a(un,"A",{href:!0,rel:!0});var ji=i(Mt);fr=l(ji,"torch.nn.Module"),ji.forEach(o),ur=l(un,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),un.forEach(o),gr=g(q),x=a(q,"DIV",{class:!0});var Pe=i(x);y(Tt.$$.fragment,Pe),wr=g(Pe),se=a(Pe,"P",{});var Fo=i(se);_r=l(Fo,"The "),go=a(Fo,"A",{href:!0});var Ii=i(go);br=l(Ii,"SwinForMaskedImageModeling"),Ii.forEach(o),vr=l(Fo," forward method, overrides the "),es=a(Fo,"CODE",{});var Ei=i(es);yr=l(Ei,"__call__"),Ei.forEach(o),Mr=l(Fo," special method."),Fo.forEach(o),Tr=g(Pe),y(ke.$$.fragment,Pe),$r=g(Pe),y(je.$$.fragment,Pe),Pe.forEach(o),q.forEach(o),Hs=g(t),ne=a(t,"H2",{class:!0});var gn=i(ne);Ie=a(gn,"A",{id:!0,class:!0,href:!0});var Ci=i(Ie);ts=a(Ci,"SPAN",{});var Ui=i(ts);y($t.$$.fragment,Ui),Ui.forEach(o),Ci.forEach(o),Sr=g(gn),os=a(gn,"SPAN",{});var Wi=i(os);Fr=l(Wi,"SwinForImageClassification"),Wi.forEach(o),gn.forEach(o),Ds=g(t),U=a(t,"DIV",{class:!0});var Ve=i(U);y(St.$$.fragment,Ve),kr=g(Ve),ss=a(Ve,"P",{});var Ji=i(ss);jr=l(Ji,`Swin 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.`),Ji.forEach(o),Ir=g(Ve),Ft=a(Ve,"P",{});var wn=i(Ft);Er=l(wn,"This model is a PyTorch "),kt=a(wn,"A",{href:!0,rel:!0});var Zi=i(kt);Cr=l(Zi,"torch.nn.Module"),Zi.forEach(o),Ur=l(wn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wn.forEach(o),Wr=g(Ve),z=a(Ve,"DIV",{class:!0});var Ye=i(z);y(jt.$$.fragment,Ye),Jr=g(Ye),ae=a(Ye,"P",{});var ko=i(ae);Zr=l(ko,"The "),wo=a(ko,"A",{href:!0});var Ni=i(wo);Nr=l(Ni,"SwinForImageClassification"),Ni.forEach(o),xr=l(ko," forward method, overrides the "),ns=a(ko,"CODE",{});var xi=i(ns);zr=l(xi,"__call__"),xi.forEach(o),Gr=l(ko," special method."),ko.forEach(o),Br=g(Ye),y(Ee.$$.fragment,Ye),Rr=g(Ye),y(Ce.$$.fragment,Ye),Ye.forEach(o),Ve.forEach(o),Ls=g(t),re=a(t,"H2",{class:!0});var _n=i(re);Ue=a(_n,"A",{id:!0,class:!0,href:!0});var zi=i(Ue);as=a(zi,"SPAN",{});var Gi=i(as);y(It.$$.fragment,Gi),Gi.forEach(o),zi.forEach(o),Ar=g(_n),rs=a(_n,"SPAN",{});var Bi=i(rs);Xr=l(Bi,"TFSwinModel"),Bi.forEach(o),_n.forEach(o),Os=g(t),X=a(t,"DIV",{class:!0});var jo=i(X);y(Et.$$.fragment,jo),Pr=g(jo),Ct=a(jo,"P",{});var bn=i(Ct);Vr=l(bn,`The bare Swin Model transformer outputting raw hidden-states without any specific head on top.
This model is a Tensorflow
`),Ut=a(bn,"A",{href:!0,rel:!0});var Ri=i(Ut);Yr=l(Ri,"tf.keras.layers.Layer"),Ri.forEach(o),qr=l(bn,` sub-class. Use it as a
regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
behavior.`),bn.forEach(o),Qr=g(jo),G=a(jo,"DIV",{class:!0});var qe=i(G);y(Wt.$$.fragment,qe),Hr=g(qe),le=a(qe,"P",{});var Io=i(le);Dr=l(Io,"The "),_o=a(Io,"A",{href:!0});var Ai=i(_o);Lr=l(Ai,"TFSwinModel"),Ai.forEach(o),Or=l(Io," forward method, overrides the "),ls=a(Io,"CODE",{});var Xi=i(ls);Kr=l(Xi,"__call__"),Xi.forEach(o),el=l(Io," special method."),Io.forEach(o),tl=g(qe),y(We.$$.fragment,qe),ol=g(qe),y(Je.$$.fragment,qe),qe.forEach(o),jo.forEach(o),Ks=g(t),ie=a(t,"H2",{class:!0});var vn=i(ie);Ze=a(vn,"A",{id:!0,class:!0,href:!0});var Pi=i(Ze);is=a(Pi,"SPAN",{});var Vi=i(is);y(Jt.$$.fragment,Vi),Vi.forEach(o),Pi.forEach(o),sl=g(vn),ds=a(vn,"SPAN",{});var Yi=i(ds);nl=l(Yi,"TFSwinForMaskedImageModeling"),Yi.forEach(o),vn.forEach(o),en=g(t),P=a(t,"DIV",{class:!0});var Eo=i(P);y(Zt.$$.fragment,Eo),al=g(Eo),de=a(Eo,"P",{});var Co=i(de);rl=l(Co,"Swin Model with a decoder on top for masked image modeling, as proposed in "),Nt=a(Co,"A",{href:!0,rel:!0});var qi=i(Nt);ll=l(qi,"SimMIM"),qi.forEach(o),il=l(Co,`.
This model is a Tensorflow
`),xt=a(Co,"A",{href:!0,rel:!0});var Qi=i(xt);dl=l(Qi,"tf.keras.layers.Layer"),Qi.forEach(o),cl=l(Co,` sub-class. Use it as a
regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
behavior.`),Co.forEach(o),pl=g(Eo),B=a(Eo,"DIV",{class:!0});var Qe=i(B);y(zt.$$.fragment,Qe),hl=g(Qe),ce=a(Qe,"P",{});var Uo=i(ce);ml=l(Uo,"The "),bo=a(Uo,"A",{href:!0});var Hi=i(bo);fl=l(Hi,"TFSwinForMaskedImageModeling"),Hi.forEach(o),ul=l(Uo," forward method, overrides the "),cs=a(Uo,"CODE",{});var Di=i(cs);gl=l(Di,"__call__"),Di.forEach(o),wl=l(Uo," special method."),Uo.forEach(o),_l=g(Qe),y(Ne.$$.fragment,Qe),bl=g(Qe),y(xe.$$.fragment,Qe),Qe.forEach(o),Eo.forEach(o),tn=g(t),pe=a(t,"H2",{class:!0});var yn=i(pe);ze=a(yn,"A",{id:!0,class:!0,href:!0});var Li=i(ze);ps=a(Li,"SPAN",{});var Oi=i(ps);y(Gt.$$.fragment,Oi),Oi.forEach(o),Li.forEach(o),vl=g(yn),hs=a(yn,"SPAN",{});var Ki=i(hs);yl=l(Ki,"TFSwinForImageClassification"),Ki.forEach(o),yn.forEach(o),on=g(t),W=a(t,"DIV",{class:!0});var He=i(W);y(Bt.$$.fragment,He),Ml=g(He),ms=a(He,"P",{});var ed=i(ms);Tl=l(ed,`Swin 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.`),ed.forEach(o),$l=g(He),Rt=a(He,"P",{});var Mn=i(Rt);Sl=l(Mn,`This model is a Tensorflow
`),At=a(Mn,"A",{href:!0,rel:!0});var td=i(At);Fl=l(td,"tf.keras.layers.Layer"),td.forEach(o),kl=l(Mn,` sub-class. Use it as a
regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
behavior.`),Mn.forEach(o),jl=g(He),R=a(He,"DIV",{class:!0});var De=i(R);y(Xt.$$.fragment,De),Il=g(De),he=a(De,"P",{});var Wo=i(he);El=l(Wo,"The "),vo=a(Wo,"A",{href:!0});var od=i(vo);Cl=l(od,"TFSwinForImageClassification"),od.forEach(o),Ul=l(Wo," forward method, overrides the "),fs=a(Wo,"CODE",{});var sd=i(fs);Wl=l(sd,"__call__"),sd.forEach(o),Jl=l(Wo," special method."),Wo.forEach(o),Zl=g(De),y(Ge.$$.fragment,De),Nl=g(De),y(Be.$$.fragment,De),De.forEach(o),He.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Fd)),c(m,"id","swin-transformer"),c(m,"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"),c(m,"href","#swin-transformer"),c(f,"class","relative group"),c(me,"id","overview"),c(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(me,"href","#overview"),c(H,"class","relative group"),c(Oe,"href","https://arxiv.org/abs/2103.14030"),c(Oe,"rel","nofollow"),c(to,"href","/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor"),id(ue.src,zl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/swin_transformer_architecture.png")||c(ue,"src",zl),c(ue,"alt","drawing"),c(ue,"width","600"),c(oo,"href","https://arxiv.org/abs/2102.03334"),c(tt,"href","https://huggingface.co/novice03"),c(tt,"rel","nofollow"),c(ot,"href","https://huggingface.co/amyeroberts"),c(ot,"rel","nofollow"),c(st,"href","https://github.com/microsoft/Swin-Transformer"),c(st,"rel","nofollow"),c(we,"id","resources"),c(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(we,"href","#resources"),c(D,"class","relative group"),c(no,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinForImageClassification"),c(rt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(rt,"rel","nofollow"),c(lt,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(lt,"rel","nofollow"),c(ro,"href","../tasks/image_classification"),c(co,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinForMaskedImageModeling"),c(it,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(it,"rel","nofollow"),c(ve,"id","transformers.SwinConfig"),c(ve,"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"),c(ve,"href","#transformers.SwinConfig"),c(L,"class","relative group"),c(ho,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinModel"),c(pt,"href","https://huggingface.co/microsoft/swin-tiny-patch4-window7-224"),c(pt,"rel","nofollow"),c(mo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(fo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Me,"id","transformers.SwinModel"),c(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Me,"href","#transformers.SwinModel"),c(ee,"class","relative group"),c(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ut,"rel","nofollow"),c(uo,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinModel"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Se,"id","transformers.SwinForMaskedImageModeling"),c(Se,"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"),c(Se,"href","#transformers.SwinForMaskedImageModeling"),c(oe,"class","relative group"),c(vt,"href","https://arxiv.org/abs/2111.09886"),c(vt,"rel","nofollow"),c(Mt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Mt,"rel","nofollow"),c(go,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinForMaskedImageModeling"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ie,"id","transformers.SwinForImageClassification"),c(Ie,"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"),c(Ie,"href","#transformers.SwinForImageClassification"),c(ne,"class","relative group"),c(kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(kt,"rel","nofollow"),c(wo,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.SwinForImageClassification"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ue,"id","transformers.TFSwinModel"),c(Ue,"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"),c(Ue,"href","#transformers.TFSwinModel"),c(re,"class","relative group"),c(Ut,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(Ut,"rel","nofollow"),c(_o,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.TFSwinModel"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ze,"id","transformers.TFSwinForMaskedImageModeling"),c(Ze,"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"),c(Ze,"href","#transformers.TFSwinForMaskedImageModeling"),c(ie,"class","relative group"),c(Nt,"href","https://arxiv.org/abs/2111.09886"),c(Nt,"rel","nofollow"),c(xt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(xt,"rel","nofollow"),c(bo,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.TFSwinForMaskedImageModeling"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ze,"id","transformers.TFSwinForImageClassification"),c(ze,"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"),c(ze,"href","#transformers.TFSwinForImageClassification"),c(pe,"class","relative group"),c(At,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(At,"rel","nofollow"),c(vo,"href","/docs/transformers/v4.32.0/en/model_doc/swin#transformers.TFSwinForImageClassification"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,d),w(t,b,h),w(t,f,h),e(f,m),e(m,_),M(s,_,null),e(f,p),e(f,k),e(k,Tn),w(t,ks,h),w(t,H,h),e(H,me),e(me,Jo),M(Le,Jo,null),e(H,$n),e(H,Zo),e(Zo,Sn),w(t,js,h),w(t,fe,h),e(fe,Fn),e(fe,Oe),e(Oe,kn),e(fe,jn),w(t,Is,h),w(t,Ot,h),e(Ot,In),w(t,Es,h),w(t,Kt,h),e(Kt,No),e(No,En),w(t,Cs,h),w(t,eo,h),e(eo,Cn),w(t,Us,h),w(t,V,h),e(V,Ke),e(Ke,Un),e(Ke,to),e(to,Wn),e(Ke,Jn),e(V,Zn),e(V,et),e(et,Nn),e(et,xo),e(xo,xn),e(et,zn),e(V,Gn),e(V,j),e(j,Bn),e(j,zo),e(zo,Rn),e(j,An),e(j,Go),e(Go,Xn),e(j,Pn),e(j,Bo),e(Bo,Vn),e(j,Yn),e(j,Ro),e(Ro,qn),e(j,Qn),e(j,Ao),e(Ao,Hn),e(j,Dn),e(j,Xo),e(Xo,Ln),e(j,On),e(j,Po),e(Po,Kn),e(j,ea),w(t,Ws,h),w(t,ue,h),w(t,Js,h),w(t,ge,h),e(ge,ta),e(ge,oo),e(oo,oa),e(ge,sa),w(t,Zs,h),w(t,Z,h),e(Z,na),e(Z,tt),e(tt,aa),e(Z,ra),e(Z,ot),e(ot,la),e(Z,ia),e(Z,st),e(st,da),e(Z,ca),w(t,Ns,h),w(t,D,h),e(D,we),e(we,Vo),M(nt,Vo,null),e(D,pa),e(D,Yo),e(Yo,ha),w(t,xs,h),w(t,so,h),e(so,ma),w(t,zs,h),M(at,t,h),w(t,Gs,h),w(t,_e,h),e(_e,Y),e(Y,no),e(no,fa),e(Y,ua),e(Y,rt),e(rt,ga),e(Y,wa),e(Y,lt),e(lt,_a),e(Y,ba),e(_e,va),e(_e,ao),e(ao,ya),e(ao,ro),e(ro,Ma),w(t,Bs,h),w(t,lo,h),e(lo,Ta),w(t,Rs,h),w(t,io,h),e(io,be),e(be,co),e(co,$a),e(be,Sa),e(be,it),e(it,Fa),e(be,ka),w(t,As,h),w(t,po,h),e(po,ja),w(t,Xs,h),w(t,L,h),e(L,ve),e(ve,qo),M(dt,qo,null),e(L,Ia),e(L,Qo),e(Qo,Ea),w(t,Ps,h),w(t,C,h),M(ct,C,null),e(C,Ca),e(C,O),e(O,Ua),e(O,ho),e(ho,Wa),e(O,Ja),e(O,pt),e(pt,Za),e(O,Na),e(C,xa),e(C,K),e(K,za),e(K,mo),e(mo,Ga),e(K,Ba),e(K,fo),e(fo,Ra),e(K,Aa),e(C,Xa),M(ye,C,null),w(t,Vs,h),w(t,ee,h),e(ee,Me),e(Me,Ho),M(ht,Ho,null),e(ee,Pa),e(ee,Do),e(Do,Va),w(t,Ys,h),w(t,A,h),M(mt,A,null),e(A,Ya),e(A,ft),e(ft,qa),e(ft,ut),e(ut,Qa),e(ft,Ha),e(A,Da),e(A,N),M(gt,N,null),e(N,La),e(N,te),e(te,Oa),e(te,uo),e(uo,Ka),e(te,er),e(te,Lo),e(Lo,tr),e(te,or),e(N,sr),M(Te,N,null),e(N,nr),M($e,N,null),w(t,qs,h),w(t,oe,h),e(oe,Se),e(Se,Oo),M(wt,Oo,null),e(oe,ar),e(oe,Ko),e(Ko,rr),w(t,Qs,h),w(t,E,h),M(_t,E,null),e(E,lr),e(E,bt),e(bt,ir),e(bt,vt),e(vt,dr),e(bt,cr),e(E,pr),M(Fe,E,null),e(E,hr),e(E,yt),e(yt,mr),e(yt,Mt),e(Mt,fr),e(yt,ur),e(E,gr),e(E,x),M(Tt,x,null),e(x,wr),e(x,se),e(se,_r),e(se,go),e(go,br),e(se,vr),e(se,es),e(es,yr),e(se,Mr),e(x,Tr),M(ke,x,null),e(x,$r),M(je,x,null),w(t,Hs,h),w(t,ne,h),e(ne,Ie),e(Ie,ts),M($t,ts,null),e(ne,Sr),e(ne,os),e(os,Fr),w(t,Ds,h),w(t,U,h),M(St,U,null),e(U,kr),e(U,ss),e(ss,jr),e(U,Ir),e(U,Ft),e(Ft,Er),e(Ft,kt),e(kt,Cr),e(Ft,Ur),e(U,Wr),e(U,z),M(jt,z,null),e(z,Jr),e(z,ae),e(ae,Zr),e(ae,wo),e(wo,Nr),e(ae,xr),e(ae,ns),e(ns,zr),e(ae,Gr),e(z,Br),M(Ee,z,null),e(z,Rr),M(Ce,z,null),w(t,Ls,h),w(t,re,h),e(re,Ue),e(Ue,as),M(It,as,null),e(re,Ar),e(re,rs),e(rs,Xr),w(t,Os,h),w(t,X,h),M(Et,X,null),e(X,Pr),e(X,Ct),e(Ct,Vr),e(Ct,Ut),e(Ut,Yr),e(Ct,qr),e(X,Qr),e(X,G),M(Wt,G,null),e(G,Hr),e(G,le),e(le,Dr),e(le,_o),e(_o,Lr),e(le,Or),e(le,ls),e(ls,Kr),e(le,el),e(G,tl),M(We,G,null),e(G,ol),M(Je,G,null),w(t,Ks,h),w(t,ie,h),e(ie,Ze),e(Ze,is),M(Jt,is,null),e(ie,sl),e(ie,ds),e(ds,nl),w(t,en,h),w(t,P,h),M(Zt,P,null),e(P,al),e(P,de),e(de,rl),e(de,Nt),e(Nt,ll),e(de,il),e(de,xt),e(xt,dl),e(de,cl),e(P,pl),e(P,B),M(zt,B,null),e(B,hl),e(B,ce),e(ce,ml),e(ce,bo),e(bo,fl),e(ce,ul),e(ce,cs),e(cs,gl),e(ce,wl),e(B,_l),M(Ne,B,null),e(B,bl),M(xe,B,null),w(t,tn,h),w(t,pe,h),e(pe,ze),e(ze,ps),M(Gt,ps,null),e(pe,vl),e(pe,hs),e(hs,yl),w(t,on,h),w(t,W,h),M(Bt,W,null),e(W,Ml),e(W,ms),e(ms,Tl),e(W,$l),e(W,Rt),e(Rt,Sl),e(Rt,At),e(At,Fl),e(Rt,kl),e(W,jl),e(W,R),M(Xt,R,null),e(R,Il),e(R,he),e(he,El),e(he,vo),e(vo,Cl),e(he,Ul),e(he,fs),e(fs,Wl),e(he,Jl),e(R,Zl),M(Ge,R,null),e(R,Nl),M(Be,R,null),sn=!0},p(t,[h]){const Pt={};h&2&&(Pt.$$scope={dirty:h,ctx:t}),ye.$set(Pt);const us={};h&2&&(us.$$scope={dirty:h,ctx:t}),Te.$set(us);const gs={};h&2&&(gs.$$scope={dirty:h,ctx:t}),$e.$set(gs);const ws={};h&2&&(ws.$$scope={dirty:h,ctx:t}),Fe.$set(ws);const Vt={};h&2&&(Vt.$$scope={dirty:h,ctx:t}),ke.$set(Vt);const _s={};h&2&&(_s.$$scope={dirty:h,ctx:t}),je.$set(_s);const bs={};h&2&&(bs.$$scope={dirty:h,ctx:t}),Ee.$set(bs);const vs={};h&2&&(vs.$$scope={dirty:h,ctx:t}),Ce.$set(vs);const Yt={};h&2&&(Yt.$$scope={dirty:h,ctx:t}),We.$set(Yt);const ys={};h&2&&(ys.$$scope={dirty:h,ctx:t}),Je.$set(ys);const Ms={};h&2&&(Ms.$$scope={dirty:h,ctx:t}),Ne.$set(Ms);const Ts={};h&2&&(Ts.$$scope={dirty:h,ctx:t}),xe.$set(Ts);const $s={};h&2&&($s.$$scope={dirty:h,ctx:t}),Ge.$set($s);const Ss={};h&2&&(Ss.$$scope={dirty:h,ctx:t}),Be.$set(Ss)},i(t){sn||(T(s.$$.fragment,t),T(Le.$$.fragment,t),T(nt.$$.fragment,t),T(at.$$.fragment,t),T(dt.$$.fragment,t),T(ct.$$.fragment,t),T(ye.$$.fragment,t),T(ht.$$.fragment,t),T(mt.$$.fragment,t),T(gt.$$.fragment,t),T(Te.$$.fragment,t),T($e.$$.fragment,t),T(wt.$$.fragment,t),T(_t.$$.fragment,t),T(Fe.$$.fragment,t),T(Tt.$$.fragment,t),T(ke.$$.fragment,t),T(je.$$.fragment,t),T($t.$$.fragment,t),T(St.$$.fragment,t),T(jt.$$.fragment,t),T(Ee.$$.fragment,t),T(Ce.$$.fragment,t),T(It.$$.fragment,t),T(Et.$$.fragment,t),T(Wt.$$.fragment,t),T(We.$$.fragment,t),T(Je.$$.fragment,t),T(Jt.$$.fragment,t),T(Zt.$$.fragment,t),T(zt.$$.fragment,t),T(Ne.$$.fragment,t),T(xe.$$.fragment,t),T(Gt.$$.fragment,t),T(Bt.$$.fragment,t),T(Xt.$$.fragment,t),T(Ge.$$.fragment,t),T(Be.$$.fragment,t),sn=!0)},o(t){$(s.$$.fragment,t),$(Le.$$.fragment,t),$(nt.$$.fragment,t),$(at.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(ye.$$.fragment,t),$(ht.$$.fragment,t),$(mt.$$.fragment,t),$(gt.$$.fragment,t),$(Te.$$.fragment,t),$($e.$$.fragment,t),$(wt.$$.fragment,t),$(_t.$$.fragment,t),$(Fe.$$.fragment,t),$(Tt.$$.fragment,t),$(ke.$$.fragment,t),$(je.$$.fragment,t),$($t.$$.fragment,t),$(St.$$.fragment,t),$(jt.$$.fragment,t),$(Ee.$$.fragment,t),$(Ce.$$.fragment,t),$(It.$$.fragment,t),$(Et.$$.fragment,t),$(Wt.$$.fragment,t),$(We.$$.fragment,t),$(Je.$$.fragment,t),$(Jt.$$.fragment,t),$(Zt.$$.fragment,t),$(zt.$$.fragment,t),$(Ne.$$.fragment,t),$(xe.$$.fragment,t),$(Gt.$$.fragment,t),$(Bt.$$.fragment,t),$(Xt.$$.fragment,t),$(Ge.$$.fragment,t),$(Be.$$.fragment,t),sn=!1},d(t){o(d),t&&o(b),t&&o(f),S(s),t&&o(ks),t&&o(H),S(Le),t&&o(js),t&&o(fe),t&&o(Is),t&&o(Ot),t&&o(Es),t&&o(Kt),t&&o(Cs),t&&o(eo),t&&o(Us),t&&o(V),t&&o(Ws),t&&o(ue),t&&o(Js),t&&o(ge),t&&o(Zs),t&&o(Z),t&&o(Ns),t&&o(D),S(nt),t&&o(xs),t&&o(so),t&&o(zs),S(at,t),t&&o(Gs),t&&o(_e),t&&o(Bs),t&&o(lo),t&&o(Rs),t&&o(io),t&&o(As),t&&o(po),t&&o(Xs),t&&o(L),S(dt),t&&o(Ps),t&&o(C),S(ct),S(ye),t&&o(Vs),t&&o(ee),S(ht),t&&o(Ys),t&&o(A),S(mt),S(gt),S(Te),S($e),t&&o(qs),t&&o(oe),S(wt),t&&o(Qs),t&&o(E),S(_t),S(Fe),S(Tt),S(ke),S(je),t&&o(Hs),t&&o(ne),S($t),t&&o(Ds),t&&o(U),S(St),S(jt),S(Ee),S(Ce),t&&o(Ls),t&&o(re),S(It),t&&o(Os),t&&o(X),S(Et),S(Wt),S(We),S(Je),t&&o(Ks),t&&o(ie),S(Jt),t&&o(en),t&&o(P),S(Zt),S(zt),S(Ne),S(xe),t&&o(tn),t&&o(pe),S(Gt),t&&o(on),t&&o(W),S(Bt),S(Xt),S(Ge),S(Be)}}}const Fd={local:"swin-transformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.SwinConfig",title:"SwinConfig"},{local:"transformers.SwinModel",title:"SwinModel"},{local:"transformers.SwinForMaskedImageModeling",title:"SwinForMaskedImageModeling"},{local:"transformers.SwinForImageClassification",title:"SwinForImageClassification"},{local:"transformers.TFSwinModel",title:"TFSwinModel"},{local:"transformers.TFSwinForMaskedImageModeling",title:"TFSwinForMaskedImageModeling"},{local:"transformers.TFSwinForImageClassification",title:"TFSwinForImageClassification"}],title:"Swin Transformer"};function kd(F){return dd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zd extends nd{constructor(d){super();ad(this,d,kd,Sd,rd,{})}}export{Zd as default,Fd as metadata};
