import{S as vr,i as br,s as yr,e as a,k as u,w as b,t as i,M as Mr,c as s,d as o,m as g,a as n,x as y,h as l,b as m,G as t,g as p,y as M,q as F,o as $,B as S,v as Fr,L as No}from"../../chunks/vendor-hf-doc-builder.js";import{T as _r}from"../../chunks/Tip-hf-doc-builder.js";import{D as et}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ro}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as tt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function $r(U){let c,v,w,f,_;return f=new Ro({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFN3aWZ0Rm9ybWVyQ29uZmlnJTJDJTIwU3dpZnRGb3JtZXJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBTd2lmdEZvcm1lciUyMHN3aWZ0Zm9ybWVyLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU3dpZnRGb3JtZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwc3dpZnRmb3JtZXItYmFzZS1wYXRjaDE2LTIyNCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwU3dpZnRGb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SwiftFormerConfig, SwiftFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a SwiftFormer swiftformer-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SwiftFormerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the swiftformer-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwiftFormerModel(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(){c=a("p"),v=i("Example:"),w=u(),b(f.$$.fragment)},l(r){c=s(r,"P",{});var h=n(c);v=l(h,"Example:"),h.forEach(o),w=g(r),y(f.$$.fragment,r)},m(r,h){p(r,c,h),t(c,v),p(r,w,h),M(f,r,h),_=!0},p:No,i(r){_||(F(f.$$.fragment,r),_=!0)},o(r){$(f.$$.fragment,r),_=!1},d(r){r&&o(c),r&&o(w),S(f,r)}}}function Sr(U){let c,v,w,f,_;return{c(){c=a("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),w=a("code"),f=i("Module"),_=i(`
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(r){c=s(r,"P",{});var h=n(c);v=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),w=s(h,"CODE",{});var E=n(w);f=l(E,"Module"),E.forEach(o),_=l(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(r,h){p(r,c,h),t(c,v),t(c,w),t(w,f),t(c,_)},d(r){r&&o(c)}}}function Tr(U){let c,v,w,f,_;return f=new Ro({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aWZ0Rm9ybWVyTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMk1CWlVBSSUyRnN3aWZ0Zm9ybWVyLXhzJTIyKSUwQW1vZGVsJTIwJTNEJTIwU3dpZnRGb3JtZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyTUJaVUFJJTJGc3dpZnRmb3JtZXIteHMlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SwiftFormerModel
<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;MBZUAI/swiftformer-xs&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwiftFormerModel.from_pretrained(<span class="hljs-string">&quot;MBZUAI/swiftformer-xs&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">220</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){c=a("p"),v=i("Example:"),w=u(),b(f.$$.fragment)},l(r){c=s(r,"P",{});var h=n(c);v=l(h,"Example:"),h.forEach(o),w=g(r),y(f.$$.fragment,r)},m(r,h){p(r,c,h),t(c,v),p(r,w,h),M(f,r,h),_=!0},p:No,i(r){_||(F(f.$$.fragment,r),_=!0)},o(r){$(f.$$.fragment,r),_=!1},d(r){r&&o(c),r&&o(w),S(f,r)}}}function Cr(U){let c,v,w,f,_;return{c(){c=a("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),w=a("code"),f=i("Module"),_=i(`
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(r){c=s(r,"P",{});var h=n(c);v=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),w=s(h,"CODE",{});var E=n(w);f=l(E,"Module"),E.forEach(o),_=l(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(r,h){p(r,c,h),t(c,v),t(c,w),t(w,f),t(c,_)},d(r){r&&o(c)}}}function Ur(U){let c,v,w,f,_;return f=new Ro({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aWZ0Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyTUJaVUFJJTJGc3dpZnRmb3JtZXIteHMlMjIpJTBBbW9kZWwlMjAlM0QlMjBTd2lmdEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMk1CWlVBSSUyRnN3aWZ0Zm9ybWVyLXhzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, SwiftFormerForImageClassification
<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;MBZUAI/swiftformer-xs&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwiftFormerForImageClassification.from_pretrained(<span class="hljs-string">&quot;MBZUAI/swiftformer-xs&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(){c=a("p"),v=i("Example:"),w=u(),b(f.$$.fragment)},l(r){c=s(r,"P",{});var h=n(c);v=l(h,"Example:"),h.forEach(o),w=g(r),y(f.$$.fragment,r)},m(r,h){p(r,c,h),t(c,v),p(r,w,h),M(f,r,h),_=!0},p:No,i(r){_||(F(f.$$.fragment,r),_=!0)},o(r){$(f.$$.fragment,r),_=!1},d(r){r&&o(c),r&&o(w),S(f,r)}}}function Ir(U){let c,v,w,f,_,r,h,E,$t,ot,x,G,Ae,oe,St,Pe,Tt,rt,B,Ct,re,Ut,It,at,Me,jt,st,Fe,Et,nt,$e,Ve,Jt,it,Se,Zt,lt,Te,ae,xt,Ce,Wt,kt,ct,Z,Nt,se,Rt,At,ne,Pt,Vt,mt,W,z,Ge,ie,Gt,Be,Bt,dt,T,le,zt,k,Xt,Ue,Qt,qt,ce,Yt,Ht,Ot,N,Dt,Ie,Lt,Kt,je,eo,to,oo,X,ft,R,Q,ze,me,ro,Xe,ao,ht,J,de,so,fe,no,he,io,lo,co,I,pe,mo,A,fo,Ee,ho,po,Qe,uo,go,wo,q,_o,Y,pt,P,H,qe,ue,vo,Ye,bo,ut,C,ge,yo,He,Mo,Fo,we,$o,_e,So,To,Co,j,ve,Uo,V,Io,Je,jo,Eo,Oe,Jo,Zo,xo,O,Wo,D,gt;return r=new tt({}),oe=new tt({}),ie=new tt({}),le=new et({props:{name:"class transformers.SwiftFormerConfig",anchor:"transformers.SwiftFormerConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"depths",val:" = [3, 3, 6, 4]"},{name:"embed_dims",val:" = [48, 56, 112, 220]"},{name:"mlp_ratio",val:" = 4"},{name:"downsamples",val:" = [True, True, True, True]"},{name:"hidden_act",val:" = 'gelu'"},{name:"down_patch_size",val:" = 3"},{name:"down_stride",val:" = 2"},{name:"down_pad",val:" = 1"},{name:"drop_path_rate",val:" = 0.0"},{name:"use_layer_scale",val:" = True"},{name:"layer_scale_init_value",val:" = 1e-05"},{name:"batch_norm_eps",val:" = 1e-05"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SwiftFormerConfig.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.SwiftFormerConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 6, 4]</code>) &#x2014;
Depth of each stage`,name:"depths"},{anchor:"transformers.SwiftFormerConfig.embed_dims",description:`<strong>embed_dims</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[48, 56, 112, 220]</code>) &#x2014;
The embedding dimension at each stage`,name:"embed_dims"},{anchor:"transformers.SwiftFormerConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Ratio of size of the hidden dimensionality of an MLP to the dimensionality of its input.`,name:"mlp_ratio"},{anchor:"transformers.SwiftFormerConfig.downsamples",description:`<strong>downsamples</strong> (<code>List[bool]</code>, <em>optional</em>, defaults to <code>[True, True, True, True]</code>) &#x2014;
Whether or not to downsample inputs between two stages.`,name:"downsamples"},{anchor:"transformers.SwiftFormerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (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.SwiftFormerConfig.down_patch_size",description:`<strong>down_patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The size of patches in downsampling layers.`,name:"down_patch_size"},{anchor:"transformers.SwiftFormerConfig.down_stride",description:`<strong>down_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The stride of convolution kernels in downsampling layers.`,name:"down_stride"},{anchor:"transformers.SwiftFormerConfig.down_pad",description:`<strong>down_pad</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding in downsampling layers.`,name:"down_pad"},{anchor:"transformers.SwiftFormerConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.) &#x2014;
Rate at which to increase dropout probability in DropPath.`,name:"drop_path_rate"},{anchor:"transformers.SwiftFormerConfig.use_layer_scale",description:`<strong>use_layer_scale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to scale outputs from token mixers.`,name:"use_layer_scale"},{anchor:"transformers.SwiftFormerConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
Factor by which outputs from token mixers are scaled.`,name:"layer_scale_init_value"},{anchor:"transformers.SwiftFormerConfig.batch_norm_eps",description:`<strong>batch_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the batch normalization layers.`,name:"batch_norm_eps"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swiftformer/configuration_swiftformer.py#L34"}}),X=new ko({props:{anchor:"transformers.SwiftFormerConfig.example",$$slots:{default:[$r]},$$scope:{ctx:U}}}),me=new tt({}),de=new et({props:{name:"class transformers.SwiftFormerModel",anchor:"transformers.SwiftFormerModel",parameters:[{name:"config",val:": SwiftFormerConfig"}],parametersDescription:[{anchor:"transformers.SwiftFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerConfig">SwiftFormerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/swiftformer/modeling_swiftformer.py#L479"}}),pe=new et({props:{name:"forward",anchor:"transformers.SwiftFormerModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SwiftFormerModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SwiftFormerModel.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.SwiftFormerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/swiftformer/modeling_swiftformer.py#L490",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerConfig"
>SwiftFormerConfig</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>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.BaseModelOutputWithNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),q=new _r({props:{$$slots:{default:[Sr]},$$scope:{ctx:U}}}),Y=new ko({props:{anchor:"transformers.SwiftFormerModel.forward.example",$$slots:{default:[Tr]},$$scope:{ctx:U}}}),ue=new tt({}),ge=new et({props:{name:"class transformers.SwiftFormerForImageClassification",anchor:"transformers.SwiftFormerForImageClassification",parameters:[{name:"config",val:": SwiftFormerConfig"}],parametersDescription:[{anchor:"transformers.SwiftFormerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerConfig">SwiftFormerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/swiftformer/modeling_swiftformer.py#L536"}}),ve=new et({props:{name:"forward",anchor:"transformers.SwiftFormerForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SwiftFormerForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SwiftFormerForImageClassification.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.SwiftFormerForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SwiftFormerForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swiftformer/modeling_swiftformer.py#L553",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerConfig"
>SwiftFormerConfig</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/v4.33.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new _r({props:{$$slots:{default:[Cr]},$$scope:{ctx:U}}}),D=new ko({props:{anchor:"transformers.SwiftFormerForImageClassification.forward.example",$$slots:{default:[Ur]},$$scope:{ctx:U}}}),{c(){c=a("meta"),v=u(),w=a("h1"),f=a("a"),_=a("span"),b(r.$$.fragment),h=u(),E=a("span"),$t=i("SwiftFormer"),ot=u(),x=a("h2"),G=a("a"),Ae=a("span"),b(oe.$$.fragment),St=u(),Pe=a("span"),Tt=i("Overview"),rt=u(),B=a("p"),Ct=i("The SwiftFormer model was proposed in "),re=a("a"),Ut=i("SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications"),It=i(" by Abdelrahman Shaker, Muhammad Maaz, Hanoona Rasheed, Salman Khan, Ming-Hsuan Yang, Fahad Shahbaz Khan."),at=u(),Me=a("p"),jt=i("The SwiftFormer paper introduces a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations in the self-attention computation with linear element-wise multiplications. A series of models called \u2018SwiftFormer\u2019 is built based on this, which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Even their small variant achieves 78.5% top-1 ImageNet1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2\xD7 faster compared to MobileViT-v2."),st=u(),Fe=a("p"),Et=i("The abstract from the paper is the following:"),nt=u(),$e=a("p"),Ve=a("em"),Jt=i("Self-attention has become a defacto choice for capturing global context in various vision applications. However, its quadratic computational complexity with respect to image resolution limits its use in real-time applications, especially for deployment on resource-constrained mobile devices. Although hybrid approaches have been proposed to combine the advantages of convolutions and self-attention for a better speed-accuracy trade-off, the expensive matrix multiplication operations in self-attention remain a bottleneck. In this work, we introduce a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations with linear element-wise multiplications. Our design shows that the key-value interaction can be replaced with a linear layer without sacrificing any accuracy. Unlike previous state-of-the-art methods, our efficient formulation of self-attention enables its usage at all stages of the network. Using our proposed efficient additive attention, we build a series of models called \u201CSwiftFormer\u201D which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Our small variant achieves 78.5% top-1 ImageNet-1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2x faster compared to MobileViT-v2."),it=u(),Se=a("p"),Zt=i("Tips:"),lt=u(),Te=a("ul"),ae=a("li"),xt=i("One can use the "),Ce=a("a"),Wt=i("ViTImageProcessor"),kt=i(" API to prepare images for the model."),ct=u(),Z=a("p"),Nt=i("This model was contributed by "),se=a("a"),Rt=i("shehan97"),At=i(`.
The original code can be found `),ne=a("a"),Pt=i("here"),Vt=i("."),mt=u(),W=a("h2"),z=a("a"),Ge=a("span"),b(ie.$$.fragment),Gt=u(),Be=a("span"),Bt=i("SwiftFormerConfig"),dt=u(),T=a("div"),b(le.$$.fragment),zt=u(),k=a("p"),Xt=i("This is the configuration class to store the configuration of a "),Ue=a("a"),Qt=i("SwiftFormerModel"),qt=i(`. It is used to instantiate an
SwiftFormer 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 SwiftFormer
`),ce=a("a"),Yt=i("MBZUAI/swiftformer-xs"),Ht=i(" architecture."),Ot=u(),N=a("p"),Dt=i("Configuration objects inherit from "),Ie=a("a"),Lt=i("PretrainedConfig"),Kt=i(` and can be used to control the model outputs. Read the
documentation from `),je=a("a"),eo=i("PretrainedConfig"),to=i(" for more information."),oo=u(),b(X.$$.fragment),ft=u(),R=a("h2"),Q=a("a"),ze=a("span"),b(me.$$.fragment),ro=u(),Xe=a("span"),ao=i("SwiftFormerModel"),ht=u(),J=a("div"),b(de.$$.fragment),so=u(),fe=a("p"),no=i(`The bare SwiftFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),he=a("a"),io=i("torch.nn.Module"),lo=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),co=u(),I=a("div"),b(pe.$$.fragment),mo=u(),A=a("p"),fo=i("The "),Ee=a("a"),ho=i("SwiftFormerModel"),po=i(" forward method, overrides the "),Qe=a("code"),uo=i("__call__"),go=i(" special method."),wo=u(),b(q.$$.fragment),_o=u(),b(Y.$$.fragment),pt=u(),P=a("h2"),H=a("a"),qe=a("span"),b(ue.$$.fragment),vo=u(),Ye=a("span"),bo=i("SwiftFormerForImageClassification"),ut=u(),C=a("div"),b(ge.$$.fragment),yo=u(),He=a("p"),Mo=i("SwiftFormer Model transformer with an image classification head on top (e.g. for ImageNet)."),Fo=u(),we=a("p"),$o=i("This model is a PyTorch "),_e=a("a"),So=i("torch.nn.Module"),To=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Co=u(),j=a("div"),b(ve.$$.fragment),Uo=u(),V=a("p"),Io=i("The "),Je=a("a"),jo=i("SwiftFormerForImageClassification"),Eo=i(" forward method, overrides the "),Oe=a("code"),Jo=i("__call__"),Zo=i(" special method."),xo=u(),b(O.$$.fragment),Wo=u(),b(D.$$.fragment),this.h()},l(e){const d=Mr('[data-svelte="svelte-1phssyn"]',document.head);c=s(d,"META",{name:!0,content:!0}),d.forEach(o),v=g(e),w=s(e,"H1",{class:!0});var be=n(w);f=s(be,"A",{id:!0,class:!0,href:!0});var De=n(f);_=s(De,"SPAN",{});var Le=n(_);y(r.$$.fragment,Le),Le.forEach(o),De.forEach(o),h=g(be),E=s(be,"SPAN",{});var Ke=n(E);$t=l(Ke,"SwiftFormer"),Ke.forEach(o),be.forEach(o),ot=g(e),x=s(e,"H2",{class:!0});var ye=n(x);G=s(ye,"A",{id:!0,class:!0,href:!0});var Ao=n(G);Ae=s(Ao,"SPAN",{});var Po=n(Ae);y(oe.$$.fragment,Po),Po.forEach(o),Ao.forEach(o),St=g(ye),Pe=s(ye,"SPAN",{});var Vo=n(Pe);Tt=l(Vo,"Overview"),Vo.forEach(o),ye.forEach(o),rt=g(e),B=s(e,"P",{});var wt=n(B);Ct=l(wt,"The SwiftFormer model was proposed in "),re=s(wt,"A",{href:!0,rel:!0});var Go=n(re);Ut=l(Go,"SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications"),Go.forEach(o),It=l(wt," by Abdelrahman Shaker, Muhammad Maaz, Hanoona Rasheed, Salman Khan, Ming-Hsuan Yang, Fahad Shahbaz Khan."),wt.forEach(o),at=g(e),Me=s(e,"P",{});var Bo=n(Me);jt=l(Bo,"The SwiftFormer paper introduces a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations in the self-attention computation with linear element-wise multiplications. A series of models called \u2018SwiftFormer\u2019 is built based on this, which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Even their small variant achieves 78.5% top-1 ImageNet1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2\xD7 faster compared to MobileViT-v2."),Bo.forEach(o),st=g(e),Fe=s(e,"P",{});var zo=n(Fe);Et=l(zo,"The abstract from the paper is the following:"),zo.forEach(o),nt=g(e),$e=s(e,"P",{});var Xo=n($e);Ve=s(Xo,"EM",{});var Qo=n(Ve);Jt=l(Qo,"Self-attention has become a defacto choice for capturing global context in various vision applications. However, its quadratic computational complexity with respect to image resolution limits its use in real-time applications, especially for deployment on resource-constrained mobile devices. Although hybrid approaches have been proposed to combine the advantages of convolutions and self-attention for a better speed-accuracy trade-off, the expensive matrix multiplication operations in self-attention remain a bottleneck. In this work, we introduce a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations with linear element-wise multiplications. Our design shows that the key-value interaction can be replaced with a linear layer without sacrificing any accuracy. Unlike previous state-of-the-art methods, our efficient formulation of self-attention enables its usage at all stages of the network. Using our proposed efficient additive attention, we build a series of models called \u201CSwiftFormer\u201D which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Our small variant achieves 78.5% top-1 ImageNet-1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2x faster compared to MobileViT-v2."),Qo.forEach(o),Xo.forEach(o),it=g(e),Se=s(e,"P",{});var qo=n(Se);Zt=l(qo,"Tips:"),qo.forEach(o),lt=g(e),Te=s(e,"UL",{});var Yo=n(Te);ae=s(Yo,"LI",{});var _t=n(ae);xt=l(_t,"One can use the "),Ce=s(_t,"A",{href:!0});var Ho=n(Ce);Wt=l(Ho,"ViTImageProcessor"),Ho.forEach(o),kt=l(_t," API to prepare images for the model."),_t.forEach(o),Yo.forEach(o),ct=g(e),Z=s(e,"P",{});var Ze=n(Z);Nt=l(Ze,"This model was contributed by "),se=s(Ze,"A",{href:!0,rel:!0});var Oo=n(se);Rt=l(Oo,"shehan97"),Oo.forEach(o),At=l(Ze,`.
The original code can be found `),ne=s(Ze,"A",{href:!0,rel:!0});var Do=n(ne);Pt=l(Do,"here"),Do.forEach(o),Vt=l(Ze,"."),Ze.forEach(o),mt=g(e),W=s(e,"H2",{class:!0});var vt=n(W);z=s(vt,"A",{id:!0,class:!0,href:!0});var Lo=n(z);Ge=s(Lo,"SPAN",{});var Ko=n(Ge);y(ie.$$.fragment,Ko),Ko.forEach(o),Lo.forEach(o),Gt=g(vt),Be=s(vt,"SPAN",{});var er=n(Be);Bt=l(er,"SwiftFormerConfig"),er.forEach(o),vt.forEach(o),dt=g(e),T=s(e,"DIV",{class:!0});var L=n(T);y(le.$$.fragment,L),zt=g(L),k=s(L,"P",{});var xe=n(k);Xt=l(xe,"This is the configuration class to store the configuration of a "),Ue=s(xe,"A",{href:!0});var tr=n(Ue);Qt=l(tr,"SwiftFormerModel"),tr.forEach(o),qt=l(xe,`. It is used to instantiate an
SwiftFormer 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 SwiftFormer
`),ce=s(xe,"A",{href:!0,rel:!0});var or=n(ce);Yt=l(or,"MBZUAI/swiftformer-xs"),or.forEach(o),Ht=l(xe," architecture."),xe.forEach(o),Ot=g(L),N=s(L,"P",{});var We=n(N);Dt=l(We,"Configuration objects inherit from "),Ie=s(We,"A",{href:!0});var rr=n(Ie);Lt=l(rr,"PretrainedConfig"),rr.forEach(o),Kt=l(We,` and can be used to control the model outputs. Read the
documentation from `),je=s(We,"A",{href:!0});var ar=n(je);eo=l(ar,"PretrainedConfig"),ar.forEach(o),to=l(We," for more information."),We.forEach(o),oo=g(L),y(X.$$.fragment,L),L.forEach(o),ft=g(e),R=s(e,"H2",{class:!0});var bt=n(R);Q=s(bt,"A",{id:!0,class:!0,href:!0});var sr=n(Q);ze=s(sr,"SPAN",{});var nr=n(ze);y(me.$$.fragment,nr),nr.forEach(o),sr.forEach(o),ro=g(bt),Xe=s(bt,"SPAN",{});var ir=n(Xe);ao=l(ir,"SwiftFormerModel"),ir.forEach(o),bt.forEach(o),ht=g(e),J=s(e,"DIV",{class:!0});var ke=n(J);y(de.$$.fragment,ke),so=g(ke),fe=s(ke,"P",{});var yt=n(fe);no=l(yt,`The bare SwiftFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),he=s(yt,"A",{href:!0,rel:!0});var lr=n(he);io=l(lr,"torch.nn.Module"),lr.forEach(o),lo=l(yt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yt.forEach(o),co=g(ke),I=s(ke,"DIV",{class:!0});var K=n(I);y(pe.$$.fragment,K),mo=g(K),A=s(K,"P",{});var Ne=n(A);fo=l(Ne,"The "),Ee=s(Ne,"A",{href:!0});var cr=n(Ee);ho=l(cr,"SwiftFormerModel"),cr.forEach(o),po=l(Ne," forward method, overrides the "),Qe=s(Ne,"CODE",{});var mr=n(Qe);uo=l(mr,"__call__"),mr.forEach(o),go=l(Ne," special method."),Ne.forEach(o),wo=g(K),y(q.$$.fragment,K),_o=g(K),y(Y.$$.fragment,K),K.forEach(o),ke.forEach(o),pt=g(e),P=s(e,"H2",{class:!0});var Mt=n(P);H=s(Mt,"A",{id:!0,class:!0,href:!0});var dr=n(H);qe=s(dr,"SPAN",{});var fr=n(qe);y(ue.$$.fragment,fr),fr.forEach(o),dr.forEach(o),vo=g(Mt),Ye=s(Mt,"SPAN",{});var hr=n(Ye);bo=l(hr,"SwiftFormerForImageClassification"),hr.forEach(o),Mt.forEach(o),ut=g(e),C=s(e,"DIV",{class:!0});var ee=n(C);y(ge.$$.fragment,ee),yo=g(ee),He=s(ee,"P",{});var pr=n(He);Mo=l(pr,"SwiftFormer Model transformer with an image classification head on top (e.g. for ImageNet)."),pr.forEach(o),Fo=g(ee),we=s(ee,"P",{});var Ft=n(we);$o=l(Ft,"This model is a PyTorch "),_e=s(Ft,"A",{href:!0,rel:!0});var ur=n(_e);So=l(ur,"torch.nn.Module"),ur.forEach(o),To=l(Ft,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ft.forEach(o),Co=g(ee),j=s(ee,"DIV",{class:!0});var te=n(j);y(ve.$$.fragment,te),Uo=g(te),V=s(te,"P",{});var Re=n(V);Io=l(Re,"The "),Je=s(Re,"A",{href:!0});var gr=n(Je);jo=l(gr,"SwiftFormerForImageClassification"),gr.forEach(o),Eo=l(Re," forward method, overrides the "),Oe=s(Re,"CODE",{});var wr=n(Oe);Jo=l(wr,"__call__"),wr.forEach(o),Zo=l(Re," special method."),Re.forEach(o),xo=g(te),y(O.$$.fragment,te),Wo=g(te),y(D.$$.fragment,te),te.forEach(o),ee.forEach(o),this.h()},h(){m(c,"name","hf:doc:metadata"),m(c,"content",JSON.stringify(jr)),m(f,"id","swiftformer"),m(f,"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"),m(f,"href","#swiftformer"),m(w,"class","relative group"),m(G,"id","overview"),m(G,"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"),m(G,"href","#overview"),m(x,"class","relative group"),m(re,"href","https://arxiv.org/abs/2303.15446"),m(re,"rel","nofollow"),m(Ce,"href","/docs/transformers/v4.33.0/en/model_doc/vit#transformers.ViTImageProcessor"),m(se,"href","https://huggingface.co/shehan97"),m(se,"rel","nofollow"),m(ne,"href","https://github.com/Amshaker/SwiftFormer"),m(ne,"rel","nofollow"),m(z,"id","transformers.SwiftFormerConfig"),m(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"),m(z,"href","#transformers.SwiftFormerConfig"),m(W,"class","relative group"),m(Ue,"href","/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerModel"),m(ce,"href","https://huggingface.co/MBZUAI/swiftformer-xs"),m(ce,"rel","nofollow"),m(Ie,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(je,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Q,"id","transformers.SwiftFormerModel"),m(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"),m(Q,"href","#transformers.SwiftFormerModel"),m(R,"class","relative group"),m(he,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(he,"rel","nofollow"),m(Ee,"href","/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerModel"),m(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(H,"id","transformers.SwiftFormerForImageClassification"),m(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"),m(H,"href","#transformers.SwiftFormerForImageClassification"),m(P,"class","relative group"),m(_e,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(_e,"rel","nofollow"),m(Je,"href","/docs/transformers/v4.33.0/en/model_doc/swiftformer#transformers.SwiftFormerForImageClassification"),m(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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,d){t(document.head,c),p(e,v,d),p(e,w,d),t(w,f),t(f,_),M(r,_,null),t(w,h),t(w,E),t(E,$t),p(e,ot,d),p(e,x,d),t(x,G),t(G,Ae),M(oe,Ae,null),t(x,St),t(x,Pe),t(Pe,Tt),p(e,rt,d),p(e,B,d),t(B,Ct),t(B,re),t(re,Ut),t(B,It),p(e,at,d),p(e,Me,d),t(Me,jt),p(e,st,d),p(e,Fe,d),t(Fe,Et),p(e,nt,d),p(e,$e,d),t($e,Ve),t(Ve,Jt),p(e,it,d),p(e,Se,d),t(Se,Zt),p(e,lt,d),p(e,Te,d),t(Te,ae),t(ae,xt),t(ae,Ce),t(Ce,Wt),t(ae,kt),p(e,ct,d),p(e,Z,d),t(Z,Nt),t(Z,se),t(se,Rt),t(Z,At),t(Z,ne),t(ne,Pt),t(Z,Vt),p(e,mt,d),p(e,W,d),t(W,z),t(z,Ge),M(ie,Ge,null),t(W,Gt),t(W,Be),t(Be,Bt),p(e,dt,d),p(e,T,d),M(le,T,null),t(T,zt),t(T,k),t(k,Xt),t(k,Ue),t(Ue,Qt),t(k,qt),t(k,ce),t(ce,Yt),t(k,Ht),t(T,Ot),t(T,N),t(N,Dt),t(N,Ie),t(Ie,Lt),t(N,Kt),t(N,je),t(je,eo),t(N,to),t(T,oo),M(X,T,null),p(e,ft,d),p(e,R,d),t(R,Q),t(Q,ze),M(me,ze,null),t(R,ro),t(R,Xe),t(Xe,ao),p(e,ht,d),p(e,J,d),M(de,J,null),t(J,so),t(J,fe),t(fe,no),t(fe,he),t(he,io),t(fe,lo),t(J,co),t(J,I),M(pe,I,null),t(I,mo),t(I,A),t(A,fo),t(A,Ee),t(Ee,ho),t(A,po),t(A,Qe),t(Qe,uo),t(A,go),t(I,wo),M(q,I,null),t(I,_o),M(Y,I,null),p(e,pt,d),p(e,P,d),t(P,H),t(H,qe),M(ue,qe,null),t(P,vo),t(P,Ye),t(Ye,bo),p(e,ut,d),p(e,C,d),M(ge,C,null),t(C,yo),t(C,He),t(He,Mo),t(C,Fo),t(C,we),t(we,$o),t(we,_e),t(_e,So),t(we,To),t(C,Co),t(C,j),M(ve,j,null),t(j,Uo),t(j,V),t(V,Io),t(V,Je),t(Je,jo),t(V,Eo),t(V,Oe),t(Oe,Jo),t(V,Zo),t(j,xo),M(O,j,null),t(j,Wo),M(D,j,null),gt=!0},p(e,[d]){const be={};d&2&&(be.$$scope={dirty:d,ctx:e}),X.$set(be);const De={};d&2&&(De.$$scope={dirty:d,ctx:e}),q.$set(De);const Le={};d&2&&(Le.$$scope={dirty:d,ctx:e}),Y.$set(Le);const Ke={};d&2&&(Ke.$$scope={dirty:d,ctx:e}),O.$set(Ke);const ye={};d&2&&(ye.$$scope={dirty:d,ctx:e}),D.$set(ye)},i(e){gt||(F(r.$$.fragment,e),F(oe.$$.fragment,e),F(ie.$$.fragment,e),F(le.$$.fragment,e),F(X.$$.fragment,e),F(me.$$.fragment,e),F(de.$$.fragment,e),F(pe.$$.fragment,e),F(q.$$.fragment,e),F(Y.$$.fragment,e),F(ue.$$.fragment,e),F(ge.$$.fragment,e),F(ve.$$.fragment,e),F(O.$$.fragment,e),F(D.$$.fragment,e),gt=!0)},o(e){$(r.$$.fragment,e),$(oe.$$.fragment,e),$(ie.$$.fragment,e),$(le.$$.fragment,e),$(X.$$.fragment,e),$(me.$$.fragment,e),$(de.$$.fragment,e),$(pe.$$.fragment,e),$(q.$$.fragment,e),$(Y.$$.fragment,e),$(ue.$$.fragment,e),$(ge.$$.fragment,e),$(ve.$$.fragment,e),$(O.$$.fragment,e),$(D.$$.fragment,e),gt=!1},d(e){o(c),e&&o(v),e&&o(w),S(r),e&&o(ot),e&&o(x),S(oe),e&&o(rt),e&&o(B),e&&o(at),e&&o(Me),e&&o(st),e&&o(Fe),e&&o(nt),e&&o($e),e&&o(it),e&&o(Se),e&&o(lt),e&&o(Te),e&&o(ct),e&&o(Z),e&&o(mt),e&&o(W),S(ie),e&&o(dt),e&&o(T),S(le),S(X),e&&o(ft),e&&o(R),S(me),e&&o(ht),e&&o(J),S(de),S(pe),S(q),S(Y),e&&o(pt),e&&o(P),S(ue),e&&o(ut),e&&o(C),S(ge),S(ve),S(O),S(D)}}}const jr={local:"swiftformer",sections:[{local:"overview",title:"Overview"},{local:"transformers.SwiftFormerConfig",title:"SwiftFormerConfig"},{local:"transformers.SwiftFormerModel",title:"SwiftFormerModel"},{local:"transformers.SwiftFormerForImageClassification",title:"SwiftFormerForImageClassification"}],title:"SwiftFormer"};function Er(U){return Fr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rr extends vr{constructor(c){super();br(this,c,Er,Ir,yr,{})}}export{Rr as default,jr as metadata};
