import{S as In,i as Nn,s as An,e as o,k as f,w,t as r,M as kn,c as n,d as a,m as u,a as s,x as y,h as l,b as d,N as Fn,G as t,g as h,y as $,q as M,o as V,B as T,v as Jn,L as Uo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Zo}from"../../chunks/Tip-hf-doc-builder.js";import{D as Et}from"../../chunks/Docstring-hf-doc-builder.js";import{C as xo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as lt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Wo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Zn}from"../../chunks/PipelineTag-hf-doc-builder.js";function Wn(j){let p,b,_,m,v,i,g,E;return{c(){p=o("p"),b=r("This model is in maintenance mode only, so we won\u2019t accept any new PRs changing its code."),_=f(),m=o("p"),v=r(`If you run into any issues running this model, please reinstall the last version that supported this model: v4.30.0.
You can do so by running the following command: `),i=o("code"),g=r("pip install -U transformers==4.30.0"),E=r(".")},l(C){p=n(C,"P",{});var J=s(p);b=l(J,"This model is in maintenance mode only, so we won\u2019t accept any new PRs changing its code."),J.forEach(a),_=u(C),m=n(C,"P",{});var I=s(m);v=l(I,`If you run into any issues running this model, please reinstall the last version that supported this model: v4.30.0.
You can do so by running the following command: `),i=n(I,"CODE",{});var de=s(i);g=l(de,"pip install -U transformers==4.30.0"),de.forEach(a),E=l(I,"."),I.forEach(a)},m(C,J){h(C,p,J),t(p,b),h(C,_,J),h(C,m,J),t(m,v),t(m,i),t(i,g),t(m,E)},d(C){C&&a(p),C&&a(_),C&&a(m)}}}function Un(j){let p,b,_,m,v;return m=new xo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZhbk1vZGVsJTJDJTIwVmFuQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFZBTiUyMHZhbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFZhbkNvbmZpZygpJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMHZhbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBWYW5Nb2RlbChjb25maWd1cmF0aW9uKSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VanModel, VanConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a VAN van-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = VanConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the van-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VanModel(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(){p=o("p"),b=r("Example:"),_=f(),w(m.$$.fragment)},l(i){p=n(i,"P",{});var g=s(p);b=l(g,"Example:"),g.forEach(a),_=u(i),y(m.$$.fragment,i)},m(i,g){h(i,p,g),t(p,b),h(i,_,g),$(m,i,g),v=!0},p:Uo,i(i){v||(M(m.$$.fragment,i),v=!0)},o(i){V(m.$$.fragment,i),v=!1},d(i){i&&a(p),i&&a(_),T(m,i)}}}function xn(j){let p,b,_,m,v;return{c(){p=o("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),m=r("Module"),v=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(i){p=n(i,"P",{});var g=s(p);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var E=s(_);m=l(E,"Module"),E.forEach(a),v=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(a)},m(i,g){h(i,p,g),t(p,b),t(p,_),t(_,m),t(p,v)},d(i){i&&a(p)}}}function Pn(j){let p,b,_,m,v;return m=new xo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZhbk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJWaXN1YWwtQXR0ZW50aW9uLU5ldHdvcmslMkZ2YW4tYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFZhbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJWaXN1YWwtQXR0ZW50aW9uLU5ldHdvcmslMkZ2YW4tYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VanModel
<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;Visual-Attention-Network/van-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VanModel.from_pretrained(<span class="hljs-string">&quot;Visual-Attention-Network/van-base&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">512</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){p=o("p"),b=r("Example:"),_=f(),w(m.$$.fragment)},l(i){p=n(i,"P",{});var g=s(p);b=l(g,"Example:"),g.forEach(a),_=u(i),y(m.$$.fragment,i)},m(i,g){h(i,p,g),t(p,b),h(i,_,g),$(m,i,g),v=!0},p:Uo,i(i){v||(M(m.$$.fragment,i),v=!0)},o(i){V(m.$$.fragment,i),v=!1},d(i){i&&a(p),i&&a(_),T(m,i)}}}function zn(j){let p,b,_,m,v;return{c(){p=o("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),m=r("Module"),v=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(i){p=n(i,"P",{});var g=s(p);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var E=s(_);m=l(E,"Module"),E.forEach(a),v=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(a)},m(i,g){h(i,p,g),t(p,b),t(p,_),t(_,m),t(p,v)},d(i){i&&a(p)}}}function Gn(j){let p,b,_,m,v;return m=new xo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZhbkZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlZpc3VhbC1BdHRlbnRpb24tTmV0d29yayUyRnZhbi1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVmFuRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyVmlzdWFsLUF0dGVudGlvbi1OZXR3b3JrJTJGdmFuLWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VanForImageClassification
<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;Visual-Attention-Network/van-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VanForImageClassification.from_pretrained(<span class="hljs-string">&quot;Visual-Attention-Network/van-base&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(){p=o("p"),b=r("Example:"),_=f(),w(m.$$.fragment)},l(i){p=n(i,"P",{});var g=s(p);b=l(g,"Example:"),g.forEach(a),_=u(i),y(m.$$.fragment,i)},m(i,g){h(i,p,g),t(p,b),h(i,_,g),$(m,i,g),v=!0},p:Uo,i(i){v||(M(m.$$.fragment,i),v=!0)},o(i){V(m.$$.fragment,i),v=!1},d(i){i&&a(p),i&&a(_),T(m,i)}}}function Rn(j){let p,b,_,m,v,i,g,E,C,J,I,de,x,Y,it,pe,sa,ct,ra,Ct,Q,la,he,ia,ca,jt,ze,da,It,Ge,pa,Nt,Re,me,ha,fe,ma,fa,At,Be,ua,kt,Se,ue,ga,dt,_a,va,Ft,H,ba,ge,wa,ya,Jt,_e,Po,Zt,W,$a,ve,Ma,Va,be,Ta,Ea,Wt,P,L,pt,we,Ca,ht,ja,Ut,Xe,Ia,xt,ye,Pt,D,U,qe,Na,Aa,$e,ka,Fa,Me,Ja,Za,Wa,Ye,Ua,Qe,xa,zt,He,Pa,Gt,z,O,mt,Ve,za,ft,Ga,Rt,N,Te,Ra,G,Ba,Le,Sa,Xa,Ee,qa,Ya,Qa,R,Ha,De,La,Da,Oe,Oa,Ka,eo,K,Bt,B,ee,ut,Ce,to,gt,ao,St,Z,je,oo,Ie,no,Ne,so,ro,lo,k,Ae,io,S,co,Ke,po,ho,_t,mo,fo,uo,te,go,ae,Xt,X,oe,vt,ke,_o,bt,vo,qt,A,Fe,bo,wt,wo,yo,Je,$o,Ze,Mo,Vo,To,F,We,Eo,q,Co,et,jo,Io,yt,No,Ao,ko,ne,Fo,se,Yt;return i=new lt({}),I=new Zo({props:{warning:!0,$$slots:{default:[Wn]},$$scope:{ctx:j}}}),pe=new lt({}),we=new lt({}),ye=new Zn({props:{pipeline:"image-classification"}}),Ve=new lt({}),Te=new Et({props:{name:"class transformers.VanConfig",anchor:"transformers.VanConfig",parameters:[{name:"image_size",val:" = 224"},{name:"num_channels",val:" = 3"},{name:"patch_sizes",val:" = [7, 3, 3, 3]"},{name:"strides",val:" = [4, 2, 2, 2]"},{name:"hidden_sizes",val:" = [64, 128, 320, 512]"},{name:"depths",val:" = [3, 3, 12, 3]"},{name:"mlp_ratios",val:" = [8, 8, 4, 4]"},{name:"hidden_act",val:" = 'gelu'"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"layer_scale_init_value",val:" = 0.01"},{name:"drop_path_rate",val:" = 0.0"},{name:"dropout_rate",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VanConfig.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.VanConfig.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.VanConfig.patch_sizes",description:`<strong>patch_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[7, 3, 3, 3]</code>) &#x2014;
Patch size to use in each stage&#x2019;s embedding layer.`,name:"patch_sizes"},{anchor:"transformers.VanConfig.strides",description:`<strong>strides</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 2, 2, 2]</code>) &#x2014;
Stride size to use in each stage&#x2019;s embedding layer to downsample the input.`,name:"strides"},{anchor:"transformers.VanConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[64, 128, 320, 512]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.VanConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 12, 3]</code>) &#x2014;
Depth (number of layers) for each stage.`,name:"depths"},{anchor:"transformers.VanConfig.mlp_ratios",description:`<strong>mlp_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[8, 8, 4, 4]</code>) &#x2014;
The expansion ratio for mlp layer at each stage.`,name:"mlp_ratios"},{anchor:"transformers.VanConfig.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 each layer. 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.VanConfig.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.VanConfig.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.VanConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-2) &#x2014;
The initial value for layer scaling.`,name:"layer_scale_init_value"},{anchor:"transformers.VanConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for stochastic depth.`,name:"drop_path_rate"},{anchor:"transformers.VanConfig.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for dropout.`,name:"dropout_rate"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/configuration_van.py#L30"}}),K=new Wo({props:{anchor:"transformers.VanConfig.example",$$slots:{default:[Un]},$$scope:{ctx:j}}}),Ce=new lt({}),je=new Et({props:{name:"class transformers.VanModel",anchor:"transformers.VanModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VanModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig">VanConfig</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/main/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/main/src/transformers/models/deprecated/van/modeling_van.py#L425"}}),Ae=new Et({props:{name:"forward",anchor:"transformers.VanModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor]"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VanModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VanModel.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 stages. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VanModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/modeling_van.py#L435",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</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/main/en/model_doc/van#transformers.VanConfig"
>VanConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \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>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</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, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new Zo({props:{$$slots:{default:[xn]},$$scope:{ctx:j}}}),ae=new Wo({props:{anchor:"transformers.VanModel.forward.example",$$slots:{default:[Pn]},$$scope:{ctx:j}}}),ke=new lt({}),Fe=new Et({props:{name:"class transformers.VanForImageClassification",anchor:"transformers.VanForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VanForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig">VanConfig</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/main/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/main/src/transformers/models/deprecated/van/modeling_van.py#L480"}}),We=new Et({props:{name:"forward",anchor:"transformers.VanForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VanForImageClassification.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VanForImageClassification.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 stages. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VanForImageClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.VanForImageClassification.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/main/src/transformers/models/deprecated/van/modeling_van.py#L492",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig"
>VanConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new Zo({props:{$$slots:{default:[zn]},$$scope:{ctx:j}}}),se=new Wo({props:{anchor:"transformers.VanForImageClassification.forward.example",$$slots:{default:[Gn]},$$scope:{ctx:j}}}),{c(){p=o("meta"),b=f(),_=o("h1"),m=o("a"),v=o("span"),w(i.$$.fragment),g=f(),E=o("span"),C=r("VAN"),J=f(),w(I.$$.fragment),de=f(),x=o("h2"),Y=o("a"),it=o("span"),w(pe.$$.fragment),sa=f(),ct=o("span"),ra=r("Overview"),Ct=f(),Q=o("p"),la=r("The VAN model was proposed in "),he=o("a"),ia=r("Visual Attention Network"),ca=r(" by Meng-Hao Guo, Cheng-Ze Lu, Zheng-Ning Liu, Ming-Ming Cheng, Shi-Min Hu."),jt=f(),ze=o("p"),da=r("This paper introduces a new attention layer based on convolution operations able to capture both local and distant relationships. This is done by combining normal and large kernel convolution layers. The latter uses a dilated convolution to capture distant correlations."),It=f(),Ge=o("p"),pa=r("The abstract from the paper is the following:"),Nt=f(),Re=o("p"),me=o("em"),ha=r("While originally designed for natural language processing tasks, the self-attention mechanism has recently taken various computer vision areas by storm. However, the 2D nature of images brings three challenges for applying self-attention in computer vision. (1) Treating images as 1D sequences neglects their 2D structures. (2) The quadratic complexity is too expensive for high-resolution images. (3) It only captures spatial adaptability but ignores channel adaptability. In this paper, we propose a novel large kernel attention (LKA) module to enable self-adaptive and long-range correlations in self-attention while avoiding the above issues. We further introduce a novel neural network based on LKA, namely Visual Attention Network (VAN). While extremely simple, VAN outperforms the state-of-the-art vision transformers and convolutional neural networks with a large margin in extensive experiments, including image classification, object detection, semantic segmentation, instance segmentation, etc. Code is available at "),fe=o("a"),ma=r("this https URL"),fa=r("."),At=f(),Be=o("p"),ua=r("Tips:"),kt=f(),Se=o("ul"),ue=o("li"),ga=r("VAN does not have an embedding layer, thus the "),dt=o("code"),_a=r("hidden_states"),va=r(" will have a length equal to the number of stages."),Ft=f(),H=o("p"),ba=r("The figure below illustrates the architecture of a Visual Aattention Layer. Taken from the "),ge=o("a"),wa=r("original paper"),ya=r("."),Jt=f(),_e=o("img"),Zt=f(),W=o("p"),$a=r("This model was contributed by "),ve=o("a"),Ma=r("Francesco"),Va=r(". The original code can be found "),be=o("a"),Ta=r("here"),Ea=r("."),Wt=f(),P=o("h2"),L=o("a"),pt=o("span"),w(we.$$.fragment),Ca=f(),ht=o("span"),ja=r("Resources"),Ut=f(),Xe=o("p"),Ia=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with VAN."),xt=f(),w(ye.$$.fragment),Pt=f(),D=o("ul"),U=o("li"),qe=o("a"),Na=r("VanForImageClassification"),Aa=r(" is supported by this "),$e=o("a"),ka=r("example script"),Fa=r(" and "),Me=o("a"),Ja=r("notebook"),Za=r("."),Wa=f(),Ye=o("li"),Ua=r("See also: "),Qe=o("a"),xa=r("Image classification task guide"),zt=f(),He=o("p"),Pa=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."),Gt=f(),z=o("h2"),O=o("a"),mt=o("span"),w(Ve.$$.fragment),za=f(),ft=o("span"),Ga=r("VanConfig"),Rt=f(),N=o("div"),w(Te.$$.fragment),Ra=f(),G=o("p"),Ba=r("This is the configuration class to store the configuration of a "),Le=o("a"),Sa=r("VanModel"),Xa=r(`. It is used to instantiate a VAN 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 VAN
`),Ee=o("a"),qa=r("Visual-Attention-Network/van-base"),Ya=r(" architecture."),Qa=f(),R=o("p"),Ha=r("Configuration objects inherit from "),De=o("a"),La=r("PretrainedConfig"),Da=r(` and can be used to control the model outputs. Read the
documentation from `),Oe=o("a"),Oa=r("PretrainedConfig"),Ka=r(" for more information."),eo=f(),w(K.$$.fragment),Bt=f(),B=o("h2"),ee=o("a"),ut=o("span"),w(Ce.$$.fragment),to=f(),gt=o("span"),ao=r("VanModel"),St=f(),Z=o("div"),w(je.$$.fragment),oo=f(),Ie=o("p"),no=r(`The bare VAN model outputting raw features without any specific head on top. Note, VAN does not have an embedding layer.
This model is a PyTorch `),Ne=o("a"),so=r("torch.nn.Module"),ro=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),lo=f(),k=o("div"),w(Ae.$$.fragment),io=f(),S=o("p"),co=r("The "),Ke=o("a"),po=r("VanModel"),ho=r(" forward method, overrides the "),_t=o("code"),mo=r("__call__"),fo=r(" special method."),uo=f(),w(te.$$.fragment),go=f(),w(ae.$$.fragment),Xt=f(),X=o("h2"),oe=o("a"),vt=o("span"),w(ke.$$.fragment),_o=f(),bt=o("span"),vo=r("VanForImageClassification"),qt=f(),A=o("div"),w(Fe.$$.fragment),bo=f(),wt=o("p"),wo=r(`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),yo=f(),Je=o("p"),$o=r("This model is a PyTorch "),Ze=o("a"),Mo=r("torch.nn.Module"),Vo=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),To=f(),F=o("div"),w(We.$$.fragment),Eo=f(),q=o("p"),Co=r("The "),et=o("a"),jo=r("VanForImageClassification"),Io=r(" forward method, overrides the "),yt=o("code"),No=r("__call__"),Ao=r(" special method."),ko=f(),w(ne.$$.fragment),Fo=f(),w(se.$$.fragment),this.h()},l(e){const c=kn('[data-svelte="svelte-1phssyn"]',document.head);p=n(c,"META",{name:!0,content:!0}),c.forEach(a),b=u(e),_=n(e,"H1",{class:!0});var Ue=s(_);m=n(Ue,"A",{id:!0,class:!0,href:!0});var $t=s(m);v=n($t,"SPAN",{});var Mt=s(v);y(i.$$.fragment,Mt),Mt.forEach(a),$t.forEach(a),g=u(Ue),E=n(Ue,"SPAN",{});var Vt=s(E);C=l(Vt,"VAN"),Vt.forEach(a),Ue.forEach(a),J=u(e),y(I.$$.fragment,e),de=u(e),x=n(e,"H2",{class:!0});var xe=s(x);Y=n(xe,"A",{id:!0,class:!0,href:!0});var Tt=s(Y);it=n(Tt,"SPAN",{});var zo=s(it);y(pe.$$.fragment,zo),zo.forEach(a),Tt.forEach(a),sa=u(xe),ct=n(xe,"SPAN",{});var Go=s(ct);ra=l(Go,"Overview"),Go.forEach(a),xe.forEach(a),Ct=u(e),Q=n(e,"P",{});var Qt=s(Q);la=l(Qt,"The VAN model was proposed in "),he=n(Qt,"A",{href:!0,rel:!0});var Ro=s(he);ia=l(Ro,"Visual Attention Network"),Ro.forEach(a),ca=l(Qt," by Meng-Hao Guo, Cheng-Ze Lu, Zheng-Ning Liu, Ming-Ming Cheng, Shi-Min Hu."),Qt.forEach(a),jt=u(e),ze=n(e,"P",{});var Bo=s(ze);da=l(Bo,"This paper introduces a new attention layer based on convolution operations able to capture both local and distant relationships. This is done by combining normal and large kernel convolution layers. The latter uses a dilated convolution to capture distant correlations."),Bo.forEach(a),It=u(e),Ge=n(e,"P",{});var So=s(Ge);pa=l(So,"The abstract from the paper is the following:"),So.forEach(a),Nt=u(e),Re=n(e,"P",{});var Xo=s(Re);me=n(Xo,"EM",{});var Ht=s(me);ha=l(Ht,"While originally designed for natural language processing tasks, the self-attention mechanism has recently taken various computer vision areas by storm. However, the 2D nature of images brings three challenges for applying self-attention in computer vision. (1) Treating images as 1D sequences neglects their 2D structures. (2) The quadratic complexity is too expensive for high-resolution images. (3) It only captures spatial adaptability but ignores channel adaptability. In this paper, we propose a novel large kernel attention (LKA) module to enable self-adaptive and long-range correlations in self-attention while avoiding the above issues. We further introduce a novel neural network based on LKA, namely Visual Attention Network (VAN). While extremely simple, VAN outperforms the state-of-the-art vision transformers and convolutional neural networks with a large margin in extensive experiments, including image classification, object detection, semantic segmentation, instance segmentation, etc. Code is available at "),fe=n(Ht,"A",{href:!0,rel:!0});var qo=s(fe);ma=l(qo,"this https URL"),qo.forEach(a),fa=l(Ht,"."),Ht.forEach(a),Xo.forEach(a),At=u(e),Be=n(e,"P",{});var Yo=s(Be);ua=l(Yo,"Tips:"),Yo.forEach(a),kt=u(e),Se=n(e,"UL",{});var Qo=s(Se);ue=n(Qo,"LI",{});var Lt=s(ue);ga=l(Lt,"VAN does not have an embedding layer, thus the "),dt=n(Lt,"CODE",{});var Ho=s(dt);_a=l(Ho,"hidden_states"),Ho.forEach(a),va=l(Lt," will have a length equal to the number of stages."),Lt.forEach(a),Qo.forEach(a),Ft=u(e),H=n(e,"P",{});var Dt=s(H);ba=l(Dt,"The figure below illustrates the architecture of a Visual Aattention Layer. Taken from the "),ge=n(Dt,"A",{href:!0,rel:!0});var Lo=s(ge);wa=l(Lo,"original paper"),Lo.forEach(a),ya=l(Dt,"."),Dt.forEach(a),Jt=u(e),_e=n(e,"IMG",{width:!0,src:!0}),Zt=u(e),W=n(e,"P",{});var tt=s(W);$a=l(tt,"This model was contributed by "),ve=n(tt,"A",{href:!0,rel:!0});var Do=s(ve);Ma=l(Do,"Francesco"),Do.forEach(a),Va=l(tt,". The original code can be found "),be=n(tt,"A",{href:!0,rel:!0});var Oo=s(be);Ta=l(Oo,"here"),Oo.forEach(a),Ea=l(tt,"."),tt.forEach(a),Wt=u(e),P=n(e,"H2",{class:!0});var Ot=s(P);L=n(Ot,"A",{id:!0,class:!0,href:!0});var Ko=s(L);pt=n(Ko,"SPAN",{});var en=s(pt);y(we.$$.fragment,en),en.forEach(a),Ko.forEach(a),Ca=u(Ot),ht=n(Ot,"SPAN",{});var tn=s(ht);ja=l(tn,"Resources"),tn.forEach(a),Ot.forEach(a),Ut=u(e),Xe=n(e,"P",{});var an=s(Xe);Ia=l(an,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with VAN."),an.forEach(a),xt=u(e),y(ye.$$.fragment,e),Pt=u(e),D=n(e,"UL",{});var Kt=s(D);U=n(Kt,"LI",{});var Pe=s(U);qe=n(Pe,"A",{href:!0});var on=s(qe);Na=l(on,"VanForImageClassification"),on.forEach(a),Aa=l(Pe," is supported by this "),$e=n(Pe,"A",{href:!0,rel:!0});var nn=s($e);ka=l(nn,"example script"),nn.forEach(a),Fa=l(Pe," and "),Me=n(Pe,"A",{href:!0,rel:!0});var sn=s(Me);Ja=l(sn,"notebook"),sn.forEach(a),Za=l(Pe,"."),Pe.forEach(a),Wa=u(Kt),Ye=n(Kt,"LI",{});var Jo=s(Ye);Ua=l(Jo,"See also: "),Qe=n(Jo,"A",{href:!0});var rn=s(Qe);xa=l(rn,"Image classification task guide"),rn.forEach(a),Jo.forEach(a),Kt.forEach(a),zt=u(e),He=n(e,"P",{});var ln=s(He);Pa=l(ln,"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."),ln.forEach(a),Gt=u(e),z=n(e,"H2",{class:!0});var ea=s(z);O=n(ea,"A",{id:!0,class:!0,href:!0});var cn=s(O);mt=n(cn,"SPAN",{});var dn=s(mt);y(Ve.$$.fragment,dn),dn.forEach(a),cn.forEach(a),za=u(ea),ft=n(ea,"SPAN",{});var pn=s(ft);Ga=l(pn,"VanConfig"),pn.forEach(a),ea.forEach(a),Rt=u(e),N=n(e,"DIV",{class:!0});var re=s(N);y(Te.$$.fragment,re),Ra=u(re),G=n(re,"P",{});var at=s(G);Ba=l(at,"This is the configuration class to store the configuration of a "),Le=n(at,"A",{href:!0});var hn=s(Le);Sa=l(hn,"VanModel"),hn.forEach(a),Xa=l(at,`. It is used to instantiate a VAN 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 VAN
`),Ee=n(at,"A",{href:!0,rel:!0});var mn=s(Ee);qa=l(mn,"Visual-Attention-Network/van-base"),mn.forEach(a),Ya=l(at," architecture."),at.forEach(a),Qa=u(re),R=n(re,"P",{});var ot=s(R);Ha=l(ot,"Configuration objects inherit from "),De=n(ot,"A",{href:!0});var fn=s(De);La=l(fn,"PretrainedConfig"),fn.forEach(a),Da=l(ot,` and can be used to control the model outputs. Read the
documentation from `),Oe=n(ot,"A",{href:!0});var un=s(Oe);Oa=l(un,"PretrainedConfig"),un.forEach(a),Ka=l(ot," for more information."),ot.forEach(a),eo=u(re),y(K.$$.fragment,re),re.forEach(a),Bt=u(e),B=n(e,"H2",{class:!0});var ta=s(B);ee=n(ta,"A",{id:!0,class:!0,href:!0});var gn=s(ee);ut=n(gn,"SPAN",{});var _n=s(ut);y(Ce.$$.fragment,_n),_n.forEach(a),gn.forEach(a),to=u(ta),gt=n(ta,"SPAN",{});var vn=s(gt);ao=l(vn,"VanModel"),vn.forEach(a),ta.forEach(a),St=u(e),Z=n(e,"DIV",{class:!0});var nt=s(Z);y(je.$$.fragment,nt),oo=u(nt),Ie=n(nt,"P",{});var aa=s(Ie);no=l(aa,`The bare VAN model outputting raw features without any specific head on top. Note, VAN does not have an embedding layer.
This model is a PyTorch `),Ne=n(aa,"A",{href:!0,rel:!0});var bn=s(Ne);so=l(bn,"torch.nn.Module"),bn.forEach(a),ro=l(aa,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),aa.forEach(a),lo=u(nt),k=n(nt,"DIV",{class:!0});var le=s(k);y(Ae.$$.fragment,le),io=u(le),S=n(le,"P",{});var st=s(S);co=l(st,"The "),Ke=n(st,"A",{href:!0});var wn=s(Ke);po=l(wn,"VanModel"),wn.forEach(a),ho=l(st," forward method, overrides the "),_t=n(st,"CODE",{});var yn=s(_t);mo=l(yn,"__call__"),yn.forEach(a),fo=l(st," special method."),st.forEach(a),uo=u(le),y(te.$$.fragment,le),go=u(le),y(ae.$$.fragment,le),le.forEach(a),nt.forEach(a),Xt=u(e),X=n(e,"H2",{class:!0});var oa=s(X);oe=n(oa,"A",{id:!0,class:!0,href:!0});var $n=s(oe);vt=n($n,"SPAN",{});var Mn=s(vt);y(ke.$$.fragment,Mn),Mn.forEach(a),$n.forEach(a),_o=u(oa),bt=n(oa,"SPAN",{});var Vn=s(bt);vo=l(Vn,"VanForImageClassification"),Vn.forEach(a),oa.forEach(a),qt=u(e),A=n(e,"DIV",{class:!0});var ie=s(A);y(Fe.$$.fragment,ie),bo=u(ie),wt=n(ie,"P",{});var Tn=s(wt);wo=l(Tn,`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Tn.forEach(a),yo=u(ie),Je=n(ie,"P",{});var na=s(Je);$o=l(na,"This model is a PyTorch "),Ze=n(na,"A",{href:!0,rel:!0});var En=s(Ze);Mo=l(En,"torch.nn.Module"),En.forEach(a),Vo=l(na,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),na.forEach(a),To=u(ie),F=n(ie,"DIV",{class:!0});var ce=s(F);y(We.$$.fragment,ce),Eo=u(ce),q=n(ce,"P",{});var rt=s(q);Co=l(rt,"The "),et=n(rt,"A",{href:!0});var Cn=s(et);jo=l(Cn,"VanForImageClassification"),Cn.forEach(a),Io=l(rt," forward method, overrides the "),yt=n(rt,"CODE",{});var jn=s(yt);No=l(jn,"__call__"),jn.forEach(a),Ao=l(rt," special method."),rt.forEach(a),ko=u(ce),y(ne.$$.fragment,ce),Fo=u(ce),y(se.$$.fragment,ce),ce.forEach(a),ie.forEach(a),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(Bn)),d(m,"id","van"),d(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"),d(m,"href","#van"),d(_,"class","relative group"),d(Y,"id","overview"),d(Y,"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"),d(Y,"href","#overview"),d(x,"class","relative group"),d(he,"href","https://arxiv.org/abs/2202.09741"),d(he,"rel","nofollow"),d(fe,"href","https://github.com/Visual-Attention-Network/VAN-Classification"),d(fe,"rel","nofollow"),d(ge,"href","https://arxiv.org/abs/2202.09741"),d(ge,"rel","nofollow"),d(_e,"width","600"),Fn(_e.src,Po="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/van_architecture.png")||d(_e,"src",Po),d(ve,"href","https://huggingface.co/Francesco"),d(ve,"rel","nofollow"),d(be,"href","https://github.com/Visual-Attention-Network/VAN-Classification"),d(be,"rel","nofollow"),d(L,"id","resources"),d(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(L,"href","#resources"),d(P,"class","relative group"),d(qe,"href","/docs/transformers/main/en/model_doc/van#transformers.VanForImageClassification"),d($e,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d($e,"rel","nofollow"),d(Me,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(Me,"rel","nofollow"),d(Qe,"href","../tasks/image_classification"),d(O,"id","transformers.VanConfig"),d(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(O,"href","#transformers.VanConfig"),d(z,"class","relative group"),d(Le,"href","/docs/transformers/main/en/model_doc/van#transformers.VanModel"),d(Ee,"href","https://huggingface.co/Visual-Attention-Network/van-base"),d(Ee,"rel","nofollow"),d(De,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Oe,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"id","transformers.VanModel"),d(ee,"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"),d(ee,"href","#transformers.VanModel"),d(B,"class","relative group"),d(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ne,"rel","nofollow"),d(Ke,"href","/docs/transformers/main/en/model_doc/van#transformers.VanModel"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"id","transformers.VanForImageClassification"),d(oe,"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"),d(oe,"href","#transformers.VanForImageClassification"),d(X,"class","relative group"),d(Ze,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ze,"rel","nofollow"),d(et,"href","/docs/transformers/main/en/model_doc/van#transformers.VanForImageClassification"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"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,c){t(document.head,p),h(e,b,c),h(e,_,c),t(_,m),t(m,v),$(i,v,null),t(_,g),t(_,E),t(E,C),h(e,J,c),$(I,e,c),h(e,de,c),h(e,x,c),t(x,Y),t(Y,it),$(pe,it,null),t(x,sa),t(x,ct),t(ct,ra),h(e,Ct,c),h(e,Q,c),t(Q,la),t(Q,he),t(he,ia),t(Q,ca),h(e,jt,c),h(e,ze,c),t(ze,da),h(e,It,c),h(e,Ge,c),t(Ge,pa),h(e,Nt,c),h(e,Re,c),t(Re,me),t(me,ha),t(me,fe),t(fe,ma),t(me,fa),h(e,At,c),h(e,Be,c),t(Be,ua),h(e,kt,c),h(e,Se,c),t(Se,ue),t(ue,ga),t(ue,dt),t(dt,_a),t(ue,va),h(e,Ft,c),h(e,H,c),t(H,ba),t(H,ge),t(ge,wa),t(H,ya),h(e,Jt,c),h(e,_e,c),h(e,Zt,c),h(e,W,c),t(W,$a),t(W,ve),t(ve,Ma),t(W,Va),t(W,be),t(be,Ta),t(W,Ea),h(e,Wt,c),h(e,P,c),t(P,L),t(L,pt),$(we,pt,null),t(P,Ca),t(P,ht),t(ht,ja),h(e,Ut,c),h(e,Xe,c),t(Xe,Ia),h(e,xt,c),$(ye,e,c),h(e,Pt,c),h(e,D,c),t(D,U),t(U,qe),t(qe,Na),t(U,Aa),t(U,$e),t($e,ka),t(U,Fa),t(U,Me),t(Me,Ja),t(U,Za),t(D,Wa),t(D,Ye),t(Ye,Ua),t(Ye,Qe),t(Qe,xa),h(e,zt,c),h(e,He,c),t(He,Pa),h(e,Gt,c),h(e,z,c),t(z,O),t(O,mt),$(Ve,mt,null),t(z,za),t(z,ft),t(ft,Ga),h(e,Rt,c),h(e,N,c),$(Te,N,null),t(N,Ra),t(N,G),t(G,Ba),t(G,Le),t(Le,Sa),t(G,Xa),t(G,Ee),t(Ee,qa),t(G,Ya),t(N,Qa),t(N,R),t(R,Ha),t(R,De),t(De,La),t(R,Da),t(R,Oe),t(Oe,Oa),t(R,Ka),t(N,eo),$(K,N,null),h(e,Bt,c),h(e,B,c),t(B,ee),t(ee,ut),$(Ce,ut,null),t(B,to),t(B,gt),t(gt,ao),h(e,St,c),h(e,Z,c),$(je,Z,null),t(Z,oo),t(Z,Ie),t(Ie,no),t(Ie,Ne),t(Ne,so),t(Ie,ro),t(Z,lo),t(Z,k),$(Ae,k,null),t(k,io),t(k,S),t(S,co),t(S,Ke),t(Ke,po),t(S,ho),t(S,_t),t(_t,mo),t(S,fo),t(k,uo),$(te,k,null),t(k,go),$(ae,k,null),h(e,Xt,c),h(e,X,c),t(X,oe),t(oe,vt),$(ke,vt,null),t(X,_o),t(X,bt),t(bt,vo),h(e,qt,c),h(e,A,c),$(Fe,A,null),t(A,bo),t(A,wt),t(wt,wo),t(A,yo),t(A,Je),t(Je,$o),t(Je,Ze),t(Ze,Mo),t(Je,Vo),t(A,To),t(A,F),$(We,F,null),t(F,Eo),t(F,q),t(q,Co),t(q,et),t(et,jo),t(q,Io),t(q,yt),t(yt,No),t(q,Ao),t(F,ko),$(ne,F,null),t(F,Fo),$(se,F,null),Yt=!0},p(e,[c]){const Ue={};c&2&&(Ue.$$scope={dirty:c,ctx:e}),I.$set(Ue);const $t={};c&2&&($t.$$scope={dirty:c,ctx:e}),K.$set($t);const Mt={};c&2&&(Mt.$$scope={dirty:c,ctx:e}),te.$set(Mt);const Vt={};c&2&&(Vt.$$scope={dirty:c,ctx:e}),ae.$set(Vt);const xe={};c&2&&(xe.$$scope={dirty:c,ctx:e}),ne.$set(xe);const Tt={};c&2&&(Tt.$$scope={dirty:c,ctx:e}),se.$set(Tt)},i(e){Yt||(M(i.$$.fragment,e),M(I.$$.fragment,e),M(pe.$$.fragment,e),M(we.$$.fragment,e),M(ye.$$.fragment,e),M(Ve.$$.fragment,e),M(Te.$$.fragment,e),M(K.$$.fragment,e),M(Ce.$$.fragment,e),M(je.$$.fragment,e),M(Ae.$$.fragment,e),M(te.$$.fragment,e),M(ae.$$.fragment,e),M(ke.$$.fragment,e),M(Fe.$$.fragment,e),M(We.$$.fragment,e),M(ne.$$.fragment,e),M(se.$$.fragment,e),Yt=!0)},o(e){V(i.$$.fragment,e),V(I.$$.fragment,e),V(pe.$$.fragment,e),V(we.$$.fragment,e),V(ye.$$.fragment,e),V(Ve.$$.fragment,e),V(Te.$$.fragment,e),V(K.$$.fragment,e),V(Ce.$$.fragment,e),V(je.$$.fragment,e),V(Ae.$$.fragment,e),V(te.$$.fragment,e),V(ae.$$.fragment,e),V(ke.$$.fragment,e),V(Fe.$$.fragment,e),V(We.$$.fragment,e),V(ne.$$.fragment,e),V(se.$$.fragment,e),Yt=!1},d(e){a(p),e&&a(b),e&&a(_),T(i),e&&a(J),T(I,e),e&&a(de),e&&a(x),T(pe),e&&a(Ct),e&&a(Q),e&&a(jt),e&&a(ze),e&&a(It),e&&a(Ge),e&&a(Nt),e&&a(Re),e&&a(At),e&&a(Be),e&&a(kt),e&&a(Se),e&&a(Ft),e&&a(H),e&&a(Jt),e&&a(_e),e&&a(Zt),e&&a(W),e&&a(Wt),e&&a(P),T(we),e&&a(Ut),e&&a(Xe),e&&a(xt),T(ye,e),e&&a(Pt),e&&a(D),e&&a(zt),e&&a(He),e&&a(Gt),e&&a(z),T(Ve),e&&a(Rt),e&&a(N),T(Te),T(K),e&&a(Bt),e&&a(B),T(Ce),e&&a(St),e&&a(Z),T(je),T(Ae),T(te),T(ae),e&&a(Xt),e&&a(X),T(ke),e&&a(qt),e&&a(A),T(Fe),T(We),T(ne),T(se)}}}const Bn={local:"van",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.VanConfig",title:"VanConfig"},{local:"transformers.VanModel",title:"VanModel"},{local:"transformers.VanForImageClassification",title:"VanForImageClassification"}],title:"VAN"};function Sn(j){return Jn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class On extends In{constructor(p){super();Nn(this,p,Sn,Rn,An,{})}}export{On as default,Bn as metadata};
