import{S as hc,i as pc,s as uc,e as r,k as p,w as v,t as s,M as gc,c as n,d as o,m as u,a,x as w,h as i,b as d,G as e,g as _,y as F,q as E,o as T,B as M,v as _c,L as At}from"../../chunks/vendor-hf-doc-builder.js";import{T as Gt}from"../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../chunks/Docstring-hf-doc-builder.js";import{C as St}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Y}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Bt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function yc(W){let c,b,h,m,y;return m=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVmZmljaWVudEZvcm1lckNvbmZpZyUyQyUyMEVmZmljaWVudEZvcm1lck1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEVmZmljaWVudEZvcm1lciUyMGVmZmljaWVudGZvcm1lci1sMSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBFZmZpY2llbnRGb3JtZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBFZmZpY2llbnRGb3JtZXJNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZWZmaWNpZW50Zm9ybWVyLWwzJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBFZmZpY2llbnRGb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> EfficientFormerConfig, EfficientFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a EfficientFormer efficientformer-l1 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = EfficientFormerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a EfficientFormerModel (with random weights) from the efficientformer-l3 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientFormerModel(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=r("p"),b=s("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=a(c);b=i(f,"Example:"),f.forEach(o),h=u(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:At,i(l){y||(E(m.$$.fragment,l),y=!0)},o(l){T(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function bc(W){let c,b,h,m,y;return{c(){c=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=s("Module"),y=s(`
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(l){c=n(l,"P",{});var f=a(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(f,"CODE",{});var I=a(h);m=i(I,"Module"),I.forEach(o),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,c,f),e(c,b),e(c,h),e(h,m),e(c,y)},d(l){l&&o(c)}}}function vc(W){let c,b,h,m,y;return m=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudEZvcm1lck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEFtb2RlbCUyMCUzRCUyMEVmZmljaWVudEZvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientFormerModel
<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;snap-research/efficientformer-l1-300&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientFormerModel.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">49</span>, <span class="hljs-number">448</span>]`}}),{c(){c=r("p"),b=s("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=a(c);b=i(f,"Example:"),f.forEach(o),h=u(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:At,i(l){y||(E(m.$$.fragment,l),y=!0)},o(l){T(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function wc(W){let c,b,h,m,y;return{c(){c=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=s("Module"),y=s(`
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(l){c=n(l,"P",{});var f=a(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(f,"CODE",{});var I=a(h);m=i(I,"Module"),I.forEach(o),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,c,f),e(c,b),e(c,h),e(h,m),e(c,y)},d(l){l&&o(c)}}}function Fc(W){let c,b,h,m,y;return m=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQW1vZGVsJTIwJTNEJTIwRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyc25hcC1yZXNlYXJjaCUyRmVmZmljaWVudGZvcm1lci1sMS0zMDAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientFormerForImageClassification
<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;snap-research/efficientformer-l1-300&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientFormerForImageClassification.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
Egyptian cat`}}),{c(){c=r("p"),b=s("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=a(c);b=i(f,"Example:"),f.forEach(o),h=u(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:At,i(l){y||(E(m.$$.fragment,l),y=!0)},o(l){T(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function Ec(W){let c,b;return{c(){c=r("p"),b=s(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`)},l(h){c=n(h,"P",{});var m=a(c);b=i(m,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),m.forEach(o)},m(h,m){_(h,c,m),e(c,b)},d(h){h&&o(c)}}}function Tc(W){let c,b,h,m,y;return{c(){c=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=s("Module"),y=s(`
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(l){c=n(l,"P",{});var f=a(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(f,"CODE",{});var I=a(h);m=i(I,"Module"),I.forEach(o),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,c,f),e(c,b),e(c,h),e(h,m),e(c,y)},d(l){l&&o(c)}}}function Mc(W){let c,b,h,m,y;return m=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb25XaXRoVGVhY2hlciUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc25hcC1yZXNlYXJjaCUyRmVmZmljaWVudGZvcm1lci1sMS0zMDAlMjIpJTBBbW9kZWwlMjAlM0QlMjBFZmZpY2llbnRGb3JtZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uV2l0aFRlYWNoZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientFormerForImageClassificationWithTeacher
<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;snap-research/efficientformer-l1-300&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientFormerForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">49</span>, <span class="hljs-number">448</span>]`}}),{c(){c=r("p"),b=s("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=a(c);b=i(f,"Example:"),f.forEach(o),h=u(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:At,i(l){y||(E(m.$$.fragment,l),y=!0)},o(l){T(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function Wc(W){let c,b,h,m,y;return{c(){c=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=s("Module"),y=s(`
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(l){c=n(l,"P",{});var f=a(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(f,"CODE",{});var I=a(h);m=i(I,"Module"),I.forEach(o),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,c,f),e(c,b),e(c,h),e(h,m),e(c,y)},d(l){l&&o(c)}}}function Ic(W){let c,b,h,m,y;return m=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc25hcC1yZXNlYXJjaCUyRmVmZmljaWVudGZvcm1lci1sMS0zMDAlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkVmZmljaWVudEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFEfficientFormerForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEfficientFormerForImageClassification.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
LABEL_281`}}),{c(){c=r("p"),b=s("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=a(c);b=i(f,"Example:"),f.forEach(o),h=u(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:At,i(l){y||(E(m.$$.fragment,l),y=!0)},o(l){T(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function jc(W){let c,b,h,m,y;return{c(){c=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=s("Module"),y=s(`
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(l){c=n(l,"P",{});var f=a(c);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(f,"CODE",{});var I=a(h);m=i(I,"Module"),I.forEach(o),y=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,c,f),e(c,b),e(c,h),e(h,m),e(c,y)},d(l){l&&o(c)}}}function Zc(W){let c,b,h,m,y;return m=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSkpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFEfficientFormerForImageClassificationWithTeacher
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEfficientFormerForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">&quot;snap-research/efficientformer-l1-300&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
LABEL_281`}}),{c(){c=r("p"),b=s("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=a(c);b=i(f,"Example:"),f.forEach(o),h=u(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:At,i(l){y||(E(m.$$.fragment,l),y=!0)},o(l){T(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function Jc(W){let c,b,h,m,y,l,f,I,un,Wr,O,ue,_o,De,gn,yo,_n,Ir,ge,yn,Qe,bn,vn,jr,Xt,wn,Zr,qt,bo,Fn,Jr,U,En,Oe,Tn,Mn,He,$n,Cn,Ke,Wn,In,et,jn,Zn,Ur,H,_e,vo,tt,Jn,wo,Un,kr,Yt,Fo,Lt,kn,zr,K,ye,Eo,ot,zn,To,xn,xr,z,rt,Nn,ee,Vn,Dt,Rn,Pn,nt,Gn,Bn,An,te,Sn,Qt,Xn,qn,Ot,Yn,Ln,Dn,be,Nr,oe,ve,Mo,at,Qn,$o,On,Vr,S,st,Hn,Co,Kn,ea,we,it,ta,Wo,oa,Rr,re,Fe,Io,lt,ra,jo,na,Pr,X,ct,aa,dt,sa,ft,ia,la,ca,R,mt,da,ne,fa,Ht,ma,ha,Zo,pa,ua,ga,Ee,_a,Te,Gr,ae,Me,Jo,ht,ya,Uo,ba,Br,x,pt,va,ko,wa,Fa,ut,Ea,gt,Ta,Ma,$a,P,_t,Ca,se,Wa,Kt,Ia,ja,zo,Za,Ja,Ua,$e,ka,Ce,Ar,ie,We,xo,yt,za,No,xa,Sr,j,bt,Na,Vo,Va,Ra,Ie,Pa,vt,Ga,wt,Ba,Aa,Sa,G,Ft,Xa,le,qa,eo,Ya,La,Ro,Da,Qa,Oa,je,Ha,Ze,Xr,ce,Je,Po,Et,Ka,Go,es,qr,q,Tt,ts,Mt,os,$t,rs,ns,as,B,Ct,ss,de,is,to,ls,cs,Bo,ds,fs,ms,Ue,hs,ke,Yr,fe,ze,Ao,Wt,ps,So,us,Lr,N,It,gs,Xo,_s,ys,jt,bs,Zt,vs,ws,Fs,A,Jt,Es,me,Ts,oo,Ms,$s,qo,Cs,Ws,Is,xe,js,Ne,Dr,he,Ve,Yo,Ut,Zs,Lo,Js,Qr,Z,kt,Us,Do,ks,zs,Qo,xs,Ns,zt,Vs,xt,Rs,Ps,Gs,k,Nt,Bs,pe,As,ro,Ss,Xs,Oo,qs,Ys,Ls,Re,Ds,Ho,$,Ko,Qs,Os,no,Hs,Ks,er,ei,ti,tr,oi,ri,or,ni,ai,rr,si,ii,nr,li,ci,ar,di,fi,sr,mi,hi,ir,pi,ui,lr,gi,_i,cr,yi,bi,dr,vi,wi,fr,Fi,Ei,mr,Ti,Mi,hr,$i,Ci,pr,Wi,Ii,ur,ji,Zi,gr,Ji,Ui,_r,ki,zi,xi,Pe,Or;return l=new Y({}),De=new Y({}),tt=new Y({}),ot=new Y({}),rt=new J({props:{name:"class transformers.EfficientFormerConfig",anchor:"transformers.EfficientFormerConfig",parameters:[{name:"depths",val:": typing.List[int] = [3, 2, 6, 4]"},{name:"hidden_sizes",val:": typing.List[int] = [48, 96, 224, 448]"},{name:"downsamples",val:": typing.List[bool] = [True, True, True, True]"},{name:"dim",val:": int = 448"},{name:"key_dim",val:": int = 32"},{name:"attention_ratio",val:": int = 4"},{name:"resolution",val:": int = 7"},{name:"num_hidden_layers",val:": int = 5"},{name:"num_attention_heads",val:": int = 8"},{name:"mlp_expansion_ratio",val:": int = 4"},{name:"hidden_dropout_prob",val:": float = 0.0"},{name:"patch_size",val:": int = 16"},{name:"num_channels",val:": int = 3"},{name:"pool_size",val:": int = 3"},{name:"downsample_patch_size",val:": int = 3"},{name:"downsample_stride",val:": int = 2"},{name:"downsample_pad",val:": int = 1"},{name:"drop_path_rate",val:": float = 0.0"},{name:"num_meta3d_blocks",val:": int = 1"},{name:"distillation",val:": bool = True"},{name:"use_layer_scale",val:": bool = True"},{name:"layer_scale_init_value",val:": float = 1e-05"},{name:"hidden_act",val:": str = 'gelu'"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"image_size",val:": int = 224"},{name:"batch_norm_eps",val:": float = 1e-05"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerConfig.depths",description:`<strong>depths</strong> (<code>List(int)</code>, <em>optional</em>, defaults to <code>[3, 2, 6, 4]</code>) &#x2014;
Depth of each stage.`,name:"depths"},{anchor:"transformers.EfficientFormerConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List(int)</code>, <em>optional</em>, defaults to <code>[48, 96, 224, 448]</code>) &#x2014;
Dimensionality of each stage.`,name:"hidden_sizes"},{anchor:"transformers.EfficientFormerConfig.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.EfficientFormerConfig.dim",description:`<strong>dim</strong> (<code>int</code>, <em>optional</em>, defaults to 448) &#x2014;
Number of channels in Meta3D layers`,name:"dim"},{anchor:"transformers.EfficientFormerConfig.key_dim",description:`<strong>key_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size of the key in meta3D block.`,name:"key_dim"},{anchor:"transformers.EfficientFormerConfig.attention_ratio",description:`<strong>attention_ratio</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Ratio of the dimension of the query and value to the dimension of the key in MSHA block`,name:"attention_ratio"},{anchor:"transformers.EfficientFormerConfig.resolution",description:`<strong>resolution</strong> (<code>int</code>, <em>optional</em>, defaults to 7) &#x2014;
Size of each patch`,name:"resolution"},{anchor:"transformers.EfficientFormerConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.EfficientFormerConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the 3D MetaBlock.`,name:"num_attention_heads"},{anchor:"transformers.EfficientFormerConfig.mlp_expansion_ratio",description:`<strong>mlp_expansion_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_expansion_ratio"},{anchor:"transformers.EfficientFormerConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings and encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.EfficientFormerConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.EfficientFormerConfig.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.EfficientFormerConfig.pool_size",description:`<strong>pool_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Kernel size of pooling layers.`,name:"pool_size"},{anchor:"transformers.EfficientFormerConfig.downsample_patch_size",description:`<strong>downsample_patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The size of patches in downsampling layers.`,name:"downsample_patch_size"},{anchor:"transformers.EfficientFormerConfig.downsample_stride",description:`<strong>downsample_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The stride of convolution kernels in downsampling layers.`,name:"downsample_stride"},{anchor:"transformers.EfficientFormerConfig.downsample_pad",description:`<strong>downsample_pad</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding in downsampling layers.`,name:"downsample_pad"},{anchor:"transformers.EfficientFormerConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Rate at which to increase dropout probability in DropPath.`,name:"drop_path_rate"},{anchor:"transformers.EfficientFormerConfig.num_meta3d_blocks",description:`<strong>num_meta3d_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of 3D MetaBlocks in the last stage.`,name:"num_meta3d_blocks"},{anchor:"transformers.EfficientFormerConfig.distillation",description:`<strong>distillation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a distillation head.`,name:"distillation"},{anchor:"transformers.EfficientFormerConfig.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.EfficientFormerConfig.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.EfficientFormerConfig.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 and pooler. 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.EfficientFormerConfig.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.EfficientFormerConfig.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.EfficientFormerConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>224</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/efficientformer/configuration_efficientformer.py#L32"}}),be=new Bt({props:{anchor:"transformers.EfficientFormerConfig.example",$$slots:{default:[yc]},$$scope:{ctx:W}}}),at=new Y({}),st=new J({props:{name:"class transformers.EfficientFormerImageProcessor",anchor:"transformers.EfficientFormerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code>. Can be overridden by the <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.EfficientFormerImageProcessor.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.EfficientFormerImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.EfficientFormerImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.EfficientFormerImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.EfficientFormerImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.EfficientFormerImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.EfficientFormerImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.EfficientFormerImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/efficientformer/image_processing_efficientformer.py#L46"}}),it=new J({props:{name:"preprocess",anchor:"transformers.EfficientFormerImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Dictionary in the format <code>{&quot;height&quot;: h, &quot;width&quot;: w}</code> specifying the size of the output image after
resizing.`,name:"size"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
<code>PILImageResampling</code> filter to use if resizing the image e.g. <code>PILImageResampling.BILINEAR</code>. Only has
an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/efficientformer/image_processing_efficientformer.py#L229"}}),lt=new Y({}),ct=new J({props:{name:"class transformers.EfficientFormerModel",anchor:"transformers.EfficientFormerModel",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.EfficientFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</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.30.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.30.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L557"}}),mt=new J({props:{name:"forward",anchor:"transformers.EfficientFormerModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = 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.EfficientFormerModel.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.30.0/en/model_doc/vit#transformers.ViTFeatureExtractor">ViTFeatureExtractor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">ViTFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientFormerModel.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.EfficientFormerModel.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.EfficientFormerModel.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.30.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.30.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L569",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig"
>EfficientFormerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) 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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ee=new Gt({props:{$$slots:{default:[bc]},$$scope:{ctx:W}}}),Te=new Bt({props:{anchor:"transformers.EfficientFormerModel.forward.example",$$slots:{default:[vc]},$$scope:{ctx:W}}}),ht=new Y({}),pt=new J({props:{name:"class transformers.EfficientFormerForImageClassification",anchor:"transformers.EfficientFormerForImageClassification",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.EfficientFormerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</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.30.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.30.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L619"}}),_t=new J({props:{name:"forward",anchor:"transformers.EfficientFormerForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.EfficientFormerForImageClassification.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.30.0/en/model_doc/vit#transformers.ViTFeatureExtractor">ViTFeatureExtractor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">ViTFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientFormerForImageClassification.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.EfficientFormerForImageClassification.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.EfficientFormerForImageClassification.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EfficientFormerForImageClassification.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.30.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L634",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</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.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig"
>EfficientFormerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Gt({props:{$$slots:{default:[wc]},$$scope:{ctx:W}}}),Ce=new Bt({props:{anchor:"transformers.EfficientFormerForImageClassification.forward.example",$$slots:{default:[Fc]},$$scope:{ctx:W}}}),yt=new Y({}),bt=new J({props:{name:"class transformers.EfficientFormerForImageClassificationWithTeacher",anchor:"transformers.EfficientFormerForImageClassificationWithTeacher",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</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.30.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.30.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L749"}}),Ie=new Gt({props:{warning:!0,$$slots:{default:[Ec]},$$scope:{ctx:W}}}),Ft=new J({props:{name:"forward",anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = 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.EfficientFormerForImageClassificationWithTeacher.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.30.0/en/model_doc/vit#transformers.ViTFeatureExtractor">ViTFeatureExtractor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">ViTFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.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.EfficientFormerForImageClassificationWithTeacher.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.EfficientFormerForImageClassificationWithTeacher.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.30.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.30.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L766",returnDescription:`
<p>A <code>transformers.models.efficientformer.modeling_efficientformer.EfficientFormerForImageClassificationWithTeacherOutput</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.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig"
>EfficientFormerConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores as the average of the cls_logits and distillation logits.</li>
<li><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).</li>
<li><strong>distillation_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).</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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.efficientformer.modeling_efficientformer.EfficientFormerForImageClassificationWithTeacherOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new Gt({props:{$$slots:{default:[Tc]},$$scope:{ctx:W}}}),Ze=new Bt({props:{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward.example",$$slots:{default:[Mc]},$$scope:{ctx:W}}}),Et=new Y({}),Tt=new J({props:{name:"class transformers.TFEfficientFormerModel",anchor:"transformers.TFEfficientFormerModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEfficientFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</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.30.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.30.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L775"}}),Ct=new J({props:{name:"call",anchor:"transformers.TFEfficientFormerModel.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerModel.call.pixel_values",description:`<strong>pixel_values</strong> ((<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">EfficientFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFEfficientFormerModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFEfficientFormerModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFEfficientFormerModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.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.30.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L781",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig"
>EfficientFormerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) 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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ue=new Gt({props:{$$slots:{default:[$c]},$$scope:{ctx:W}}}),ke=new Bt({props:{anchor:"transformers.TFEfficientFormerModel.call.example",$$slots:{default:[Cc]},$$scope:{ctx:W}}}),Wt=new Y({}),It=new J({props:{name:"class transformers.TFEfficientFormerForImageClassification",anchor:"transformers.TFEfficientFormerForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</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.30.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.30.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L815"}}),Jt=new J({props:{name:"call",anchor:"transformers.TFEfficientFormerForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> ((<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">EfficientFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L829",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig"
>EfficientFormerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),xe=new Gt({props:{$$slots:{default:[Wc]},$$scope:{ctx:W}}}),Ne=new Bt({props:{anchor:"transformers.TFEfficientFormerForImageClassification.call.example",$$slots:{default:[Ic]},$$scope:{ctx:W}}}),Ut=new Y({}),kt=new J({props:{name:"class transformers.TFEfficientFormerForImageClassificationWithTeacher",anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</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.30.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.30.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L920"}}),Nt=new J({props:{name:"call",anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.pixel_values",description:`<strong>pixel_values</strong> ((<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">EfficientFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.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.30.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L939",returnDescription:`
<p>A <code>transformers.models.efficientformer.modeling_tf_efficientformer.TFEfficientFormerForImageClassificationWithTeacherOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerConfig"
>EfficientFormerConfig</a>) and inputs.</p>
`,returnType:`
<p><code>transformers.models.efficientformer.modeling_tf_efficientformer.TFEfficientFormerForImageClassificationWithTeacherOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Re=new Gt({props:{$$slots:{default:[jc]},$$scope:{ctx:W}}}),Pe=new Bt({props:{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.example",$$slots:{default:[Zc]},$$scope:{ctx:W}}}),{c(){c=r("meta"),b=p(),h=r("h1"),m=r("a"),y=r("span"),v(l.$$.fragment),f=p(),I=r("span"),un=s("EfficientFormer"),Wr=p(),O=r("h2"),ue=r("a"),_o=r("span"),v(De.$$.fragment),gn=p(),yo=r("span"),_n=s("Overview"),Ir=p(),ge=r("p"),yn=s("The EfficientFormer model was proposed in "),Qe=r("a"),bn=s("EfficientFormer: Vision Transformers at MobileNet Speed"),vn=s(`
by Yanyu Li, Geng Yuan, Yang Wen, Eric Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, Jian Ren.  EfficientFormer proposes a
dimension-consistent pure transformer that can be run on mobile devices for dense prediction tasks like image classification, object
detection and semantic segmentation.`),jr=p(),Xt=r("p"),wn=s("The abstract from the paper is the following:"),Zr=p(),qt=r("p"),bo=r("em"),Fn=s(`Vision Transformers (ViT) have shown rapid progress in computer vision tasks, achieving promising results on various benchmarks.
However, due to the massive number of parameters and model design, e.g., attention mechanism, ViT-based models are generally
times slower than lightweight convolutional networks. Therefore, the deployment of ViT for real-time applications is particularly
challenging, especially on resource-constrained hardware such as mobile devices. Recent efforts try to reduce the computation
complexity of ViT through network architecture search or hybrid design with MobileNet block, yet the inference speed is still
unsatisfactory. This leads to an important question: can transformers run as fast as MobileNet while obtaining high performance?
To answer this, we first revisit the network architecture and operators used in ViT-based models and identify inefficient designs.
Then we introduce a dimension-consistent pure transformer (without MobileNet blocks) as a design paradigm.
Finally, we perform latency-driven slimming to get a series of final models dubbed EfficientFormer.
Extensive experiments show the superiority of EfficientFormer in performance and speed on mobile devices.
Our fastest model, EfficientFormer-L1, achieves 79.2% top-1 accuracy on ImageNet-1K with only 1.6 ms inference latency on
iPhone 12 (compiled with CoreML), which { runs as fast as MobileNetV2\xD71.4 (1.6 ms, 74.7% top-1),} and our largest model,
EfficientFormer-L7, obtains 83.3% accuracy with only 7.0 ms latency. Our work proves that properly designed transformers can
reach extremely low latency on mobile devices while maintaining high performance.`),Jr=p(),U=r("p"),En=s("This model was contributed by "),Oe=r("a"),Tn=s("novice03"),Mn=s(" and "),He=r("a"),$n=s("Bearnardd"),Cn=s(`.
The original code can be found `),Ke=r("a"),Wn=s("here"),In=s(". The TensorFlow version of this model was added by "),et=r("a"),jn=s("D-Roberts"),Zn=s("."),Ur=p(),H=r("h2"),_e=r("a"),vo=r("span"),v(tt.$$.fragment),Jn=p(),wo=r("span"),Un=s("Documentation resources"),kr=p(),Yt=r("ul"),Fo=r("li"),Lt=r("a"),kn=s("Image classification task guide"),zr=p(),K=r("h2"),ye=r("a"),Eo=r("span"),v(ot.$$.fragment),zn=p(),To=r("span"),xn=s("EfficientFormerConfig"),xr=p(),z=r("div"),v(rt.$$.fragment),Nn=p(),ee=r("p"),Vn=s("This is the configuration class to store the configuration of an "),Dt=r("a"),Rn=s("EfficientFormerModel"),Pn=s(`. It is used to
instantiate an EfficientFormer 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 EfficientFormer
`),nt=r("a"),Gn=s("snap-research/efficientformer-l1"),Bn=s(" architecture."),An=p(),te=r("p"),Sn=s("Configuration objects inherit from "),Qt=r("a"),Xn=s("PretrainedConfig"),qn=s(` and can be used to control the model outputs. Read the
documentation from `),Ot=r("a"),Yn=s("PretrainedConfig"),Ln=s(" for more information."),Dn=p(),v(be.$$.fragment),Nr=p(),oe=r("h2"),ve=r("a"),Mo=r("span"),v(at.$$.fragment),Qn=p(),$o=r("span"),On=s("EfficientFormerImageProcessor"),Vr=p(),S=r("div"),v(st.$$.fragment),Hn=p(),Co=r("p"),Kn=s("Constructs a EfficientFormer image processor."),ea=p(),we=r("div"),v(it.$$.fragment),ta=p(),Wo=r("p"),oa=s("Preprocess an image or batch of images."),Rr=p(),re=r("h2"),Fe=r("a"),Io=r("span"),v(lt.$$.fragment),ra=p(),jo=r("span"),na=s("EfficientFormerModel"),Pr=p(),X=r("div"),v(ct.$$.fragment),aa=p(),dt=r("p"),sa=s(`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ft=r("a"),ia=s("nn.Module"),la=s(` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),ca=p(),R=r("div"),v(mt.$$.fragment),da=p(),ne=r("p"),fa=s("The "),Ht=r("a"),ma=s("EfficientFormerModel"),ha=s(" forward method, overrides the "),Zo=r("code"),pa=s("__call__"),ua=s(" special method."),ga=p(),v(Ee.$$.fragment),_a=p(),v(Te.$$.fragment),Gr=p(),ae=r("h2"),Me=r("a"),Jo=r("span"),v(ht.$$.fragment),ya=p(),Uo=r("span"),ba=s("EfficientFormerForImageClassification"),Br=p(),x=r("div"),v(pt.$$.fragment),va=p(),ko=r("p"),wa=s(`EfficientFormer 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.`),Fa=p(),ut=r("p"),Ea=s("This model is a PyTorch "),gt=r("a"),Ta=s("nn.Module"),Ma=s(` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),$a=p(),P=r("div"),v(_t.$$.fragment),Ca=p(),se=r("p"),Wa=s("The "),Kt=r("a"),Ia=s("EfficientFormerForImageClassification"),ja=s(" forward method, overrides the "),zo=r("code"),Za=s("__call__"),Ja=s(" special method."),Ua=p(),v($e.$$.fragment),ka=p(),v(Ce.$$.fragment),Ar=p(),ie=r("h2"),We=r("a"),xo=r("span"),v(yt.$$.fragment),za=p(),No=r("span"),xa=s("EfficientFormerForImageClassificationWithTeacher"),Sr=p(),j=r("div"),v(bt.$$.fragment),Na=p(),Vo=r("p"),Va=s(`EfficientFormer Model transformer with image classification heads on top (a linear layer on top of the final hidden
state of the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for
ImageNet.`),Ra=p(),v(Ie.$$.fragment),Pa=p(),vt=r("p"),Ga=s("This model is a PyTorch "),wt=r("a"),Ba=s("nn.Module"),Aa=s(` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Sa=p(),G=r("div"),v(Ft.$$.fragment),Xa=p(),le=r("p"),qa=s("The "),eo=r("a"),Ya=s("EfficientFormerForImageClassificationWithTeacher"),La=s(" forward method, overrides the "),Ro=r("code"),Da=s("__call__"),Qa=s(" special method."),Oa=p(),v(je.$$.fragment),Ha=p(),v(Ze.$$.fragment),Xr=p(),ce=r("h2"),Je=r("a"),Po=r("span"),v(Et.$$.fragment),Ka=p(),Go=r("span"),es=s("TFEfficientFormerModel"),qr=p(),q=r("div"),v(Tt.$$.fragment),ts=p(),Mt=r("p"),os=s(`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),$t=r("a"),rs=s("tf.keras.layers.Layer"),ns=s(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),as=p(),B=r("div"),v(Ct.$$.fragment),ss=p(),de=r("p"),is=s("The "),to=r("a"),ls=s("TFEfficientFormerModel"),cs=s(" forward method, overrides the "),Bo=r("code"),ds=s("__call__"),fs=s(" special method."),ms=p(),v(Ue.$$.fragment),hs=p(),v(ke.$$.fragment),Yr=p(),fe=r("h2"),ze=r("a"),Ao=r("span"),v(Wt.$$.fragment),ps=p(),So=r("span"),us=s("TFEfficientFormerForImageClassification"),Lr=p(),N=r("div"),v(It.$$.fragment),gs=p(),Xo=r("p"),_s=s(`EfficientFormer Model transformer with an image classification head on top of pooled last hidden state, e.g. for
ImageNet.`),ys=p(),jt=r("p"),bs=s(`This model is a TensorFlow
`),Zt=r("a"),vs=s("tf.keras.layers.Layer"),ws=s(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Fs=p(),A=r("div"),v(Jt.$$.fragment),Es=p(),me=r("p"),Ts=s("The "),oo=r("a"),Ms=s("TFEfficientFormerForImageClassification"),$s=s(" forward method, overrides the "),qo=r("code"),Cs=s("__call__"),Ws=s(" special method."),Is=p(),v(xe.$$.fragment),js=p(),v(Ne.$$.fragment),Dr=p(),he=r("h2"),Ve=r("a"),Yo=r("span"),v(Ut.$$.fragment),Zs=p(),Lo=r("span"),Js=s("TFEfficientFormerForImageClassificationWithTeacher"),Qr=p(),Z=r("div"),v(kt.$$.fragment),Us=p(),Do=r("p"),ks=s(`EfficientFormer Model transformer with image classification heads on top (a linear layer on top of the final hidden
state and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`),zs=p(),Qo=r("p"),xs=s(`.. warning::
This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Ns=p(),zt=r("p"),Vs=s(`This model is a TensorFlow
`),xt=r("a"),Rs=s("tf.keras.layers.Layer"),Ps=s(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Gs=p(),k=r("div"),v(Nt.$$.fragment),Bs=p(),pe=r("p"),As=s("The "),ro=r("a"),Ss=s("TFEfficientFormerForImageClassificationWithTeacher"),Xs=s(" forward method, overrides the "),Oo=r("code"),qs=s("__call__"),Ys=s(" special method."),Ls=p(),v(Re.$$.fragment),Ds=p(),Ho=r("ul"),$=r("li"),Ko=r("strong"),Qs=s("Output"),Os=s(" type of "),no=r("a"),Hs=s("EfficientFormerForImageClassificationWithTeacher"),Ks=s(`.
logits (`),er=r("code"),ei=s("tf.Tensor"),ti=s(" of shape "),tr=r("code"),oi=s("(batch_size, config.num_labels)"),ri=s(`) \u2014 Prediction scores as the average of the cls_logits and distillation logits.
cls_logits (`),or=r("code"),ni=s("tf.Tensor"),ai=s(" of shape "),rr=r("code"),si=s("(batch_size, config.num_labels)"),ii=s(`) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).
distillation_logits (`),nr=r("code"),li=s("tf.Tensor"),ci=s(" of shape "),ar=r("code"),di=s("(batch_size, config.num_labels)"),fi=s(`) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).
hidden_states (`),sr=r("code"),mi=s("tuple(tf.Tensor)"),hi=s(", "),ir=r("em"),pi=s("optional"),ui=s(", returned when "),lr=r("code"),gi=s("output_hidden_states=True"),_i=s(` is passed or when
`),cr=r("code"),yi=s("config.output_hidden_states=True"),bi=s(") \u2014 Tuple of "),dr=r("code"),vi=s("tf.Tensor"),wi=s(` (one for the output of the embeddings + one for the output of each layer) of shape
`),fr=r("code"),Fi=s("(batch_size, sequence_length, hidden_size)"),Ei=s(`. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.
attentions (`),mr=r("code"),Ti=s("tuple(tf.Tensor)"),Mi=s(", "),hr=r("em"),$i=s("optional"),Ci=s(", returned when "),pr=r("code"),Wi=s("output_attentions=True"),Ii=s(` is passed or when
`),ur=r("code"),ji=s("config.output_attentions=True"),Zi=s(") \u2014 Tuple of "),gr=r("code"),Ji=s("tf.Tensor"),Ui=s(" (one for each layer) of shape "),_r=r("code"),ki=s("(batch_size, num_heads, sequence_length, sequence_length)"),zi=s(`. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`),xi=p(),v(Pe.$$.fragment),this.h()},l(t){const g=gc('[data-svelte="svelte-1phssyn"]',document.head);c=n(g,"META",{name:!0,content:!0}),g.forEach(o),b=u(t),h=n(t,"H1",{class:!0});var Vt=a(h);m=n(Vt,"A",{id:!0,class:!0,href:!0});var yr=a(m);y=n(yr,"SPAN",{});var br=a(y);w(l.$$.fragment,br),br.forEach(o),yr.forEach(o),f=u(Vt),I=n(Vt,"SPAN",{});var vr=a(I);un=i(vr,"EfficientFormer"),vr.forEach(o),Vt.forEach(o),Wr=u(t),O=n(t,"H2",{class:!0});var Rt=a(O);ue=n(Rt,"A",{id:!0,class:!0,href:!0});var wr=a(ue);_o=n(wr,"SPAN",{});var Fr=a(_o);w(De.$$.fragment,Fr),Fr.forEach(o),wr.forEach(o),gn=u(Rt),yo=n(Rt,"SPAN",{});var Er=a(yo);_n=i(Er,"Overview"),Er.forEach(o),Rt.forEach(o),Ir=u(t),ge=n(t,"P",{});var Pt=a(ge);yn=i(Pt,"The EfficientFormer model was proposed in "),Qe=n(Pt,"A",{href:!0,rel:!0});var Tr=a(Qe);bn=i(Tr,"EfficientFormer: Vision Transformers at MobileNet Speed"),Tr.forEach(o),vn=i(Pt,`
by Yanyu Li, Geng Yuan, Yang Wen, Eric Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, Jian Ren.  EfficientFormer proposes a
dimension-consistent pure transformer that can be run on mobile devices for dense prediction tasks like image classification, object
detection and semantic segmentation.`),Pt.forEach(o),jr=u(t),Xt=n(t,"P",{});var Mr=a(Xt);wn=i(Mr,"The abstract from the paper is the following:"),Mr.forEach(o),Zr=u(t),qt=n(t,"P",{});var $r=a(qt);bo=n($r,"EM",{});var Cr=a(bo);Fn=i(Cr,`Vision Transformers (ViT) have shown rapid progress in computer vision tasks, achieving promising results on various benchmarks.
However, due to the massive number of parameters and model design, e.g., attention mechanism, ViT-based models are generally
times slower than lightweight convolutional networks. Therefore, the deployment of ViT for real-time applications is particularly
challenging, especially on resource-constrained hardware such as mobile devices. Recent efforts try to reduce the computation
complexity of ViT through network architecture search or hybrid design with MobileNet block, yet the inference speed is still
unsatisfactory. This leads to an important question: can transformers run as fast as MobileNet while obtaining high performance?
To answer this, we first revisit the network architecture and operators used in ViT-based models and identify inefficient designs.
Then we introduce a dimension-consistent pure transformer (without MobileNet blocks) as a design paradigm.
Finally, we perform latency-driven slimming to get a series of final models dubbed EfficientFormer.
Extensive experiments show the superiority of EfficientFormer in performance and speed on mobile devices.
Our fastest model, EfficientFormer-L1, achieves 79.2% top-1 accuracy on ImageNet-1K with only 1.6 ms inference latency on
iPhone 12 (compiled with CoreML), which { runs as fast as MobileNetV2\xD71.4 (1.6 ms, 74.7% top-1),} and our largest model,
EfficientFormer-L7, obtains 83.3% accuracy with only 7.0 ms latency. Our work proves that properly designed transformers can
reach extremely low latency on mobile devices while maintaining high performance.`),Cr.forEach(o),$r.forEach(o),Jr=u(t),U=n(t,"P",{});var V=a(U);En=i(V,"This model was contributed by "),Oe=n(V,"A",{href:!0,rel:!0});var Ni=a(Oe);Tn=i(Ni,"novice03"),Ni.forEach(o),Mn=i(V," and "),He=n(V,"A",{href:!0,rel:!0});var Vi=a(He);$n=i(Vi,"Bearnardd"),Vi.forEach(o),Cn=i(V,`.
The original code can be found `),Ke=n(V,"A",{href:!0,rel:!0});var Ri=a(Ke);Wn=i(Ri,"here"),Ri.forEach(o),In=i(V,". The TensorFlow version of this model was added by "),et=n(V,"A",{href:!0,rel:!0});var Pi=a(et);jn=i(Pi,"D-Roberts"),Pi.forEach(o),Zn=i(V,"."),V.forEach(o),Ur=u(t),H=n(t,"H2",{class:!0});var Hr=a(H);_e=n(Hr,"A",{id:!0,class:!0,href:!0});var Gi=a(_e);vo=n(Gi,"SPAN",{});var Bi=a(vo);w(tt.$$.fragment,Bi),Bi.forEach(o),Gi.forEach(o),Jn=u(Hr),wo=n(Hr,"SPAN",{});var Ai=a(wo);Un=i(Ai,"Documentation resources"),Ai.forEach(o),Hr.forEach(o),kr=u(t),Yt=n(t,"UL",{});var Si=a(Yt);Fo=n(Si,"LI",{});var Xi=a(Fo);Lt=n(Xi,"A",{href:!0});var qi=a(Lt);kn=i(qi,"Image classification task guide"),qi.forEach(o),Xi.forEach(o),Si.forEach(o),zr=u(t),K=n(t,"H2",{class:!0});var Kr=a(K);ye=n(Kr,"A",{id:!0,class:!0,href:!0});var Yi=a(ye);Eo=n(Yi,"SPAN",{});var Li=a(Eo);w(ot.$$.fragment,Li),Li.forEach(o),Yi.forEach(o),zn=u(Kr),To=n(Kr,"SPAN",{});var Di=a(To);xn=i(Di,"EfficientFormerConfig"),Di.forEach(o),Kr.forEach(o),xr=u(t),z=n(t,"DIV",{class:!0});var Ge=a(z);w(rt.$$.fragment,Ge),Nn=u(Ge),ee=n(Ge,"P",{});var ao=a(ee);Vn=i(ao,"This is the configuration class to store the configuration of an "),Dt=n(ao,"A",{href:!0});var Qi=a(Dt);Rn=i(Qi,"EfficientFormerModel"),Qi.forEach(o),Pn=i(ao,`. It is used to
instantiate an EfficientFormer 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 EfficientFormer
`),nt=n(ao,"A",{href:!0,rel:!0});var Oi=a(nt);Gn=i(Oi,"snap-research/efficientformer-l1"),Oi.forEach(o),Bn=i(ao," architecture."),ao.forEach(o),An=u(Ge),te=n(Ge,"P",{});var so=a(te);Sn=i(so,"Configuration objects inherit from "),Qt=n(so,"A",{href:!0});var Hi=a(Qt);Xn=i(Hi,"PretrainedConfig"),Hi.forEach(o),qn=i(so,` and can be used to control the model outputs. Read the
documentation from `),Ot=n(so,"A",{href:!0});var Ki=a(Ot);Yn=i(Ki,"PretrainedConfig"),Ki.forEach(o),Ln=i(so," for more information."),so.forEach(o),Dn=u(Ge),w(be.$$.fragment,Ge),Ge.forEach(o),Nr=u(t),oe=n(t,"H2",{class:!0});var en=a(oe);ve=n(en,"A",{id:!0,class:!0,href:!0});var el=a(ve);Mo=n(el,"SPAN",{});var tl=a(Mo);w(at.$$.fragment,tl),tl.forEach(o),el.forEach(o),Qn=u(en),$o=n(en,"SPAN",{});var ol=a($o);On=i(ol,"EfficientFormerImageProcessor"),ol.forEach(o),en.forEach(o),Vr=u(t),S=n(t,"DIV",{class:!0});var io=a(S);w(st.$$.fragment,io),Hn=u(io),Co=n(io,"P",{});var rl=a(Co);Kn=i(rl,"Constructs a EfficientFormer image processor."),rl.forEach(o),ea=u(io),we=n(io,"DIV",{class:!0});var tn=a(we);w(it.$$.fragment,tn),ta=u(tn),Wo=n(tn,"P",{});var nl=a(Wo);oa=i(nl,"Preprocess an image or batch of images."),nl.forEach(o),tn.forEach(o),io.forEach(o),Rr=u(t),re=n(t,"H2",{class:!0});var on=a(re);Fe=n(on,"A",{id:!0,class:!0,href:!0});var al=a(Fe);Io=n(al,"SPAN",{});var sl=a(Io);w(lt.$$.fragment,sl),sl.forEach(o),al.forEach(o),ra=u(on),jo=n(on,"SPAN",{});var il=a(jo);na=i(il,"EfficientFormerModel"),il.forEach(o),on.forEach(o),Pr=u(t),X=n(t,"DIV",{class:!0});var lo=a(X);w(ct.$$.fragment,lo),aa=u(lo),dt=n(lo,"P",{});var rn=a(dt);sa=i(rn,`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ft=n(rn,"A",{href:!0,rel:!0});var ll=a(ft);ia=i(ll,"nn.Module"),ll.forEach(o),la=i(rn,` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),rn.forEach(o),ca=u(lo),R=n(lo,"DIV",{class:!0});var Be=a(R);w(mt.$$.fragment,Be),da=u(Be),ne=n(Be,"P",{});var co=a(ne);fa=i(co,"The "),Ht=n(co,"A",{href:!0});var cl=a(Ht);ma=i(cl,"EfficientFormerModel"),cl.forEach(o),ha=i(co," forward method, overrides the "),Zo=n(co,"CODE",{});var dl=a(Zo);pa=i(dl,"__call__"),dl.forEach(o),ua=i(co," special method."),co.forEach(o),ga=u(Be),w(Ee.$$.fragment,Be),_a=u(Be),w(Te.$$.fragment,Be),Be.forEach(o),lo.forEach(o),Gr=u(t),ae=n(t,"H2",{class:!0});var nn=a(ae);Me=n(nn,"A",{id:!0,class:!0,href:!0});var fl=a(Me);Jo=n(fl,"SPAN",{});var ml=a(Jo);w(ht.$$.fragment,ml),ml.forEach(o),fl.forEach(o),ya=u(nn),Uo=n(nn,"SPAN",{});var hl=a(Uo);ba=i(hl,"EfficientFormerForImageClassification"),hl.forEach(o),nn.forEach(o),Br=u(t),x=n(t,"DIV",{class:!0});var Ae=a(x);w(pt.$$.fragment,Ae),va=u(Ae),ko=n(Ae,"P",{});var pl=a(ko);wa=i(pl,`EfficientFormer 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.`),pl.forEach(o),Fa=u(Ae),ut=n(Ae,"P",{});var an=a(ut);Ea=i(an,"This model is a PyTorch "),gt=n(an,"A",{href:!0,rel:!0});var ul=a(gt);Ta=i(ul,"nn.Module"),ul.forEach(o),Ma=i(an,` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),an.forEach(o),$a=u(Ae),P=n(Ae,"DIV",{class:!0});var Se=a(P);w(_t.$$.fragment,Se),Ca=u(Se),se=n(Se,"P",{});var fo=a(se);Wa=i(fo,"The "),Kt=n(fo,"A",{href:!0});var gl=a(Kt);Ia=i(gl,"EfficientFormerForImageClassification"),gl.forEach(o),ja=i(fo," forward method, overrides the "),zo=n(fo,"CODE",{});var _l=a(zo);Za=i(_l,"__call__"),_l.forEach(o),Ja=i(fo," special method."),fo.forEach(o),Ua=u(Se),w($e.$$.fragment,Se),ka=u(Se),w(Ce.$$.fragment,Se),Se.forEach(o),Ae.forEach(o),Ar=u(t),ie=n(t,"H2",{class:!0});var sn=a(ie);We=n(sn,"A",{id:!0,class:!0,href:!0});var yl=a(We);xo=n(yl,"SPAN",{});var bl=a(xo);w(yt.$$.fragment,bl),bl.forEach(o),yl.forEach(o),za=u(sn),No=n(sn,"SPAN",{});var vl=a(No);xa=i(vl,"EfficientFormerForImageClassificationWithTeacher"),vl.forEach(o),sn.forEach(o),Sr=u(t),j=n(t,"DIV",{class:!0});var L=a(j);w(bt.$$.fragment,L),Na=u(L),Vo=n(L,"P",{});var wl=a(Vo);Va=i(wl,`EfficientFormer Model transformer with image classification heads on top (a linear layer on top of the final hidden
state of the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for
ImageNet.`),wl.forEach(o),Ra=u(L),w(Ie.$$.fragment,L),Pa=u(L),vt=n(L,"P",{});var ln=a(vt);Ga=i(ln,"This model is a PyTorch "),wt=n(ln,"A",{href:!0,rel:!0});var Fl=a(wt);Ba=i(Fl,"nn.Module"),Fl.forEach(o),Aa=i(ln,` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),ln.forEach(o),Sa=u(L),G=n(L,"DIV",{class:!0});var Xe=a(G);w(Ft.$$.fragment,Xe),Xa=u(Xe),le=n(Xe,"P",{});var mo=a(le);qa=i(mo,"The "),eo=n(mo,"A",{href:!0});var El=a(eo);Ya=i(El,"EfficientFormerForImageClassificationWithTeacher"),El.forEach(o),La=i(mo," forward method, overrides the "),Ro=n(mo,"CODE",{});var Tl=a(Ro);Da=i(Tl,"__call__"),Tl.forEach(o),Qa=i(mo," special method."),mo.forEach(o),Oa=u(Xe),w(je.$$.fragment,Xe),Ha=u(Xe),w(Ze.$$.fragment,Xe),Xe.forEach(o),L.forEach(o),Xr=u(t),ce=n(t,"H2",{class:!0});var cn=a(ce);Je=n(cn,"A",{id:!0,class:!0,href:!0});var Ml=a(Je);Po=n(Ml,"SPAN",{});var $l=a(Po);w(Et.$$.fragment,$l),$l.forEach(o),Ml.forEach(o),Ka=u(cn),Go=n(cn,"SPAN",{});var Cl=a(Go);es=i(Cl,"TFEfficientFormerModel"),Cl.forEach(o),cn.forEach(o),qr=u(t),q=n(t,"DIV",{class:!0});var ho=a(q);w(Tt.$$.fragment,ho),ts=u(ho),Mt=n(ho,"P",{});var dn=a(Mt);os=i(dn,`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),$t=n(dn,"A",{href:!0,rel:!0});var Wl=a($t);rs=i(Wl,"tf.keras.layers.Layer"),Wl.forEach(o),ns=i(dn,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),dn.forEach(o),as=u(ho),B=n(ho,"DIV",{class:!0});var qe=a(B);w(Ct.$$.fragment,qe),ss=u(qe),de=n(qe,"P",{});var po=a(de);is=i(po,"The "),to=n(po,"A",{href:!0});var Il=a(to);ls=i(Il,"TFEfficientFormerModel"),Il.forEach(o),cs=i(po," forward method, overrides the "),Bo=n(po,"CODE",{});var jl=a(Bo);ds=i(jl,"__call__"),jl.forEach(o),fs=i(po," special method."),po.forEach(o),ms=u(qe),w(Ue.$$.fragment,qe),hs=u(qe),w(ke.$$.fragment,qe),qe.forEach(o),ho.forEach(o),Yr=u(t),fe=n(t,"H2",{class:!0});var fn=a(fe);ze=n(fn,"A",{id:!0,class:!0,href:!0});var Zl=a(ze);Ao=n(Zl,"SPAN",{});var Jl=a(Ao);w(Wt.$$.fragment,Jl),Jl.forEach(o),Zl.forEach(o),ps=u(fn),So=n(fn,"SPAN",{});var Ul=a(So);us=i(Ul,"TFEfficientFormerForImageClassification"),Ul.forEach(o),fn.forEach(o),Lr=u(t),N=n(t,"DIV",{class:!0});var Ye=a(N);w(It.$$.fragment,Ye),gs=u(Ye),Xo=n(Ye,"P",{});var kl=a(Xo);_s=i(kl,`EfficientFormer Model transformer with an image classification head on top of pooled last hidden state, e.g. for
ImageNet.`),kl.forEach(o),ys=u(Ye),jt=n(Ye,"P",{});var mn=a(jt);bs=i(mn,`This model is a TensorFlow
`),Zt=n(mn,"A",{href:!0,rel:!0});var zl=a(Zt);vs=i(zl,"tf.keras.layers.Layer"),zl.forEach(o),ws=i(mn,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),mn.forEach(o),Fs=u(Ye),A=n(Ye,"DIV",{class:!0});var Le=a(A);w(Jt.$$.fragment,Le),Es=u(Le),me=n(Le,"P",{});var uo=a(me);Ts=i(uo,"The "),oo=n(uo,"A",{href:!0});var xl=a(oo);Ms=i(xl,"TFEfficientFormerForImageClassification"),xl.forEach(o),$s=i(uo," forward method, overrides the "),qo=n(uo,"CODE",{});var Nl=a(qo);Cs=i(Nl,"__call__"),Nl.forEach(o),Ws=i(uo," special method."),uo.forEach(o),Is=u(Le),w(xe.$$.fragment,Le),js=u(Le),w(Ne.$$.fragment,Le),Le.forEach(o),Ye.forEach(o),Dr=u(t),he=n(t,"H2",{class:!0});var hn=a(he);Ve=n(hn,"A",{id:!0,class:!0,href:!0});var Vl=a(Ve);Yo=n(Vl,"SPAN",{});var Rl=a(Yo);w(Ut.$$.fragment,Rl),Rl.forEach(o),Vl.forEach(o),Zs=u(hn),Lo=n(hn,"SPAN",{});var Pl=a(Lo);Js=i(Pl,"TFEfficientFormerForImageClassificationWithTeacher"),Pl.forEach(o),hn.forEach(o),Qr=u(t),Z=n(t,"DIV",{class:!0});var D=a(Z);w(kt.$$.fragment,D),Us=u(D),Do=n(D,"P",{});var Gl=a(Do);ks=i(Gl,`EfficientFormer Model transformer with image classification heads on top (a linear layer on top of the final hidden
state and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`),Gl.forEach(o),zs=u(D),Qo=n(D,"P",{});var Bl=a(Qo);xs=i(Bl,`.. warning::
This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Bl.forEach(o),Ns=u(D),zt=n(D,"P",{});var pn=a(zt);Vs=i(pn,`This model is a TensorFlow
`),xt=n(pn,"A",{href:!0,rel:!0});var Al=a(xt);Rs=i(Al,"tf.keras.layers.Layer"),Al.forEach(o),Ps=i(pn,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),pn.forEach(o),Gs=u(D),k=n(D,"DIV",{class:!0});var Q=a(k);w(Nt.$$.fragment,Q),Bs=u(Q),pe=n(Q,"P",{});var go=a(pe);As=i(go,"The "),ro=n(go,"A",{href:!0});var Sl=a(ro);Ss=i(Sl,"TFEfficientFormerForImageClassificationWithTeacher"),Sl.forEach(o),Xs=i(go," forward method, overrides the "),Oo=n(go,"CODE",{});var Xl=a(Oo);qs=i(Xl,"__call__"),Xl.forEach(o),Ys=i(go," special method."),go.forEach(o),Ls=u(Q),w(Re.$$.fragment,Q),Ds=u(Q),Ho=n(Q,"UL",{});var ql=a(Ho);$=n(ql,"LI",{});var C=a($);Ko=n(C,"STRONG",{});var Yl=a(Ko);Qs=i(Yl,"Output"),Yl.forEach(o),Os=i(C," type of "),no=n(C,"A",{href:!0});var Ll=a(no);Hs=i(Ll,"EfficientFormerForImageClassificationWithTeacher"),Ll.forEach(o),Ks=i(C,`.
logits (`),er=n(C,"CODE",{});var Dl=a(er);ei=i(Dl,"tf.Tensor"),Dl.forEach(o),ti=i(C," of shape "),tr=n(C,"CODE",{});var Ql=a(tr);oi=i(Ql,"(batch_size, config.num_labels)"),Ql.forEach(o),ri=i(C,`) \u2014 Prediction scores as the average of the cls_logits and distillation logits.
cls_logits (`),or=n(C,"CODE",{});var Ol=a(or);ni=i(Ol,"tf.Tensor"),Ol.forEach(o),ai=i(C," of shape "),rr=n(C,"CODE",{});var Hl=a(rr);si=i(Hl,"(batch_size, config.num_labels)"),Hl.forEach(o),ii=i(C,`) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).
distillation_logits (`),nr=n(C,"CODE",{});var Kl=a(nr);li=i(Kl,"tf.Tensor"),Kl.forEach(o),ci=i(C," of shape "),ar=n(C,"CODE",{});var ec=a(ar);di=i(ec,"(batch_size, config.num_labels)"),ec.forEach(o),fi=i(C,`) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).
hidden_states (`),sr=n(C,"CODE",{});var tc=a(sr);mi=i(tc,"tuple(tf.Tensor)"),tc.forEach(o),hi=i(C,", "),ir=n(C,"EM",{});var oc=a(ir);pi=i(oc,"optional"),oc.forEach(o),ui=i(C,", returned when "),lr=n(C,"CODE",{});var rc=a(lr);gi=i(rc,"output_hidden_states=True"),rc.forEach(o),_i=i(C,` is passed or when
`),cr=n(C,"CODE",{});var nc=a(cr);yi=i(nc,"config.output_hidden_states=True"),nc.forEach(o),bi=i(C,") \u2014 Tuple of "),dr=n(C,"CODE",{});var ac=a(dr);vi=i(ac,"tf.Tensor"),ac.forEach(o),wi=i(C,` (one for the output of the embeddings + one for the output of each layer) of shape
`),fr=n(C,"CODE",{});var sc=a(fr);Fi=i(sc,"(batch_size, sequence_length, hidden_size)"),sc.forEach(o),Ei=i(C,`. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.
attentions (`),mr=n(C,"CODE",{});var ic=a(mr);Ti=i(ic,"tuple(tf.Tensor)"),ic.forEach(o),Mi=i(C,", "),hr=n(C,"EM",{});var lc=a(hr);$i=i(lc,"optional"),lc.forEach(o),Ci=i(C,", returned when "),pr=n(C,"CODE",{});var cc=a(pr);Wi=i(cc,"output_attentions=True"),cc.forEach(o),Ii=i(C,` is passed or when
`),ur=n(C,"CODE",{});var dc=a(ur);ji=i(dc,"config.output_attentions=True"),dc.forEach(o),Zi=i(C,") \u2014 Tuple of "),gr=n(C,"CODE",{});var fc=a(gr);Ji=i(fc,"tf.Tensor"),fc.forEach(o),Ui=i(C," (one for each layer) of shape "),_r=n(C,"CODE",{});var mc=a(_r);ki=i(mc,"(batch_size, num_heads, sequence_length, sequence_length)"),mc.forEach(o),zi=i(C,`. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`),C.forEach(o),ql.forEach(o),xi=u(Q),w(Pe.$$.fragment,Q),Q.forEach(o),D.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Uc)),d(m,"id","efficientformer"),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","#efficientformer"),d(h,"class","relative group"),d(ue,"id","overview"),d(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ue,"href","#overview"),d(O,"class","relative group"),d(Qe,"href","https://arxiv.org/abs/2206.01191"),d(Qe,"rel","nofollow"),d(Oe,"href","https://huggingface.co/novice03"),d(Oe,"rel","nofollow"),d(He,"href","https://huggingface.co/Bearnardd"),d(He,"rel","nofollow"),d(Ke,"href","https://github.com/snap-research/EfficientFormer"),d(Ke,"rel","nofollow"),d(et,"href","https://huggingface.co/D-Roberts"),d(et,"rel","nofollow"),d(_e,"id","documentation-resources"),d(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(_e,"href","#documentation-resources"),d(H,"class","relative group"),d(Lt,"href","../tasks/image_classification"),d(ye,"id","transformers.EfficientFormerConfig"),d(ye,"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(ye,"href","#transformers.EfficientFormerConfig"),d(K,"class","relative group"),d(Dt,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerModel"),d(nt,"href","https://huggingface.co/snap-research/efficientformer-l1"),d(nt,"rel","nofollow"),d(Qt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ot,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(ve,"id","transformers.EfficientFormerImageProcessor"),d(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ve,"href","#transformers.EfficientFormerImageProcessor"),d(oe,"class","relative group"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fe,"id","transformers.EfficientFormerModel"),d(Fe,"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(Fe,"href","#transformers.EfficientFormerModel"),d(re,"class","relative group"),d(ft,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),d(ft,"rel","nofollow"),d(Ht,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerModel"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Me,"id","transformers.EfficientFormerForImageClassification"),d(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Me,"href","#transformers.EfficientFormerForImageClassification"),d(ae,"class","relative group"),d(gt,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),d(gt,"rel","nofollow"),d(Kt,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerForImageClassification"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(We,"id","transformers.EfficientFormerForImageClassificationWithTeacher"),d(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(We,"href","#transformers.EfficientFormerForImageClassificationWithTeacher"),d(ie,"class","relative group"),d(wt,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),d(wt,"rel","nofollow"),d(eo,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerForImageClassificationWithTeacher"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"id","transformers.TFEfficientFormerModel"),d(Je,"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(Je,"href","#transformers.TFEfficientFormerModel"),d(ce,"class","relative group"),d($t,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d($t,"rel","nofollow"),d(to,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.TFEfficientFormerModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ze,"id","transformers.TFEfficientFormerForImageClassification"),d(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ze,"href","#transformers.TFEfficientFormerForImageClassification"),d(fe,"class","relative group"),d(Zt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(Zt,"rel","nofollow"),d(oo,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.TFEfficientFormerForImageClassification"),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"),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(Ve,"id","transformers.TFEfficientFormerForImageClassificationWithTeacher"),d(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ve,"href","#transformers.TFEfficientFormerForImageClassificationWithTeacher"),d(he,"class","relative group"),d(xt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(xt,"rel","nofollow"),d(ro,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.TFEfficientFormerForImageClassificationWithTeacher"),d(no,"href","/docs/transformers/v4.30.0/en/model_doc/efficientformer#transformers.EfficientFormerForImageClassificationWithTeacher"),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")},m(t,g){e(document.head,c),_(t,b,g),_(t,h,g),e(h,m),e(m,y),F(l,y,null),e(h,f),e(h,I),e(I,un),_(t,Wr,g),_(t,O,g),e(O,ue),e(ue,_o),F(De,_o,null),e(O,gn),e(O,yo),e(yo,_n),_(t,Ir,g),_(t,ge,g),e(ge,yn),e(ge,Qe),e(Qe,bn),e(ge,vn),_(t,jr,g),_(t,Xt,g),e(Xt,wn),_(t,Zr,g),_(t,qt,g),e(qt,bo),e(bo,Fn),_(t,Jr,g),_(t,U,g),e(U,En),e(U,Oe),e(Oe,Tn),e(U,Mn),e(U,He),e(He,$n),e(U,Cn),e(U,Ke),e(Ke,Wn),e(U,In),e(U,et),e(et,jn),e(U,Zn),_(t,Ur,g),_(t,H,g),e(H,_e),e(_e,vo),F(tt,vo,null),e(H,Jn),e(H,wo),e(wo,Un),_(t,kr,g),_(t,Yt,g),e(Yt,Fo),e(Fo,Lt),e(Lt,kn),_(t,zr,g),_(t,K,g),e(K,ye),e(ye,Eo),F(ot,Eo,null),e(K,zn),e(K,To),e(To,xn),_(t,xr,g),_(t,z,g),F(rt,z,null),e(z,Nn),e(z,ee),e(ee,Vn),e(ee,Dt),e(Dt,Rn),e(ee,Pn),e(ee,nt),e(nt,Gn),e(ee,Bn),e(z,An),e(z,te),e(te,Sn),e(te,Qt),e(Qt,Xn),e(te,qn),e(te,Ot),e(Ot,Yn),e(te,Ln),e(z,Dn),F(be,z,null),_(t,Nr,g),_(t,oe,g),e(oe,ve),e(ve,Mo),F(at,Mo,null),e(oe,Qn),e(oe,$o),e($o,On),_(t,Vr,g),_(t,S,g),F(st,S,null),e(S,Hn),e(S,Co),e(Co,Kn),e(S,ea),e(S,we),F(it,we,null),e(we,ta),e(we,Wo),e(Wo,oa),_(t,Rr,g),_(t,re,g),e(re,Fe),e(Fe,Io),F(lt,Io,null),e(re,ra),e(re,jo),e(jo,na),_(t,Pr,g),_(t,X,g),F(ct,X,null),e(X,aa),e(X,dt),e(dt,sa),e(dt,ft),e(ft,ia),e(dt,la),e(X,ca),e(X,R),F(mt,R,null),e(R,da),e(R,ne),e(ne,fa),e(ne,Ht),e(Ht,ma),e(ne,ha),e(ne,Zo),e(Zo,pa),e(ne,ua),e(R,ga),F(Ee,R,null),e(R,_a),F(Te,R,null),_(t,Gr,g),_(t,ae,g),e(ae,Me),e(Me,Jo),F(ht,Jo,null),e(ae,ya),e(ae,Uo),e(Uo,ba),_(t,Br,g),_(t,x,g),F(pt,x,null),e(x,va),e(x,ko),e(ko,wa),e(x,Fa),e(x,ut),e(ut,Ea),e(ut,gt),e(gt,Ta),e(ut,Ma),e(x,$a),e(x,P),F(_t,P,null),e(P,Ca),e(P,se),e(se,Wa),e(se,Kt),e(Kt,Ia),e(se,ja),e(se,zo),e(zo,Za),e(se,Ja),e(P,Ua),F($e,P,null),e(P,ka),F(Ce,P,null),_(t,Ar,g),_(t,ie,g),e(ie,We),e(We,xo),F(yt,xo,null),e(ie,za),e(ie,No),e(No,xa),_(t,Sr,g),_(t,j,g),F(bt,j,null),e(j,Na),e(j,Vo),e(Vo,Va),e(j,Ra),F(Ie,j,null),e(j,Pa),e(j,vt),e(vt,Ga),e(vt,wt),e(wt,Ba),e(vt,Aa),e(j,Sa),e(j,G),F(Ft,G,null),e(G,Xa),e(G,le),e(le,qa),e(le,eo),e(eo,Ya),e(le,La),e(le,Ro),e(Ro,Da),e(le,Qa),e(G,Oa),F(je,G,null),e(G,Ha),F(Ze,G,null),_(t,Xr,g),_(t,ce,g),e(ce,Je),e(Je,Po),F(Et,Po,null),e(ce,Ka),e(ce,Go),e(Go,es),_(t,qr,g),_(t,q,g),F(Tt,q,null),e(q,ts),e(q,Mt),e(Mt,os),e(Mt,$t),e($t,rs),e(Mt,ns),e(q,as),e(q,B),F(Ct,B,null),e(B,ss),e(B,de),e(de,is),e(de,to),e(to,ls),e(de,cs),e(de,Bo),e(Bo,ds),e(de,fs),e(B,ms),F(Ue,B,null),e(B,hs),F(ke,B,null),_(t,Yr,g),_(t,fe,g),e(fe,ze),e(ze,Ao),F(Wt,Ao,null),e(fe,ps),e(fe,So),e(So,us),_(t,Lr,g),_(t,N,g),F(It,N,null),e(N,gs),e(N,Xo),e(Xo,_s),e(N,ys),e(N,jt),e(jt,bs),e(jt,Zt),e(Zt,vs),e(jt,ws),e(N,Fs),e(N,A),F(Jt,A,null),e(A,Es),e(A,me),e(me,Ts),e(me,oo),e(oo,Ms),e(me,$s),e(me,qo),e(qo,Cs),e(me,Ws),e(A,Is),F(xe,A,null),e(A,js),F(Ne,A,null),_(t,Dr,g),_(t,he,g),e(he,Ve),e(Ve,Yo),F(Ut,Yo,null),e(he,Zs),e(he,Lo),e(Lo,Js),_(t,Qr,g),_(t,Z,g),F(kt,Z,null),e(Z,Us),e(Z,Do),e(Do,ks),e(Z,zs),e(Z,Qo),e(Qo,xs),e(Z,Ns),e(Z,zt),e(zt,Vs),e(zt,xt),e(xt,Rs),e(zt,Ps),e(Z,Gs),e(Z,k),F(Nt,k,null),e(k,Bs),e(k,pe),e(pe,As),e(pe,ro),e(ro,Ss),e(pe,Xs),e(pe,Oo),e(Oo,qs),e(pe,Ys),e(k,Ls),F(Re,k,null),e(k,Ds),e(k,Ho),e(Ho,$),e($,Ko),e(Ko,Qs),e($,Os),e($,no),e(no,Hs),e($,Ks),e($,er),e(er,ei),e($,ti),e($,tr),e(tr,oi),e($,ri),e($,or),e(or,ni),e($,ai),e($,rr),e(rr,si),e($,ii),e($,nr),e(nr,li),e($,ci),e($,ar),e(ar,di),e($,fi),e($,sr),e(sr,mi),e($,hi),e($,ir),e(ir,pi),e($,ui),e($,lr),e(lr,gi),e($,_i),e($,cr),e(cr,yi),e($,bi),e($,dr),e(dr,vi),e($,wi),e($,fr),e(fr,Fi),e($,Ei),e($,mr),e(mr,Ti),e($,Mi),e($,hr),e(hr,$i),e($,Ci),e($,pr),e(pr,Wi),e($,Ii),e($,ur),e(ur,ji),e($,Zi),e($,gr),e(gr,Ji),e($,Ui),e($,_r),e(_r,ki),e($,zi),e(k,xi),F(Pe,k,null),Or=!0},p(t,[g]){const Vt={};g&2&&(Vt.$$scope={dirty:g,ctx:t}),be.$set(Vt);const yr={};g&2&&(yr.$$scope={dirty:g,ctx:t}),Ee.$set(yr);const br={};g&2&&(br.$$scope={dirty:g,ctx:t}),Te.$set(br);const vr={};g&2&&(vr.$$scope={dirty:g,ctx:t}),$e.$set(vr);const Rt={};g&2&&(Rt.$$scope={dirty:g,ctx:t}),Ce.$set(Rt);const wr={};g&2&&(wr.$$scope={dirty:g,ctx:t}),Ie.$set(wr);const Fr={};g&2&&(Fr.$$scope={dirty:g,ctx:t}),je.$set(Fr);const Er={};g&2&&(Er.$$scope={dirty:g,ctx:t}),Ze.$set(Er);const Pt={};g&2&&(Pt.$$scope={dirty:g,ctx:t}),Ue.$set(Pt);const Tr={};g&2&&(Tr.$$scope={dirty:g,ctx:t}),ke.$set(Tr);const Mr={};g&2&&(Mr.$$scope={dirty:g,ctx:t}),xe.$set(Mr);const $r={};g&2&&($r.$$scope={dirty:g,ctx:t}),Ne.$set($r);const Cr={};g&2&&(Cr.$$scope={dirty:g,ctx:t}),Re.$set(Cr);const V={};g&2&&(V.$$scope={dirty:g,ctx:t}),Pe.$set(V)},i(t){Or||(E(l.$$.fragment,t),E(De.$$.fragment,t),E(tt.$$.fragment,t),E(ot.$$.fragment,t),E(rt.$$.fragment,t),E(be.$$.fragment,t),E(at.$$.fragment,t),E(st.$$.fragment,t),E(it.$$.fragment,t),E(lt.$$.fragment,t),E(ct.$$.fragment,t),E(mt.$$.fragment,t),E(Ee.$$.fragment,t),E(Te.$$.fragment,t),E(ht.$$.fragment,t),E(pt.$$.fragment,t),E(_t.$$.fragment,t),E($e.$$.fragment,t),E(Ce.$$.fragment,t),E(yt.$$.fragment,t),E(bt.$$.fragment,t),E(Ie.$$.fragment,t),E(Ft.$$.fragment,t),E(je.$$.fragment,t),E(Ze.$$.fragment,t),E(Et.$$.fragment,t),E(Tt.$$.fragment,t),E(Ct.$$.fragment,t),E(Ue.$$.fragment,t),E(ke.$$.fragment,t),E(Wt.$$.fragment,t),E(It.$$.fragment,t),E(Jt.$$.fragment,t),E(xe.$$.fragment,t),E(Ne.$$.fragment,t),E(Ut.$$.fragment,t),E(kt.$$.fragment,t),E(Nt.$$.fragment,t),E(Re.$$.fragment,t),E(Pe.$$.fragment,t),Or=!0)},o(t){T(l.$$.fragment,t),T(De.$$.fragment,t),T(tt.$$.fragment,t),T(ot.$$.fragment,t),T(rt.$$.fragment,t),T(be.$$.fragment,t),T(at.$$.fragment,t),T(st.$$.fragment,t),T(it.$$.fragment,t),T(lt.$$.fragment,t),T(ct.$$.fragment,t),T(mt.$$.fragment,t),T(Ee.$$.fragment,t),T(Te.$$.fragment,t),T(ht.$$.fragment,t),T(pt.$$.fragment,t),T(_t.$$.fragment,t),T($e.$$.fragment,t),T(Ce.$$.fragment,t),T(yt.$$.fragment,t),T(bt.$$.fragment,t),T(Ie.$$.fragment,t),T(Ft.$$.fragment,t),T(je.$$.fragment,t),T(Ze.$$.fragment,t),T(Et.$$.fragment,t),T(Tt.$$.fragment,t),T(Ct.$$.fragment,t),T(Ue.$$.fragment,t),T(ke.$$.fragment,t),T(Wt.$$.fragment,t),T(It.$$.fragment,t),T(Jt.$$.fragment,t),T(xe.$$.fragment,t),T(Ne.$$.fragment,t),T(Ut.$$.fragment,t),T(kt.$$.fragment,t),T(Nt.$$.fragment,t),T(Re.$$.fragment,t),T(Pe.$$.fragment,t),Or=!1},d(t){o(c),t&&o(b),t&&o(h),M(l),t&&o(Wr),t&&o(O),M(De),t&&o(Ir),t&&o(ge),t&&o(jr),t&&o(Xt),t&&o(Zr),t&&o(qt),t&&o(Jr),t&&o(U),t&&o(Ur),t&&o(H),M(tt),t&&o(kr),t&&o(Yt),t&&o(zr),t&&o(K),M(ot),t&&o(xr),t&&o(z),M(rt),M(be),t&&o(Nr),t&&o(oe),M(at),t&&o(Vr),t&&o(S),M(st),M(it),t&&o(Rr),t&&o(re),M(lt),t&&o(Pr),t&&o(X),M(ct),M(mt),M(Ee),M(Te),t&&o(Gr),t&&o(ae),M(ht),t&&o(Br),t&&o(x),M(pt),M(_t),M($e),M(Ce),t&&o(Ar),t&&o(ie),M(yt),t&&o(Sr),t&&o(j),M(bt),M(Ie),M(Ft),M(je),M(Ze),t&&o(Xr),t&&o(ce),M(Et),t&&o(qr),t&&o(q),M(Tt),M(Ct),M(Ue),M(ke),t&&o(Yr),t&&o(fe),M(Wt),t&&o(Lr),t&&o(N),M(It),M(Jt),M(xe),M(Ne),t&&o(Dr),t&&o(he),M(Ut),t&&o(Qr),t&&o(Z),M(kt),M(Nt),M(Re),M(Pe)}}}const Uc={local:"efficientformer",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.EfficientFormerConfig",title:"EfficientFormerConfig"},{local:"transformers.EfficientFormerImageProcessor",title:"EfficientFormerImageProcessor"},{local:"transformers.EfficientFormerModel",title:"EfficientFormerModel"},{local:"transformers.EfficientFormerForImageClassification",title:"EfficientFormerForImageClassification"},{local:"transformers.EfficientFormerForImageClassificationWithTeacher",title:"EfficientFormerForImageClassificationWithTeacher"},{local:"transformers.TFEfficientFormerModel",title:"TFEfficientFormerModel"},{local:"transformers.TFEfficientFormerForImageClassification",title:"TFEfficientFormerForImageClassification"},{local:"transformers.TFEfficientFormerForImageClassificationWithTeacher",title:"TFEfficientFormerForImageClassificationWithTeacher"}],title:"EfficientFormer"};function kc(W){return _c(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gc extends hc{constructor(c){super();pc(this,c,kc,Jc,uc,{})}}export{Gc as default,Uc as metadata};
