import{s as ko,f as Fo,o as Wo,n as Xe}from"../chunks/scheduler.9bc65507.js";import{S as Uo,i as Eo,g as a,s as i,u as _,A as zo,h as s,f as t,c as d,j as u,v as b,y as f,k as p,o as c,a as n,w as v,d as w,t as y,x as T}from"../chunks/index.78c82d43.js";import{T as Jo}from"../chunks/Tip.87d55b76.js";import{D as Ye}from"../chunks/Docstring.4e7352e2.js";import{C as Bt}from"../chunks/CodeBlock.73e038be.js";import{I as Ae}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Vt}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as Zo}from"../chunks/PipelineTag.75b0f707.js";function Ao(x){let l,M="Example:",h,m,g;return m=new Bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5hdENvbmZpZyUyQyUyME5hdE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME5hdCUyMHNoaS1sYWJzJTJGbmF0LW1pbmktaW4xay0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTmF0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMHNoaS1sYWJzJTJGbmF0LW1pbmktaW4xay0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyME5hdE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NatConfig, NatModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Nat shi-labs/nat-mini-in1k-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = NatConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the shi-labs/nat-mini-in1k-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NatModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){l=a("p"),l.textContent=M,h=i(),_(m.$$.fragment)},l(r){l=s(r,"P",{"data-svelte-h":!0}),f(l)!=="svelte-11lpom8"&&(l.textContent=M),h=d(r),b(m.$$.fragment,r)},m(r,N){n(r,l,N),n(r,h,N),v(m,r,N),g=!0},p:Xe,i(r){g||(w(m.$$.fragment,r),g=!0)},o(r){y(m.$$.fragment,r),g=!1},d(r){r&&(t(l),t(h)),T(m,r)}}}function Ho(x){let l,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){l=a("p"),l.innerHTML=M},l(h){l=s(h,"P",{"data-svelte-h":!0}),f(l)!=="svelte-fincs2"&&(l.innerHTML=M)},m(h,m){n(h,l,m)},p:Xe,d(h){h&&t(l)}}}function So(x){let l,M="Example:",h,m,g;return m=new Bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME5hdE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzaGktbGFicyUyRm5hdC1taW5pLWluMWstMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwTmF0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnNoaS1sYWJzJTJGbmF0LW1pbmktaW4xay0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, NatModel
<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;shi-labs/nat-mini-in1k-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NatModel.from_pretrained(<span class="hljs-string">&quot;shi-labs/nat-mini-in1k-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">7</span>, <span class="hljs-number">7</span>, <span class="hljs-number">512</span>]`,wrap:!1}}),{c(){l=a("p"),l.textContent=M,h=i(),_(m.$$.fragment)},l(r){l=s(r,"P",{"data-svelte-h":!0}),f(l)!=="svelte-11lpom8"&&(l.textContent=M),h=d(r),b(m.$$.fragment,r)},m(r,N){n(r,l,N),n(r,h,N),v(m,r,N),g=!0},p:Xe,i(r){g||(w(m.$$.fragment,r),g=!0)},o(r){y(m.$$.fragment,r),g=!1},d(r){r&&(t(l),t(h)),T(m,r)}}}function Po(x){let l,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){l=a("p"),l.innerHTML=M},l(h){l=s(h,"P",{"data-svelte-h":!0}),f(l)!=="svelte-fincs2"&&(l.innerHTML=M)},m(h,m){n(h,l,m)},p:Xe,d(h){h&&t(l)}}}function Go(x){let l,M="Example:",h,m,g;return m=new Bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyME5hdEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMnNoaS1sYWJzJTJGbmF0LW1pbmktaW4xay0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBOYXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzaGktbGFicyUyRm5hdC1taW5pLWluMWstMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, NatForImageClassification
<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;shi-labs/nat-mini-in1k-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NatForImageClassification.from_pretrained(<span class="hljs-string">&quot;shi-labs/nat-mini-in1k-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])
tiger cat`,wrap:!1}}),{c(){l=a("p"),l.textContent=M,h=i(),_(m.$$.fragment)},l(r){l=s(r,"P",{"data-svelte-h":!0}),f(l)!=="svelte-11lpom8"&&(l.textContent=M),h=d(r),b(m.$$.fragment,r)},m(r,N){n(r,l,N),n(r,h,N),v(m,r,N),g=!0},p:Xe,i(r){g||(w(m.$$.fragment,r),g=!0)},o(r){y(m.$$.fragment,r),g=!1},d(r){r&&(t(l),t(h)),T(m,r)}}}function Lo(x){let l,M,h,m,g,r,N,O,$t,Ne,Rt="Neighborhood Attention Transformer",Qe,k,z,He,D,Ct,$e,Yt="Overview",Oe,K,Xt=`NAT was proposed in <a href="https://arxiv.org/abs/2204.07143" rel="nofollow">Neighborhood Attention Transformer</a>
by Ali Hassani, Steven Walton, Jiachen Li, Shen Li, and Humphrey Shi.`,De,ee,Qt="It is a hierarchical vision transformer based on Neighborhood Attention, a sliding-window self attention pattern.",Ke,te,Ot="The abstract from the paper is the following:",et,oe,Dt=`<em>We present Neighborhood Attention (NA), the first efficient and scalable sliding-window attention mechanism for vision.
NA is a pixel-wise operation, localizing self attention (SA) to the nearest neighboring pixels, and therefore enjoys a
linear time and space complexity compared to the quadratic complexity of SA. The sliding-window pattern allows NA’s
receptive field to grow without needing extra pixel shifts, and preserves translational equivariance, unlike
Swin Transformer’s Window Self Attention (WSA). We develop NATTEN (Neighborhood Attention Extension), a Python package
with efficient C++ and CUDA kernels, which allows NA to run up to 40% faster than Swin’s WSA while using up to 25% less
memory. We further present Neighborhood Attention Transformer (NAT), a new hierarchical transformer design based on NA
that boosts image classification and downstream vision performance. Experimental results on NAT are competitive;
NAT-Tiny reaches 83.2% top-1 accuracy on ImageNet, 51.4% mAP on MS-COCO and 48.4% mIoU on ADE20K, which is 1.9%
ImageNet accuracy, 1.0% COCO mAP, and 2.6% ADE20K mIoU improvement over a Swin model with similar size.</em>`,tt,ne,Kt="Tips:",ot,ae,eo=`<li>One can use the <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> API to prepare images for the model.</li> <li>NAT can be used as a <em>backbone</em>. When <code>output_hidden_states = True</code>,
it will output both <code>hidden_states</code> and <code>reshaped_hidden_states</code>.
The <code>reshaped_hidden_states</code> have a shape of <code>(batch, num_channels, height, width)</code> rather than
<code>(batch_size, height, width, num_channels)</code>.</li>`,nt,se,to="Notes:",at,re,oo=`<li>NAT depends on <a href="https://github.com/SHI-Labs/NATTEN/" rel="nofollow">NATTEN</a>’s implementation of Neighborhood Attention.
You can install it with pre-built wheels for Linux by referring to <a href="https://shi-labs.com/natten" rel="nofollow">shi-labs.com/natten</a>,
or build on your system by running <code>pip install natten</code>.
Note that the latter will likely take time to compile. NATTEN does not support Windows devices yet.</li> <li>Patch size of 4 is only supported at the moment.</li>`,st,Z,no,rt,le,ao=`Neighborhood Attention compared to other attention patterns.
Taken from the <a href="https://arxiv.org/abs/2204.07143">original paper</a>.`,lt,ie,so=`This model was contributed by <a href="https://huggingface.co/alihassanijr" rel="nofollow">Ali Hassani</a>.
The original code can be found <a href="https://github.com/SHI-Labs/Neighborhood-Attention-Transformer" rel="nofollow">here</a>.`,it,F,A,Se,de,xt,Ce,ro="Resources",dt,ce,lo="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with NAT.",ct,pe,pt,he,io='<li><a href="/docs/transformers/v4.34.0/en/model_doc/nat#transformers.NatForImageClassification">NatForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',ht,me,co="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",mt,W,H,Pe,fe,jt,xe,po="NatConfig",ft,$,ue,It,je,ho=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/nat#transformers.NatModel">NatModel</a>. It is used to instantiate a Nat 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 Nat
<a href="https://huggingface.co/shi-labs/nat-mini-in1k-224" rel="nofollow">shi-labs/nat-mini-in1k-224</a> architecture.`,Jt,Ie,mo=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,kt,S,ut,U,P,Ge,ge,Ft,Je,fo="NatModel",gt,J,_e,Wt,ke,uo=`The bare Nat Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Ut,j,be,Et,Fe,go='The <a href="/docs/transformers/v4.34.0/en/model_doc/nat#transformers.NatModel">NatModel</a> forward method, overrides the <code>__call__</code> special method.',zt,G,Zt,L,_t,E,q,Le,ve,At,We,_o="NatForImageClassification",bt,C,we,Ht,Ue,bo=`Nat 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.`,St,Ee,vo=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Pt,I,ye,Gt,ze,wo='The <a href="/docs/transformers/v4.34.0/en/model_doc/nat#transformers.NatForImageClassification">NatForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Lt,V,qt,B,vt,qe,wt;return O=new Ae({}),D=new Ae({}),de=new Ae({}),pe=new Zo({props:{pipeline:"image-classification"}}),fe=new Ae({}),ue=new Ye({props:{name:"class transformers.NatConfig",anchor:"transformers.NatConfig",parameters:[{name:"patch_size",val:" = 4"},{name:"num_channels",val:" = 3"},{name:"embed_dim",val:" = 64"},{name:"depths",val:" = [3, 4, 6, 5]"},{name:"num_heads",val:" = [2, 4, 8, 16]"},{name:"kernel_size",val:" = 7"},{name:"mlp_ratio",val:" = 3.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:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"layer_scale_init_value",val:" = 0.0"},{name:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NatConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size (resolution) of each patch. NOTE: Only patch size of 4 is supported at the moment.`,name:"patch_size"},{anchor:"transformers.NatConfig.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.NatConfig.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality of patch embedding.`,name:"embed_dim"},{anchor:"transformers.NatConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 2, 6, 2]</code>) &#x2014;
Number of layers in each level of the encoder.`,name:"depths"},{anchor:"transformers.NatConfig.num_heads",description:`<strong>num_heads</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 6, 12, 24]</code>) &#x2014;
Number of attention heads in each layer of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.NatConfig.kernel_size",description:`<strong>kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 7) &#x2014;
Neighborhood Attention kernel size.`,name:"kernel_size"},{anchor:"transformers.NatConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 3.0) &#x2014;
Ratio of MLP hidden dimensionality to embedding dimensionality.`,name:"mlp_ratio"},{anchor:"transformers.NatConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not a learnable bias should be added to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.NatConfig.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.NatConfig.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.NatConfig.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.NatConfig.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.NatConfig.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.NatConfig.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.NatConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The initial value for the layer scale. Disabled if &lt;=0.`,name:"layer_scale_init_value"},{anchor:"transformers.NatConfig.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.NatConfig.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.34.0/src/transformers/models/nat/configuration_nat.py#L30"}}),S=new Vt({props:{anchor:"transformers.NatConfig.example",$$slots:{default:[Ao]},$$scope:{ctx:x}}}),ge=new Ae({}),_e=new Ye({props:{name:"class transformers.NatModel",anchor:"transformers.NatModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.NatModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/nat#transformers.NatConfig">NatConfig</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.34.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.34.0/src/transformers/models/nat/modeling_nat.py#L678"}}),be=new Ye({props:{name:"forward",anchor:"transformers.NatModel.forward",parameters:[{name:"pixel_values",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.NatModel.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.NatModel.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.NatModel.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.NatModel.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/nat/modeling_nat.py#L708",returnDescription:`
<p>A <code>transformers.models.nat.modeling_nat.NatModelOutput</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.34.0/en/model_doc/nat#transformers.NatConfig"
>NatConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>, <em>optional</em>, returned when <code>add_pooling_layer=True</code> is passed) — Average pooling of the last layer hidden-state.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>reshaped_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.nat.modeling_nat.NatModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),G=new Jo({props:{$$slots:{default:[Ho]},$$scope:{ctx:x}}}),L=new Vt({props:{anchor:"transformers.NatModel.forward.example",$$slots:{default:[So]},$$scope:{ctx:x}}}),ve=new Ae({}),we=new Ye({props:{name:"class transformers.NatForImageClassification",anchor:"transformers.NatForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NatForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/nat#transformers.NatConfig">NatConfig</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.34.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.34.0/src/transformers/models/nat/modeling_nat.py#L770"}}),ye=new Ye({props:{name:"forward",anchor:"transformers.NatForImageClassification.forward",parameters:[{name:"pixel_values",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.NatForImageClassification.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.NatForImageClassification.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.NatForImageClassification.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.NatForImageClassification.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NatForImageClassification.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.34.0/src/transformers/models/nat/modeling_nat.py#L787",returnDescription:`
<p>A <code>transformers.models.nat.modeling_nat.NatImageClassifierOutput</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.34.0/en/model_doc/nat#transformers.NatConfig"
>NatConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>reshaped_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, hidden_size, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.nat.modeling_nat.NatImageClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),V=new Jo({props:{$$slots:{default:[Po]},$$scope:{ctx:x}}}),B=new Vt({props:{anchor:"transformers.NatForImageClassification.forward.example",$$slots:{default:[Go]},$$scope:{ctx:x}}}),{c(){l=a("meta"),M=i(),h=a("p"),m=i(),g=a("h1"),r=a("a"),N=a("span"),_(O.$$.fragment),$t=i(),Ne=a("span"),Ne.textContent=Rt,Qe=i(),k=a("h2"),z=a("a"),He=a("span"),_(D.$$.fragment),Ct=i(),$e=a("span"),$e.textContent=Yt,Oe=i(),K=a("p"),K.innerHTML=Xt,De=i(),ee=a("p"),ee.textContent=Qt,Ke=i(),te=a("p"),te.textContent=Ot,et=i(),oe=a("p"),oe.innerHTML=Dt,tt=i(),ne=a("p"),ne.textContent=Kt,ot=i(),ae=a("ul"),ae.innerHTML=eo,nt=i(),se=a("p"),se.textContent=to,at=i(),re=a("ul"),re.innerHTML=oo,st=i(),Z=a("img"),rt=i(),le=a("small"),le.innerHTML=ao,lt=i(),ie=a("p"),ie.innerHTML=so,it=i(),F=a("h2"),A=a("a"),Se=a("span"),_(de.$$.fragment),xt=i(),Ce=a("span"),Ce.textContent=ro,dt=i(),ce=a("p"),ce.textContent=lo,ct=i(),_(pe.$$.fragment),pt=i(),he=a("ul"),he.innerHTML=io,ht=i(),me=a("p"),me.textContent=co,mt=i(),W=a("h2"),H=a("a"),Pe=a("span"),_(fe.$$.fragment),jt=i(),xe=a("span"),xe.textContent=po,ft=i(),$=a("div"),_(ue.$$.fragment),It=i(),je=a("p"),je.innerHTML=ho,Jt=i(),Ie=a("p"),Ie.innerHTML=mo,kt=i(),_(S.$$.fragment),ut=i(),U=a("h2"),P=a("a"),Ge=a("span"),_(ge.$$.fragment),Ft=i(),Je=a("span"),Je.textContent=fo,gt=i(),J=a("div"),_(_e.$$.fragment),Wt=i(),ke=a("p"),ke.innerHTML=uo,Ut=i(),j=a("div"),_(be.$$.fragment),Et=i(),Fe=a("p"),Fe.innerHTML=go,zt=i(),_(G.$$.fragment),Zt=i(),_(L.$$.fragment),_t=i(),E=a("h2"),q=a("a"),Le=a("span"),_(ve.$$.fragment),At=i(),We=a("span"),We.textContent=_o,bt=i(),C=a("div"),_(we.$$.fragment),Ht=i(),Ue=a("p"),Ue.textContent=bo,St=i(),Ee=a("p"),Ee.innerHTML=vo,Pt=i(),I=a("div"),_(ye.$$.fragment),Gt=i(),ze=a("p"),ze.innerHTML=wo,Lt=i(),_(V.$$.fragment),qt=i(),_(B.$$.fragment),vt=i(),qe=a("p"),this.h()},l(e){const o=zo("svelte-1phssyn",document.head);l=s(o,"META",{name:!0,content:!0}),o.forEach(t),M=d(e),h=s(e,"P",{}),u(h).forEach(t),m=d(e),g=s(e,"H1",{class:!0});var Te=u(g);r=s(Te,"A",{id:!0,class:!0,href:!0});var Ve=u(r);N=s(Ve,"SPAN",{});var Be=u(N);b(O.$$.fragment,Be),Be.forEach(t),Ve.forEach(t),$t=d(Te),Ne=s(Te,"SPAN",{"data-svelte-h":!0}),f(Ne)!=="svelte-9rbnly"&&(Ne.textContent=Rt),Te.forEach(t),Qe=d(e),k=s(e,"H2",{class:!0});var Me=u(k);z=s(Me,"A",{id:!0,class:!0,href:!0});var Re=u(z);He=s(Re,"SPAN",{});var yo=u(He);b(D.$$.fragment,yo),yo.forEach(t),Re.forEach(t),Ct=d(Me),$e=s(Me,"SPAN",{"data-svelte-h":!0}),f($e)!=="svelte-1jsw1pg"&&($e.textContent=Yt),Me.forEach(t),Oe=d(e),K=s(e,"P",{"data-svelte-h":!0}),f(K)!=="svelte-1c1uj9k"&&(K.innerHTML=Xt),De=d(e),ee=s(e,"P",{"data-svelte-h":!0}),f(ee)!=="svelte-1e8auh6"&&(ee.textContent=Qt),Ke=d(e),te=s(e,"P",{"data-svelte-h":!0}),f(te)!=="svelte-vfdo9a"&&(te.textContent=Ot),et=d(e),oe=s(e,"P",{"data-svelte-h":!0}),f(oe)!=="svelte-7imk69"&&(oe.innerHTML=Dt),tt=d(e),ne=s(e,"P",{"data-svelte-h":!0}),f(ne)!=="svelte-axv494"&&(ne.textContent=Kt),ot=d(e),ae=s(e,"UL",{"data-svelte-h":!0}),f(ae)!=="svelte-9vcau9"&&(ae.innerHTML=eo),nt=d(e),se=s(e,"P",{"data-svelte-h":!0}),f(se)!=="svelte-1biq3pv"&&(se.textContent=to),at=d(e),re=s(e,"UL",{"data-svelte-h":!0}),f(re)!=="svelte-5cm23e"&&(re.innerHTML=oo),st=d(e),Z=s(e,"IMG",{src:!0,alt:!0,width:!0}),rt=d(e),le=s(e,"SMALL",{"data-svelte-h":!0}),f(le)!=="svelte-w8g6gd"&&(le.innerHTML=ao),lt=d(e),ie=s(e,"P",{"data-svelte-h":!0}),f(ie)!=="svelte-1emlw2j"&&(ie.innerHTML=so),it=d(e),F=s(e,"H2",{class:!0});var yt=u(F);A=s(yt,"A",{id:!0,class:!0,href:!0});var To=u(A);Se=s(To,"SPAN",{});var Mo=u(Se);b(de.$$.fragment,Mo),Mo.forEach(t),To.forEach(t),xt=d(yt),Ce=s(yt,"SPAN",{"data-svelte-h":!0}),f(Ce)!=="svelte-w4zzv6"&&(Ce.textContent=ro),yt.forEach(t),dt=d(e),ce=s(e,"P",{"data-svelte-h":!0}),f(ce)!=="svelte-nwqm6q"&&(ce.textContent=lo),ct=d(e),b(pe.$$.fragment,e),pt=d(e),he=s(e,"UL",{"data-svelte-h":!0}),f(he)!=="svelte-1jy9w5y"&&(he.innerHTML=io),ht=d(e),me=s(e,"P",{"data-svelte-h":!0}),f(me)!=="svelte-1xesile"&&(me.textContent=co),mt=d(e),W=s(e,"H2",{class:!0});var Tt=u(W);H=s(Tt,"A",{id:!0,class:!0,href:!0});var No=u(H);Pe=s(No,"SPAN",{});var $o=u(Pe);b(fe.$$.fragment,$o),$o.forEach(t),No.forEach(t),jt=d(Tt),xe=s(Tt,"SPAN",{"data-svelte-h":!0}),f(xe)!=="svelte-fkqi22"&&(xe.textContent=po),Tt.forEach(t),ft=d(e),$=s(e,"DIV",{class:!0});var R=u($);b(ue.$$.fragment,R),It=d(R),je=s(R,"P",{"data-svelte-h":!0}),f(je)!=="svelte-h3hh8g"&&(je.innerHTML=ho),Jt=d(R),Ie=s(R,"P",{"data-svelte-h":!0}),f(Ie)!=="svelte-10kqkkl"&&(Ie.innerHTML=mo),kt=d(R),b(S.$$.fragment,R),R.forEach(t),ut=d(e),U=s(e,"H2",{class:!0});var Mt=u(U);P=s(Mt,"A",{id:!0,class:!0,href:!0});var Co=u(P);Ge=s(Co,"SPAN",{});var xo=u(Ge);b(ge.$$.fragment,xo),xo.forEach(t),Co.forEach(t),Ft=d(Mt),Je=s(Mt,"SPAN",{"data-svelte-h":!0}),f(Je)!=="svelte-1jp9a8t"&&(Je.textContent=fo),Mt.forEach(t),gt=d(e),J=s(e,"DIV",{class:!0});var Ze=u(J);b(_e.$$.fragment,Ze),Wt=d(Ze),ke=s(Ze,"P",{"data-svelte-h":!0}),f(ke)!=="svelte-dglxjv"&&(ke.innerHTML=uo),Ut=d(Ze),j=s(Ze,"DIV",{class:!0});var Y=u(j);b(be.$$.fragment,Y),Et=d(Y),Fe=s(Y,"P",{"data-svelte-h":!0}),f(Fe)!=="svelte-1wh37rk"&&(Fe.innerHTML=go),zt=d(Y),b(G.$$.fragment,Y),Zt=d(Y),b(L.$$.fragment,Y),Y.forEach(t),Ze.forEach(t),_t=d(e),E=s(e,"H2",{class:!0});var Nt=u(E);q=s(Nt,"A",{id:!0,class:!0,href:!0});var jo=u(q);Le=s(jo,"SPAN",{});var Io=u(Le);b(ve.$$.fragment,Io),Io.forEach(t),jo.forEach(t),At=d(Nt),We=s(Nt,"SPAN",{"data-svelte-h":!0}),f(We)!=="svelte-1rxs4ms"&&(We.textContent=_o),Nt.forEach(t),bt=d(e),C=s(e,"DIV",{class:!0});var X=u(C);b(we.$$.fragment,X),Ht=d(X),Ue=s(X,"P",{"data-svelte-h":!0}),f(Ue)!=="svelte-100sr6y"&&(Ue.textContent=bo),St=d(X),Ee=s(X,"P",{"data-svelte-h":!0}),f(Ee)!=="svelte-68lg8f"&&(Ee.innerHTML=vo),Pt=d(X),I=s(X,"DIV",{class:!0});var Q=u(I);b(ye.$$.fragment,Q),Gt=d(Q),ze=s(Q,"P",{"data-svelte-h":!0}),f(ze)!=="svelte-efe74o"&&(ze.innerHTML=wo),Lt=d(Q),b(V.$$.fragment,Q),qt=d(Q),b(B.$$.fragment,Q),Q.forEach(t),X.forEach(t),vt=d(e),qe=s(e,"P",{}),u(qe).forEach(t),this.h()},h(){p(l,"name","hf:doc:metadata"),p(l,"content",JSON.stringify(qo)),p(r,"id","neighborhood-attention-transformer"),p(r,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(r,"href","#neighborhood-attention-transformer"),p(g,"class","relative group"),p(z,"id","overview"),p(z,"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"),p(z,"href","#overview"),p(k,"class","relative group"),Fo(Z.src,no="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/neighborhood-attention-pattern.jpg")||p(Z,"src",no),p(Z,"alt","drawing"),p(Z,"width","600"),p(A,"id","resources"),p(A,"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"),p(A,"href","#resources"),p(F,"class","relative group"),p(H,"id","transformers.NatConfig"),p(H,"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"),p(H,"href","#transformers.NatConfig"),p(W,"class","relative group"),p($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"id","transformers.NatModel"),p(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(P,"href","#transformers.NatModel"),p(U,"class","relative group"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(q,"id","transformers.NatForImageClassification"),p(q,"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"),p(q,"href","#transformers.NatForImageClassification"),p(E,"class","relative group"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){c(document.head,l),n(e,M,o),n(e,h,o),n(e,m,o),n(e,g,o),c(g,r),c(r,N),v(O,N,null),c(g,$t),c(g,Ne),n(e,Qe,o),n(e,k,o),c(k,z),c(z,He),v(D,He,null),c(k,Ct),c(k,$e),n(e,Oe,o),n(e,K,o),n(e,De,o),n(e,ee,o),n(e,Ke,o),n(e,te,o),n(e,et,o),n(e,oe,o),n(e,tt,o),n(e,ne,o),n(e,ot,o),n(e,ae,o),n(e,nt,o),n(e,se,o),n(e,at,o),n(e,re,o),n(e,st,o),n(e,Z,o),n(e,rt,o),n(e,le,o),n(e,lt,o),n(e,ie,o),n(e,it,o),n(e,F,o),c(F,A),c(A,Se),v(de,Se,null),c(F,xt),c(F,Ce),n(e,dt,o),n(e,ce,o),n(e,ct,o),v(pe,e,o),n(e,pt,o),n(e,he,o),n(e,ht,o),n(e,me,o),n(e,mt,o),n(e,W,o),c(W,H),c(H,Pe),v(fe,Pe,null),c(W,jt),c(W,xe),n(e,ft,o),n(e,$,o),v(ue,$,null),c($,It),c($,je),c($,Jt),c($,Ie),c($,kt),v(S,$,null),n(e,ut,o),n(e,U,o),c(U,P),c(P,Ge),v(ge,Ge,null),c(U,Ft),c(U,Je),n(e,gt,o),n(e,J,o),v(_e,J,null),c(J,Wt),c(J,ke),c(J,Ut),c(J,j),v(be,j,null),c(j,Et),c(j,Fe),c(j,zt),v(G,j,null),c(j,Zt),v(L,j,null),n(e,_t,o),n(e,E,o),c(E,q),c(q,Le),v(ve,Le,null),c(E,At),c(E,We),n(e,bt,o),n(e,C,o),v(we,C,null),c(C,Ht),c(C,Ue),c(C,St),c(C,Ee),c(C,Pt),c(C,I),v(ye,I,null),c(I,Gt),c(I,ze),c(I,Lt),v(V,I,null),c(I,qt),v(B,I,null),n(e,vt,o),n(e,qe,o),wt=!0},p(e,[o]){const Te={};o&2&&(Te.$$scope={dirty:o,ctx:e}),S.$set(Te);const Ve={};o&2&&(Ve.$$scope={dirty:o,ctx:e}),G.$set(Ve);const Be={};o&2&&(Be.$$scope={dirty:o,ctx:e}),L.$set(Be);const Me={};o&2&&(Me.$$scope={dirty:o,ctx:e}),V.$set(Me);const Re={};o&2&&(Re.$$scope={dirty:o,ctx:e}),B.$set(Re)},i(e){wt||(w(O.$$.fragment,e),w(D.$$.fragment,e),w(de.$$.fragment,e),w(pe.$$.fragment,e),w(fe.$$.fragment,e),w(ue.$$.fragment,e),w(S.$$.fragment,e),w(ge.$$.fragment,e),w(_e.$$.fragment,e),w(be.$$.fragment,e),w(G.$$.fragment,e),w(L.$$.fragment,e),w(ve.$$.fragment,e),w(we.$$.fragment,e),w(ye.$$.fragment,e),w(V.$$.fragment,e),w(B.$$.fragment,e),wt=!0)},o(e){y(O.$$.fragment,e),y(D.$$.fragment,e),y(de.$$.fragment,e),y(pe.$$.fragment,e),y(fe.$$.fragment,e),y(ue.$$.fragment,e),y(S.$$.fragment,e),y(ge.$$.fragment,e),y(_e.$$.fragment,e),y(be.$$.fragment,e),y(G.$$.fragment,e),y(L.$$.fragment,e),y(ve.$$.fragment,e),y(we.$$.fragment,e),y(ye.$$.fragment,e),y(V.$$.fragment,e),y(B.$$.fragment,e),wt=!1},d(e){e&&(t(M),t(h),t(m),t(g),t(Qe),t(k),t(Oe),t(K),t(De),t(ee),t(Ke),t(te),t(et),t(oe),t(tt),t(ne),t(ot),t(ae),t(nt),t(se),t(at),t(re),t(st),t(Z),t(rt),t(le),t(lt),t(ie),t(it),t(F),t(dt),t(ce),t(ct),t(pt),t(he),t(ht),t(me),t(mt),t(W),t(ft),t($),t(ut),t(U),t(gt),t(J),t(_t),t(E),t(bt),t(C),t(vt),t(qe)),t(l),T(O),T(D),T(de),T(pe,e),T(fe),T(ue),T(S),T(ge),T(_e),T(be),T(G),T(L),T(ve),T(we),T(ye),T(V),T(B)}}}const qo={local:"neighborhood-attention-transformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.NatConfig",title:"NatConfig"},{local:"transformers.NatModel",title:"NatModel"},{local:"transformers.NatForImageClassification",title:"NatForImageClassification"}],title:"Neighborhood Attention Transformer"};function Vo(x){return Wo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class en extends Uo{constructor(l){super(),Eo(this,l,Vo,Lo,ko,{})}}export{en as component};
