import{S as hc,i as pc,s as gc,e as r,k as p,w as v,t as a,M as uc,c as n,d as o,m as g,a as s,x as w,h as i,b as d,G as e,g as _,y as F,q as T,o as E,B as M,v as _c,L as St}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 At}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(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function bc(I){let c,b,h,m,y;return{c(){c=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=a("Module"),y=a(`
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=s(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 W=s(h);m=i(W,"Module"),W.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(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function wc(I){let c,b,h,m,y;return{c(){c=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=a("Module"),y=a(`
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=s(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 W=s(h);m=i(W,"Module"),W.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(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function Tc(I){let c,b;return{c(){c=r("p"),b=a(`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=s(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 Ec(I){let c,b,h,m,y;return{c(){c=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=a("Module"),y=a(`
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=s(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 W=s(h);m=i(W,"Module"),W.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(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function $c(I){let c,b,h,m,y;return{c(){c=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=a("Module"),y=a(`
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=s(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 W=s(h);m=i(W,"Module"),W.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(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function Ic(I){let c,b,h,m,y;return{c(){c=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=a("Module"),y=a(`
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=s(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 W=s(h);m=i(W,"Module"),W.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 Wc(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function jc(I){let c,b,h,m,y;return{c(){c=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),m=a("Module"),y=a(`
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=s(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 W=s(h);m=i(W,"Module"),W.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(I){let c,b,h,m,y;return m=new At({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=a("Example:"),h=p(),v(m.$$.fragment)},l(l){c=n(l,"P",{});var f=s(c);b=i(f,"Example:"),f.forEach(o),h=g(l),w(m.$$.fragment,l)},m(l,f){_(l,c,f),e(c,b),_(l,h,f),F(m,l,f),y=!0},p:St,i(l){y||(T(m.$$.fragment,l),y=!0)},o(l){E(m.$$.fragment,l),y=!1},d(l){l&&o(c),l&&o(h),M(m,l)}}}function Jc(I){let c,b,h,m,y,l,f,W,gn,Ir,O,ge,_o,Le,un,yo,_n,Wr,ue,yn,Qe,bn,vn,jr,qt,wn,Zr,Xt,bo,Fn,Jr,U,Tn,Oe,En,Mn,He,$n,Cn,Ke,In,Wn,et,jn,Zn,Ur,H,_e,vo,tt,Jn,wo,Un,kr,Yt,Fo,Dt,kn,zr,K,ye,To,ot,zn,Eo,Nn,Nr,z,rt,xn,ee,Vn,Lt,Rn,Pn,nt,Gn,Bn,Sn,te,An,Qt,qn,Xn,Ot,Yn,Dn,Ln,be,xr,oe,ve,Mo,st,Qn,$o,On,Vr,A,at,Hn,Co,Kn,es,we,it,ts,Io,os,Rr,re,Fe,Wo,lt,rs,jo,ns,Pr,q,ct,ss,dt,as,ft,is,ls,cs,R,mt,ds,ne,fs,Ht,ms,hs,Zo,ps,gs,us,Te,_s,Ee,Gr,se,Me,Jo,ht,ys,Uo,bs,Br,N,pt,vs,ko,ws,Fs,gt,Ts,ut,Es,Ms,$s,P,_t,Cs,ae,Is,Kt,Ws,js,zo,Zs,Js,Us,$e,ks,Ce,Sr,ie,Ie,No,yt,zs,xo,Ns,Ar,j,bt,xs,Vo,Vs,Rs,We,Ps,vt,Gs,wt,Bs,Ss,As,G,Ft,qs,le,Xs,eo,Ys,Ds,Ro,Ls,Qs,Os,je,Hs,Ze,qr,ce,Je,Po,Tt,Ks,Go,ea,Xr,X,Et,ta,Mt,oa,$t,ra,na,sa,B,Ct,aa,de,ia,to,la,ca,Bo,da,fa,ma,Ue,ha,ke,Yr,fe,ze,So,It,pa,Ao,ga,Dr,x,Wt,ua,qo,_a,ya,jt,ba,Zt,va,wa,Fa,S,Jt,Ta,me,Ea,oo,Ma,$a,Xo,Ca,Ia,Wa,Ne,ja,xe,Lr,he,Ve,Yo,Ut,Za,Do,Ja,Qr,Z,kt,Ua,Lo,ka,za,Qo,Na,xa,zt,Va,Nt,Ra,Pa,Ga,k,xt,Ba,pe,Sa,ro,Aa,qa,Oo,Xa,Ya,Da,Re,La,Ho,$,Ko,Qa,Oa,no,Ha,Ka,er,ei,ti,tr,oi,ri,or,ni,si,rr,ai,ii,nr,li,ci,sr,di,fi,ar,mi,hi,ir,pi,gi,lr,ui,_i,cr,yi,bi,dr,vi,wi,fr,Fi,Ti,mr,Ei,Mi,hr,$i,Ci,pr,Ii,Wi,gr,ji,Zi,ur,Ji,Ui,_r,ki,zi,Ni,Pe,Or;return l=new Y({}),Le=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.33.0/src/transformers/models/efficientformer/configuration_efficientformer.py#L32"}}),be=new Bt({props:{anchor:"transformers.EfficientFormerConfig.example",$$slots:{default:[yc]},$$scope:{ctx:I}}}),st=new Y({}),at=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.33.0/src/transformers/models/efficientformer/image_processing_efficientformer.py#L45"}}),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:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,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"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input 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><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/efficientformer/image_processing_efficientformer.py#L160"}}),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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/vit#transformers.ViTImageProcessor.preprocess">ViTImageProcessor.preprocess()</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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L569",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new Gt({props:{$$slots:{default:[bc]},$$scope:{ctx:I}}}),Ee=new Bt({props:{anchor:"transformers.EfficientFormerModel.forward.example",$$slots:{default:[vc]},$$scope:{ctx:I}}}),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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/vit#transformers.ViTImageProcessor.preprocess">ViTImageProcessor.preprocess()</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.33.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.33.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L634",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:I}}}),Ce=new Bt({props:{anchor:"transformers.EfficientFormerForImageClassification.forward.example",$$slots:{default:[Fc]},$$scope:{ctx:I}}}),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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/efficientformer/modeling_efficientformer.py#L749"}}),We=new Gt({props:{warning:!0,$$slots:{default:[Tc]},$$scope:{ctx:I}}}),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.33.0/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/vit#transformers.ViTImageProcessor.preprocess">ViTImageProcessor.preprocess()</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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.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:[Ec]},$$scope:{ctx:I}}}),Ze=new Bt({props:{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward.example",$$slots:{default:[Mc]},$$scope:{ctx:I}}}),Tt=new Y({}),Et=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L781",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:I}}}),ke=new Bt({props:{anchor:"transformers.TFEfficientFormerModel.call.example",$$slots:{default:[Cc]},$$scope:{ctx:I}}}),It=new Y({}),Wt=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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">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.33.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.33.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.33.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>
`}}),Ne=new Gt({props:{$$slots:{default:[Ic]},$$scope:{ctx:I}}}),xe=new Bt({props:{anchor:"transformers.TFEfficientFormerForImageClassification.call.example",$$slots:{default:[Wc]},$$scope:{ctx:I}}}),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.33.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.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/efficientformer/modeling_tf_efficientformer.py#L920"}}),xt=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.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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.33.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:I}}}),Pe=new Bt({props:{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.example",$$slots:{default:[Zc]},$$scope:{ctx:I}}}),{c(){c=r("meta"),b=p(),h=r("h1"),m=r("a"),y=r("span"),v(l.$$.fragment),f=p(),W=r("span"),gn=a("EfficientFormer"),Ir=p(),O=r("h2"),ge=r("a"),_o=r("span"),v(Le.$$.fragment),un=p(),yo=r("span"),_n=a("Overview"),Wr=p(),ue=r("p"),yn=a("The EfficientFormer model was proposed in "),Qe=r("a"),bn=a("EfficientFormer: Vision Transformers at MobileNet Speed"),vn=a(`
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(),qt=r("p"),wn=a("The abstract from the paper is the following:"),Zr=p(),Xt=r("p"),bo=r("em"),Fn=a(`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"),Tn=a("This model was contributed by "),Oe=r("a"),En=a("novice03"),Mn=a(" and "),He=r("a"),$n=a("Bearnardd"),Cn=a(`.
The original code can be found `),Ke=r("a"),In=a("here"),Wn=a(". The TensorFlow version of this model was added by "),et=r("a"),jn=a("D-Roberts"),Zn=a("."),Ur=p(),H=r("h2"),_e=r("a"),vo=r("span"),v(tt.$$.fragment),Jn=p(),wo=r("span"),Un=a("Documentation resources"),kr=p(),Yt=r("ul"),Fo=r("li"),Dt=r("a"),kn=a("Image classification task guide"),zr=p(),K=r("h2"),ye=r("a"),To=r("span"),v(ot.$$.fragment),zn=p(),Eo=r("span"),Nn=a("EfficientFormerConfig"),Nr=p(),z=r("div"),v(rt.$$.fragment),xn=p(),ee=r("p"),Vn=a("This is the configuration class to store the configuration of an "),Lt=r("a"),Rn=a("EfficientFormerModel"),Pn=a(`. 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=a("snap-research/efficientformer-l1"),Bn=a(" architecture."),Sn=p(),te=r("p"),An=a("Configuration objects inherit from "),Qt=r("a"),qn=a("PretrainedConfig"),Xn=a(` and can be used to control the model outputs. Read the
documentation from `),Ot=r("a"),Yn=a("PretrainedConfig"),Dn=a(" for more information."),Ln=p(),v(be.$$.fragment),xr=p(),oe=r("h2"),ve=r("a"),Mo=r("span"),v(st.$$.fragment),Qn=p(),$o=r("span"),On=a("EfficientFormerImageProcessor"),Vr=p(),A=r("div"),v(at.$$.fragment),Hn=p(),Co=r("p"),Kn=a("Constructs a EfficientFormer image processor."),es=p(),we=r("div"),v(it.$$.fragment),ts=p(),Io=r("p"),os=a("Preprocess an image or batch of images."),Rr=p(),re=r("h2"),Fe=r("a"),Wo=r("span"),v(lt.$$.fragment),rs=p(),jo=r("span"),ns=a("EfficientFormerModel"),Pr=p(),q=r("div"),v(ct.$$.fragment),ss=p(),dt=r("p"),as=a(`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ft=r("a"),is=a("nn.Module"),ls=a(` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),cs=p(),R=r("div"),v(mt.$$.fragment),ds=p(),ne=r("p"),fs=a("The "),Ht=r("a"),ms=a("EfficientFormerModel"),hs=a(" forward method, overrides the "),Zo=r("code"),ps=a("__call__"),gs=a(" special method."),us=p(),v(Te.$$.fragment),_s=p(),v(Ee.$$.fragment),Gr=p(),se=r("h2"),Me=r("a"),Jo=r("span"),v(ht.$$.fragment),ys=p(),Uo=r("span"),bs=a("EfficientFormerForImageClassification"),Br=p(),N=r("div"),v(pt.$$.fragment),vs=p(),ko=r("p"),ws=a(`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.`),Fs=p(),gt=r("p"),Ts=a("This model is a PyTorch "),ut=r("a"),Es=a("nn.Module"),Ms=a(` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),$s=p(),P=r("div"),v(_t.$$.fragment),Cs=p(),ae=r("p"),Is=a("The "),Kt=r("a"),Ws=a("EfficientFormerForImageClassification"),js=a(" forward method, overrides the "),zo=r("code"),Zs=a("__call__"),Js=a(" special method."),Us=p(),v($e.$$.fragment),ks=p(),v(Ce.$$.fragment),Sr=p(),ie=r("h2"),Ie=r("a"),No=r("span"),v(yt.$$.fragment),zs=p(),xo=r("span"),Ns=a("EfficientFormerForImageClassificationWithTeacher"),Ar=p(),j=r("div"),v(bt.$$.fragment),xs=p(),Vo=r("p"),Vs=a(`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.`),Rs=p(),v(We.$$.fragment),Ps=p(),vt=r("p"),Gs=a("This model is a PyTorch "),wt=r("a"),Bs=a("nn.Module"),Ss=a(` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),As=p(),G=r("div"),v(Ft.$$.fragment),qs=p(),le=r("p"),Xs=a("The "),eo=r("a"),Ys=a("EfficientFormerForImageClassificationWithTeacher"),Ds=a(" forward method, overrides the "),Ro=r("code"),Ls=a("__call__"),Qs=a(" special method."),Os=p(),v(je.$$.fragment),Hs=p(),v(Ze.$$.fragment),qr=p(),ce=r("h2"),Je=r("a"),Po=r("span"),v(Tt.$$.fragment),Ks=p(),Go=r("span"),ea=a("TFEfficientFormerModel"),Xr=p(),X=r("div"),v(Et.$$.fragment),ta=p(),Mt=r("p"),oa=a(`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),$t=r("a"),ra=a("tf.keras.layers.Layer"),na=a(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),sa=p(),B=r("div"),v(Ct.$$.fragment),aa=p(),de=r("p"),ia=a("The "),to=r("a"),la=a("TFEfficientFormerModel"),ca=a(" forward method, overrides the "),Bo=r("code"),da=a("__call__"),fa=a(" special method."),ma=p(),v(Ue.$$.fragment),ha=p(),v(ke.$$.fragment),Yr=p(),fe=r("h2"),ze=r("a"),So=r("span"),v(It.$$.fragment),pa=p(),Ao=r("span"),ga=a("TFEfficientFormerForImageClassification"),Dr=p(),x=r("div"),v(Wt.$$.fragment),ua=p(),qo=r("p"),_a=a(`EfficientFormer Model transformer with an image classification head on top of pooled last hidden state, e.g. for
ImageNet.`),ya=p(),jt=r("p"),ba=a(`This model is a TensorFlow
`),Zt=r("a"),va=a("tf.keras.layers.Layer"),wa=a(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Fa=p(),S=r("div"),v(Jt.$$.fragment),Ta=p(),me=r("p"),Ea=a("The "),oo=r("a"),Ma=a("TFEfficientFormerForImageClassification"),$a=a(" forward method, overrides the "),Xo=r("code"),Ca=a("__call__"),Ia=a(" special method."),Wa=p(),v(Ne.$$.fragment),ja=p(),v(xe.$$.fragment),Lr=p(),he=r("h2"),Ve=r("a"),Yo=r("span"),v(Ut.$$.fragment),Za=p(),Do=r("span"),Ja=a("TFEfficientFormerForImageClassificationWithTeacher"),Qr=p(),Z=r("div"),v(kt.$$.fragment),Ua=p(),Lo=r("p"),ka=a(`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.`),za=p(),Qo=r("p"),Na=a(`.. warning::
This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),xa=p(),zt=r("p"),Va=a(`This model is a TensorFlow
`),Nt=r("a"),Ra=a("tf.keras.layers.Layer"),Pa=a(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Ga=p(),k=r("div"),v(xt.$$.fragment),Ba=p(),pe=r("p"),Sa=a("The "),ro=r("a"),Aa=a("TFEfficientFormerForImageClassificationWithTeacher"),qa=a(" forward method, overrides the "),Oo=r("code"),Xa=a("__call__"),Ya=a(" special method."),Da=p(),v(Re.$$.fragment),La=p(),Ho=r("ul"),$=r("li"),Ko=r("strong"),Qa=a("Output"),Oa=a(" type of "),no=r("a"),Ha=a("EfficientFormerForImageClassificationWithTeacher"),Ka=a(`.
logits (`),er=r("code"),ei=a("tf.Tensor"),ti=a(" of shape "),tr=r("code"),oi=a("(batch_size, config.num_labels)"),ri=a(`) \u2014 Prediction scores as the average of the cls_logits and distillation logits.
cls_logits (`),or=r("code"),ni=a("tf.Tensor"),si=a(" of shape "),rr=r("code"),ai=a("(batch_size, config.num_labels)"),ii=a(`) \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=a("tf.Tensor"),ci=a(" of shape "),sr=r("code"),di=a("(batch_size, config.num_labels)"),fi=a(`) \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 (`),ar=r("code"),mi=a("tuple(tf.Tensor)"),hi=a(", "),ir=r("em"),pi=a("optional"),gi=a(", returned when "),lr=r("code"),ui=a("output_hidden_states=True"),_i=a(` is passed or when
`),cr=r("code"),yi=a("config.output_hidden_states=True"),bi=a(") \u2014 Tuple of "),dr=r("code"),vi=a("tf.Tensor"),wi=a(` (one for the output of the embeddings + one for the output of each layer) of shape
`),fr=r("code"),Fi=a("(batch_size, sequence_length, hidden_size)"),Ti=a(`. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.
attentions (`),mr=r("code"),Ei=a("tuple(tf.Tensor)"),Mi=a(", "),hr=r("em"),$i=a("optional"),Ci=a(", returned when "),pr=r("code"),Ii=a("output_attentions=True"),Wi=a(` is passed or when
`),gr=r("code"),ji=a("config.output_attentions=True"),Zi=a(") \u2014 Tuple of "),ur=r("code"),Ji=a("tf.Tensor"),Ui=a(" (one for each layer) of shape "),_r=r("code"),ki=a("(batch_size, num_heads, sequence_length, sequence_length)"),zi=a(`. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`),Ni=p(),v(Pe.$$.fragment),this.h()},l(t){const u=uc('[data-svelte="svelte-1phssyn"]',document.head);c=n(u,"META",{name:!0,content:!0}),u.forEach(o),b=g(t),h=n(t,"H1",{class:!0});var Vt=s(h);m=n(Vt,"A",{id:!0,class:!0,href:!0});var yr=s(m);y=n(yr,"SPAN",{});var br=s(y);w(l.$$.fragment,br),br.forEach(o),yr.forEach(o),f=g(Vt),W=n(Vt,"SPAN",{});var vr=s(W);gn=i(vr,"EfficientFormer"),vr.forEach(o),Vt.forEach(o),Ir=g(t),O=n(t,"H2",{class:!0});var Rt=s(O);ge=n(Rt,"A",{id:!0,class:!0,href:!0});var wr=s(ge);_o=n(wr,"SPAN",{});var Fr=s(_o);w(Le.$$.fragment,Fr),Fr.forEach(o),wr.forEach(o),un=g(Rt),yo=n(Rt,"SPAN",{});var Tr=s(yo);_n=i(Tr,"Overview"),Tr.forEach(o),Rt.forEach(o),Wr=g(t),ue=n(t,"P",{});var Pt=s(ue);yn=i(Pt,"The EfficientFormer model was proposed in "),Qe=n(Pt,"A",{href:!0,rel:!0});var Er=s(Qe);bn=i(Er,"EfficientFormer: Vision Transformers at MobileNet Speed"),Er.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=g(t),qt=n(t,"P",{});var Mr=s(qt);wn=i(Mr,"The abstract from the paper is the following:"),Mr.forEach(o),Zr=g(t),Xt=n(t,"P",{});var $r=s(Xt);bo=n($r,"EM",{});var Cr=s(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=g(t),U=n(t,"P",{});var V=s(U);Tn=i(V,"This model was contributed by "),Oe=n(V,"A",{href:!0,rel:!0});var xi=s(Oe);En=i(xi,"novice03"),xi.forEach(o),Mn=i(V," and "),He=n(V,"A",{href:!0,rel:!0});var Vi=s(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=s(Ke);In=i(Ri,"here"),Ri.forEach(o),Wn=i(V,". The TensorFlow version of this model was added by "),et=n(V,"A",{href:!0,rel:!0});var Pi=s(et);jn=i(Pi,"D-Roberts"),Pi.forEach(o),Zn=i(V,"."),V.forEach(o),Ur=g(t),H=n(t,"H2",{class:!0});var Hr=s(H);_e=n(Hr,"A",{id:!0,class:!0,href:!0});var Gi=s(_e);vo=n(Gi,"SPAN",{});var Bi=s(vo);w(tt.$$.fragment,Bi),Bi.forEach(o),Gi.forEach(o),Jn=g(Hr),wo=n(Hr,"SPAN",{});var Si=s(wo);Un=i(Si,"Documentation resources"),Si.forEach(o),Hr.forEach(o),kr=g(t),Yt=n(t,"UL",{});var Ai=s(Yt);Fo=n(Ai,"LI",{});var qi=s(Fo);Dt=n(qi,"A",{href:!0});var Xi=s(Dt);kn=i(Xi,"Image classification task guide"),Xi.forEach(o),qi.forEach(o),Ai.forEach(o),zr=g(t),K=n(t,"H2",{class:!0});var Kr=s(K);ye=n(Kr,"A",{id:!0,class:!0,href:!0});var Yi=s(ye);To=n(Yi,"SPAN",{});var Di=s(To);w(ot.$$.fragment,Di),Di.forEach(o),Yi.forEach(o),zn=g(Kr),Eo=n(Kr,"SPAN",{});var Li=s(Eo);Nn=i(Li,"EfficientFormerConfig"),Li.forEach(o),Kr.forEach(o),Nr=g(t),z=n(t,"DIV",{class:!0});var Ge=s(z);w(rt.$$.fragment,Ge),xn=g(Ge),ee=n(Ge,"P",{});var so=s(ee);Vn=i(so,"This is the configuration class to store the configuration of an "),Lt=n(so,"A",{href:!0});var Qi=s(Lt);Rn=i(Qi,"EfficientFormerModel"),Qi.forEach(o),Pn=i(so,`. 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(so,"A",{href:!0,rel:!0});var Oi=s(nt);Gn=i(Oi,"snap-research/efficientformer-l1"),Oi.forEach(o),Bn=i(so," architecture."),so.forEach(o),Sn=g(Ge),te=n(Ge,"P",{});var ao=s(te);An=i(ao,"Configuration objects inherit from "),Qt=n(ao,"A",{href:!0});var Hi=s(Qt);qn=i(Hi,"PretrainedConfig"),Hi.forEach(o),Xn=i(ao,` and can be used to control the model outputs. Read the
documentation from `),Ot=n(ao,"A",{href:!0});var Ki=s(Ot);Yn=i(Ki,"PretrainedConfig"),Ki.forEach(o),Dn=i(ao," for more information."),ao.forEach(o),Ln=g(Ge),w(be.$$.fragment,Ge),Ge.forEach(o),xr=g(t),oe=n(t,"H2",{class:!0});var en=s(oe);ve=n(en,"A",{id:!0,class:!0,href:!0});var el=s(ve);Mo=n(el,"SPAN",{});var tl=s(Mo);w(st.$$.fragment,tl),tl.forEach(o),el.forEach(o),Qn=g(en),$o=n(en,"SPAN",{});var ol=s($o);On=i(ol,"EfficientFormerImageProcessor"),ol.forEach(o),en.forEach(o),Vr=g(t),A=n(t,"DIV",{class:!0});var io=s(A);w(at.$$.fragment,io),Hn=g(io),Co=n(io,"P",{});var rl=s(Co);Kn=i(rl,"Constructs a EfficientFormer image processor."),rl.forEach(o),es=g(io),we=n(io,"DIV",{class:!0});var tn=s(we);w(it.$$.fragment,tn),ts=g(tn),Io=n(tn,"P",{});var nl=s(Io);os=i(nl,"Preprocess an image or batch of images."),nl.forEach(o),tn.forEach(o),io.forEach(o),Rr=g(t),re=n(t,"H2",{class:!0});var on=s(re);Fe=n(on,"A",{id:!0,class:!0,href:!0});var sl=s(Fe);Wo=n(sl,"SPAN",{});var al=s(Wo);w(lt.$$.fragment,al),al.forEach(o),sl.forEach(o),rs=g(on),jo=n(on,"SPAN",{});var il=s(jo);ns=i(il,"EfficientFormerModel"),il.forEach(o),on.forEach(o),Pr=g(t),q=n(t,"DIV",{class:!0});var lo=s(q);w(ct.$$.fragment,lo),ss=g(lo),dt=n(lo,"P",{});var rn=s(dt);as=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=s(ft);is=i(ll,"nn.Module"),ll.forEach(o),ls=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),cs=g(lo),R=n(lo,"DIV",{class:!0});var Be=s(R);w(mt.$$.fragment,Be),ds=g(Be),ne=n(Be,"P",{});var co=s(ne);fs=i(co,"The "),Ht=n(co,"A",{href:!0});var cl=s(Ht);ms=i(cl,"EfficientFormerModel"),cl.forEach(o),hs=i(co," forward method, overrides the "),Zo=n(co,"CODE",{});var dl=s(Zo);ps=i(dl,"__call__"),dl.forEach(o),gs=i(co," special method."),co.forEach(o),us=g(Be),w(Te.$$.fragment,Be),_s=g(Be),w(Ee.$$.fragment,Be),Be.forEach(o),lo.forEach(o),Gr=g(t),se=n(t,"H2",{class:!0});var nn=s(se);Me=n(nn,"A",{id:!0,class:!0,href:!0});var fl=s(Me);Jo=n(fl,"SPAN",{});var ml=s(Jo);w(ht.$$.fragment,ml),ml.forEach(o),fl.forEach(o),ys=g(nn),Uo=n(nn,"SPAN",{});var hl=s(Uo);bs=i(hl,"EfficientFormerForImageClassification"),hl.forEach(o),nn.forEach(o),Br=g(t),N=n(t,"DIV",{class:!0});var Se=s(N);w(pt.$$.fragment,Se),vs=g(Se),ko=n(Se,"P",{});var pl=s(ko);ws=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),Fs=g(Se),gt=n(Se,"P",{});var sn=s(gt);Ts=i(sn,"This model is a PyTorch "),ut=n(sn,"A",{href:!0,rel:!0});var gl=s(ut);Es=i(gl,"nn.Module"),gl.forEach(o),Ms=i(sn,` subclass. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),sn.forEach(o),$s=g(Se),P=n(Se,"DIV",{class:!0});var Ae=s(P);w(_t.$$.fragment,Ae),Cs=g(Ae),ae=n(Ae,"P",{});var fo=s(ae);Is=i(fo,"The "),Kt=n(fo,"A",{href:!0});var ul=s(Kt);Ws=i(ul,"EfficientFormerForImageClassification"),ul.forEach(o),js=i(fo," forward method, overrides the "),zo=n(fo,"CODE",{});var _l=s(zo);Zs=i(_l,"__call__"),_l.forEach(o),Js=i(fo," special method."),fo.forEach(o),Us=g(Ae),w($e.$$.fragment,Ae),ks=g(Ae),w(Ce.$$.fragment,Ae),Ae.forEach(o),Se.forEach(o),Sr=g(t),ie=n(t,"H2",{class:!0});var an=s(ie);Ie=n(an,"A",{id:!0,class:!0,href:!0});var yl=s(Ie);No=n(yl,"SPAN",{});var bl=s(No);w(yt.$$.fragment,bl),bl.forEach(o),yl.forEach(o),zs=g(an),xo=n(an,"SPAN",{});var vl=s(xo);Ns=i(vl,"EfficientFormerForImageClassificationWithTeacher"),vl.forEach(o),an.forEach(o),Ar=g(t),j=n(t,"DIV",{class:!0});var D=s(j);w(bt.$$.fragment,D),xs=g(D),Vo=n(D,"P",{});var wl=s(Vo);Vs=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),Rs=g(D),w(We.$$.fragment,D),Ps=g(D),vt=n(D,"P",{});var ln=s(vt);Gs=i(ln,"This model is a PyTorch "),wt=n(ln,"A",{href:!0,rel:!0});var Fl=s(wt);Bs=i(Fl,"nn.Module"),Fl.forEach(o),Ss=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),As=g(D),G=n(D,"DIV",{class:!0});var qe=s(G);w(Ft.$$.fragment,qe),qs=g(qe),le=n(qe,"P",{});var mo=s(le);Xs=i(mo,"The "),eo=n(mo,"A",{href:!0});var Tl=s(eo);Ys=i(Tl,"EfficientFormerForImageClassificationWithTeacher"),Tl.forEach(o),Ds=i(mo," forward method, overrides the "),Ro=n(mo,"CODE",{});var El=s(Ro);Ls=i(El,"__call__"),El.forEach(o),Qs=i(mo," special method."),mo.forEach(o),Os=g(qe),w(je.$$.fragment,qe),Hs=g(qe),w(Ze.$$.fragment,qe),qe.forEach(o),D.forEach(o),qr=g(t),ce=n(t,"H2",{class:!0});var cn=s(ce);Je=n(cn,"A",{id:!0,class:!0,href:!0});var Ml=s(Je);Po=n(Ml,"SPAN",{});var $l=s(Po);w(Tt.$$.fragment,$l),$l.forEach(o),Ml.forEach(o),Ks=g(cn),Go=n(cn,"SPAN",{});var Cl=s(Go);ea=i(Cl,"TFEfficientFormerModel"),Cl.forEach(o),cn.forEach(o),Xr=g(t),X=n(t,"DIV",{class:!0});var ho=s(X);w(Et.$$.fragment,ho),ta=g(ho),Mt=n(ho,"P",{});var dn=s(Mt);oa=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 Il=s($t);ra=i(Il,"tf.keras.layers.Layer"),Il.forEach(o),na=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),sa=g(ho),B=n(ho,"DIV",{class:!0});var Xe=s(B);w(Ct.$$.fragment,Xe),aa=g(Xe),de=n(Xe,"P",{});var po=s(de);ia=i(po,"The "),to=n(po,"A",{href:!0});var Wl=s(to);la=i(Wl,"TFEfficientFormerModel"),Wl.forEach(o),ca=i(po," forward method, overrides the "),Bo=n(po,"CODE",{});var jl=s(Bo);da=i(jl,"__call__"),jl.forEach(o),fa=i(po," special method."),po.forEach(o),ma=g(Xe),w(Ue.$$.fragment,Xe),ha=g(Xe),w(ke.$$.fragment,Xe),Xe.forEach(o),ho.forEach(o),Yr=g(t),fe=n(t,"H2",{class:!0});var fn=s(fe);ze=n(fn,"A",{id:!0,class:!0,href:!0});var Zl=s(ze);So=n(Zl,"SPAN",{});var Jl=s(So);w(It.$$.fragment,Jl),Jl.forEach(o),Zl.forEach(o),pa=g(fn),Ao=n(fn,"SPAN",{});var Ul=s(Ao);ga=i(Ul,"TFEfficientFormerForImageClassification"),Ul.forEach(o),fn.forEach(o),Dr=g(t),x=n(t,"DIV",{class:!0});var Ye=s(x);w(Wt.$$.fragment,Ye),ua=g(Ye),qo=n(Ye,"P",{});var kl=s(qo);_a=i(kl,`EfficientFormer Model transformer with an image classification head on top of pooled last hidden state, e.g. for
ImageNet.`),kl.forEach(o),ya=g(Ye),jt=n(Ye,"P",{});var mn=s(jt);ba=i(mn,`This model is a TensorFlow
`),Zt=n(mn,"A",{href:!0,rel:!0});var zl=s(Zt);va=i(zl,"tf.keras.layers.Layer"),zl.forEach(o),wa=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),Fa=g(Ye),S=n(Ye,"DIV",{class:!0});var De=s(S);w(Jt.$$.fragment,De),Ta=g(De),me=n(De,"P",{});var go=s(me);Ea=i(go,"The "),oo=n(go,"A",{href:!0});var Nl=s(oo);Ma=i(Nl,"TFEfficientFormerForImageClassification"),Nl.forEach(o),$a=i(go," forward method, overrides the "),Xo=n(go,"CODE",{});var xl=s(Xo);Ca=i(xl,"__call__"),xl.forEach(o),Ia=i(go," special method."),go.forEach(o),Wa=g(De),w(Ne.$$.fragment,De),ja=g(De),w(xe.$$.fragment,De),De.forEach(o),Ye.forEach(o),Lr=g(t),he=n(t,"H2",{class:!0});var hn=s(he);Ve=n(hn,"A",{id:!0,class:!0,href:!0});var Vl=s(Ve);Yo=n(Vl,"SPAN",{});var Rl=s(Yo);w(Ut.$$.fragment,Rl),Rl.forEach(o),Vl.forEach(o),Za=g(hn),Do=n(hn,"SPAN",{});var Pl=s(Do);Ja=i(Pl,"TFEfficientFormerForImageClassificationWithTeacher"),Pl.forEach(o),hn.forEach(o),Qr=g(t),Z=n(t,"DIV",{class:!0});var L=s(Z);w(kt.$$.fragment,L),Ua=g(L),Lo=n(L,"P",{});var Gl=s(Lo);ka=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),za=g(L),Qo=n(L,"P",{});var Bl=s(Qo);Na=i(Bl,`.. warning::
This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Bl.forEach(o),xa=g(L),zt=n(L,"P",{});var pn=s(zt);Va=i(pn,`This model is a TensorFlow
`),Nt=n(pn,"A",{href:!0,rel:!0});var Sl=s(Nt);Ra=i(Sl,"tf.keras.layers.Layer"),Sl.forEach(o),Pa=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),Ga=g(L),k=n(L,"DIV",{class:!0});var Q=s(k);w(xt.$$.fragment,Q),Ba=g(Q),pe=n(Q,"P",{});var uo=s(pe);Sa=i(uo,"The "),ro=n(uo,"A",{href:!0});var Al=s(ro);Aa=i(Al,"TFEfficientFormerForImageClassificationWithTeacher"),Al.forEach(o),qa=i(uo," forward method, overrides the "),Oo=n(uo,"CODE",{});var ql=s(Oo);Xa=i(ql,"__call__"),ql.forEach(o),Ya=i(uo," special method."),uo.forEach(o),Da=g(Q),w(Re.$$.fragment,Q),La=g(Q),Ho=n(Q,"UL",{});var Xl=s(Ho);$=n(Xl,"LI",{});var C=s($);Ko=n(C,"STRONG",{});var Yl=s(Ko);Qa=i(Yl,"Output"),Yl.forEach(o),Oa=i(C," type of "),no=n(C,"A",{href:!0});var Dl=s(no);Ha=i(Dl,"EfficientFormerForImageClassificationWithTeacher"),Dl.forEach(o),Ka=i(C,`.
logits (`),er=n(C,"CODE",{});var Ll=s(er);ei=i(Ll,"tf.Tensor"),Ll.forEach(o),ti=i(C," of shape "),tr=n(C,"CODE",{});var Ql=s(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=s(or);ni=i(Ol,"tf.Tensor"),Ol.forEach(o),si=i(C," of shape "),rr=n(C,"CODE",{});var Hl=s(rr);ai=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=s(nr);li=i(Kl,"tf.Tensor"),Kl.forEach(o),ci=i(C," of shape "),sr=n(C,"CODE",{});var ec=s(sr);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 (`),ar=n(C,"CODE",{});var tc=s(ar);mi=i(tc,"tuple(tf.Tensor)"),tc.forEach(o),hi=i(C,", "),ir=n(C,"EM",{});var oc=s(ir);pi=i(oc,"optional"),oc.forEach(o),gi=i(C,", returned when "),lr=n(C,"CODE",{});var rc=s(lr);ui=i(rc,"output_hidden_states=True"),rc.forEach(o),_i=i(C,` is passed or when
`),cr=n(C,"CODE",{});var nc=s(cr);yi=i(nc,"config.output_hidden_states=True"),nc.forEach(o),bi=i(C,") \u2014 Tuple of "),dr=n(C,"CODE",{});var sc=s(dr);vi=i(sc,"tf.Tensor"),sc.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 ac=s(fr);Fi=i(ac,"(batch_size, sequence_length, hidden_size)"),ac.forEach(o),Ti=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=s(mr);Ei=i(ic,"tuple(tf.Tensor)"),ic.forEach(o),Mi=i(C,", "),hr=n(C,"EM",{});var lc=s(hr);$i=i(lc,"optional"),lc.forEach(o),Ci=i(C,", returned when "),pr=n(C,"CODE",{});var cc=s(pr);Ii=i(cc,"output_attentions=True"),cc.forEach(o),Wi=i(C,` is passed or when
`),gr=n(C,"CODE",{});var dc=s(gr);ji=i(dc,"config.output_attentions=True"),dc.forEach(o),Zi=i(C,") \u2014 Tuple of "),ur=n(C,"CODE",{});var fc=s(ur);Ji=i(fc,"tf.Tensor"),fc.forEach(o),Ui=i(C," (one for each layer) of shape "),_r=n(C,"CODE",{});var mc=s(_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),Xl.forEach(o),Ni=g(Q),w(Pe.$$.fragment,Q),Q.forEach(o),L.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(ge,"id","overview"),d(ge,"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(ge,"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(Dt,"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(Lt,"href","/docs/transformers/v4.33.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.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ot,"href","/docs/transformers/v4.33.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(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(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.33.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(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(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(se,"class","relative group"),d(ut,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),d(ut,"rel","nofollow"),d(Kt,"href","/docs/transformers/v4.33.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(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(Ie,"id","transformers.EfficientFormerForImageClassificationWithTeacher"),d(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ie,"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.33.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.33.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(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(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.33.0/en/model_doc/efficientformer#transformers.TFEfficientFormerForImageClassification"),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(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(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(Nt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(Nt,"rel","nofollow"),d(ro,"href","/docs/transformers/v4.33.0/en/model_doc/efficientformer#transformers.TFEfficientFormerForImageClassificationWithTeacher"),d(no,"href","/docs/transformers/v4.33.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,u){e(document.head,c),_(t,b,u),_(t,h,u),e(h,m),e(m,y),F(l,y,null),e(h,f),e(h,W),e(W,gn),_(t,Ir,u),_(t,O,u),e(O,ge),e(ge,_o),F(Le,_o,null),e(O,un),e(O,yo),e(yo,_n),_(t,Wr,u),_(t,ue,u),e(ue,yn),e(ue,Qe),e(Qe,bn),e(ue,vn),_(t,jr,u),_(t,qt,u),e(qt,wn),_(t,Zr,u),_(t,Xt,u),e(Xt,bo),e(bo,Fn),_(t,Jr,u),_(t,U,u),e(U,Tn),e(U,Oe),e(Oe,En),e(U,Mn),e(U,He),e(He,$n),e(U,Cn),e(U,Ke),e(Ke,In),e(U,Wn),e(U,et),e(et,jn),e(U,Zn),_(t,Ur,u),_(t,H,u),e(H,_e),e(_e,vo),F(tt,vo,null),e(H,Jn),e(H,wo),e(wo,Un),_(t,kr,u),_(t,Yt,u),e(Yt,Fo),e(Fo,Dt),e(Dt,kn),_(t,zr,u),_(t,K,u),e(K,ye),e(ye,To),F(ot,To,null),e(K,zn),e(K,Eo),e(Eo,Nn),_(t,Nr,u),_(t,z,u),F(rt,z,null),e(z,xn),e(z,ee),e(ee,Vn),e(ee,Lt),e(Lt,Rn),e(ee,Pn),e(ee,nt),e(nt,Gn),e(ee,Bn),e(z,Sn),e(z,te),e(te,An),e(te,Qt),e(Qt,qn),e(te,Xn),e(te,Ot),e(Ot,Yn),e(te,Dn),e(z,Ln),F(be,z,null),_(t,xr,u),_(t,oe,u),e(oe,ve),e(ve,Mo),F(st,Mo,null),e(oe,Qn),e(oe,$o),e($o,On),_(t,Vr,u),_(t,A,u),F(at,A,null),e(A,Hn),e(A,Co),e(Co,Kn),e(A,es),e(A,we),F(it,we,null),e(we,ts),e(we,Io),e(Io,os),_(t,Rr,u),_(t,re,u),e(re,Fe),e(Fe,Wo),F(lt,Wo,null),e(re,rs),e(re,jo),e(jo,ns),_(t,Pr,u),_(t,q,u),F(ct,q,null),e(q,ss),e(q,dt),e(dt,as),e(dt,ft),e(ft,is),e(dt,ls),e(q,cs),e(q,R),F(mt,R,null),e(R,ds),e(R,ne),e(ne,fs),e(ne,Ht),e(Ht,ms),e(ne,hs),e(ne,Zo),e(Zo,ps),e(ne,gs),e(R,us),F(Te,R,null),e(R,_s),F(Ee,R,null),_(t,Gr,u),_(t,se,u),e(se,Me),e(Me,Jo),F(ht,Jo,null),e(se,ys),e(se,Uo),e(Uo,bs),_(t,Br,u),_(t,N,u),F(pt,N,null),e(N,vs),e(N,ko),e(ko,ws),e(N,Fs),e(N,gt),e(gt,Ts),e(gt,ut),e(ut,Es),e(gt,Ms),e(N,$s),e(N,P),F(_t,P,null),e(P,Cs),e(P,ae),e(ae,Is),e(ae,Kt),e(Kt,Ws),e(ae,js),e(ae,zo),e(zo,Zs),e(ae,Js),e(P,Us),F($e,P,null),e(P,ks),F(Ce,P,null),_(t,Sr,u),_(t,ie,u),e(ie,Ie),e(Ie,No),F(yt,No,null),e(ie,zs),e(ie,xo),e(xo,Ns),_(t,Ar,u),_(t,j,u),F(bt,j,null),e(j,xs),e(j,Vo),e(Vo,Vs),e(j,Rs),F(We,j,null),e(j,Ps),e(j,vt),e(vt,Gs),e(vt,wt),e(wt,Bs),e(vt,Ss),e(j,As),e(j,G),F(Ft,G,null),e(G,qs),e(G,le),e(le,Xs),e(le,eo),e(eo,Ys),e(le,Ds),e(le,Ro),e(Ro,Ls),e(le,Qs),e(G,Os),F(je,G,null),e(G,Hs),F(Ze,G,null),_(t,qr,u),_(t,ce,u),e(ce,Je),e(Je,Po),F(Tt,Po,null),e(ce,Ks),e(ce,Go),e(Go,ea),_(t,Xr,u),_(t,X,u),F(Et,X,null),e(X,ta),e(X,Mt),e(Mt,oa),e(Mt,$t),e($t,ra),e(Mt,na),e(X,sa),e(X,B),F(Ct,B,null),e(B,aa),e(B,de),e(de,ia),e(de,to),e(to,la),e(de,ca),e(de,Bo),e(Bo,da),e(de,fa),e(B,ma),F(Ue,B,null),e(B,ha),F(ke,B,null),_(t,Yr,u),_(t,fe,u),e(fe,ze),e(ze,So),F(It,So,null),e(fe,pa),e(fe,Ao),e(Ao,ga),_(t,Dr,u),_(t,x,u),F(Wt,x,null),e(x,ua),e(x,qo),e(qo,_a),e(x,ya),e(x,jt),e(jt,ba),e(jt,Zt),e(Zt,va),e(jt,wa),e(x,Fa),e(x,S),F(Jt,S,null),e(S,Ta),e(S,me),e(me,Ea),e(me,oo),e(oo,Ma),e(me,$a),e(me,Xo),e(Xo,Ca),e(me,Ia),e(S,Wa),F(Ne,S,null),e(S,ja),F(xe,S,null),_(t,Lr,u),_(t,he,u),e(he,Ve),e(Ve,Yo),F(Ut,Yo,null),e(he,Za),e(he,Do),e(Do,Ja),_(t,Qr,u),_(t,Z,u),F(kt,Z,null),e(Z,Ua),e(Z,Lo),e(Lo,ka),e(Z,za),e(Z,Qo),e(Qo,Na),e(Z,xa),e(Z,zt),e(zt,Va),e(zt,Nt),e(Nt,Ra),e(zt,Pa),e(Z,Ga),e(Z,k),F(xt,k,null),e(k,Ba),e(k,pe),e(pe,Sa),e(pe,ro),e(ro,Aa),e(pe,qa),e(pe,Oo),e(Oo,Xa),e(pe,Ya),e(k,Da),F(Re,k,null),e(k,La),e(k,Ho),e(Ho,$),e($,Ko),e(Ko,Qa),e($,Oa),e($,no),e(no,Ha),e($,Ka),e($,er),e(er,ei),e($,ti),e($,tr),e(tr,oi),e($,ri),e($,or),e(or,ni),e($,si),e($,rr),e(rr,ai),e($,ii),e($,nr),e(nr,li),e($,ci),e($,sr),e(sr,di),e($,fi),e($,ar),e(ar,mi),e($,hi),e($,ir),e(ir,pi),e($,gi),e($,lr),e(lr,ui),e($,_i),e($,cr),e(cr,yi),e($,bi),e($,dr),e(dr,vi),e($,wi),e($,fr),e(fr,Fi),e($,Ti),e($,mr),e(mr,Ei),e($,Mi),e($,hr),e(hr,$i),e($,Ci),e($,pr),e(pr,Ii),e($,Wi),e($,gr),e(gr,ji),e($,Zi),e($,ur),e(ur,Ji),e($,Ui),e($,_r),e(_r,ki),e($,zi),e(k,Ni),F(Pe,k,null),Or=!0},p(t,[u]){const Vt={};u&2&&(Vt.$$scope={dirty:u,ctx:t}),be.$set(Vt);const yr={};u&2&&(yr.$$scope={dirty:u,ctx:t}),Te.$set(yr);const br={};u&2&&(br.$$scope={dirty:u,ctx:t}),Ee.$set(br);const vr={};u&2&&(vr.$$scope={dirty:u,ctx:t}),$e.$set(vr);const Rt={};u&2&&(Rt.$$scope={dirty:u,ctx:t}),Ce.$set(Rt);const wr={};u&2&&(wr.$$scope={dirty:u,ctx:t}),We.$set(wr);const Fr={};u&2&&(Fr.$$scope={dirty:u,ctx:t}),je.$set(Fr);const Tr={};u&2&&(Tr.$$scope={dirty:u,ctx:t}),Ze.$set(Tr);const Pt={};u&2&&(Pt.$$scope={dirty:u,ctx:t}),Ue.$set(Pt);const Er={};u&2&&(Er.$$scope={dirty:u,ctx:t}),ke.$set(Er);const Mr={};u&2&&(Mr.$$scope={dirty:u,ctx:t}),Ne.$set(Mr);const $r={};u&2&&($r.$$scope={dirty:u,ctx:t}),xe.$set($r);const Cr={};u&2&&(Cr.$$scope={dirty:u,ctx:t}),Re.$set(Cr);const V={};u&2&&(V.$$scope={dirty:u,ctx:t}),Pe.$set(V)},i(t){Or||(T(l.$$.fragment,t),T(Le.$$.fragment,t),T(tt.$$.fragment,t),T(ot.$$.fragment,t),T(rt.$$.fragment,t),T(be.$$.fragment,t),T(st.$$.fragment,t),T(at.$$.fragment,t),T(it.$$.fragment,t),T(lt.$$.fragment,t),T(ct.$$.fragment,t),T(mt.$$.fragment,t),T(Te.$$.fragment,t),T(Ee.$$.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(We.$$.fragment,t),T(Ft.$$.fragment,t),T(je.$$.fragment,t),T(Ze.$$.fragment,t),T(Tt.$$.fragment,t),T(Et.$$.fragment,t),T(Ct.$$.fragment,t),T(Ue.$$.fragment,t),T(ke.$$.fragment,t),T(It.$$.fragment,t),T(Wt.$$.fragment,t),T(Jt.$$.fragment,t),T(Ne.$$.fragment,t),T(xe.$$.fragment,t),T(Ut.$$.fragment,t),T(kt.$$.fragment,t),T(xt.$$.fragment,t),T(Re.$$.fragment,t),T(Pe.$$.fragment,t),Or=!0)},o(t){E(l.$$.fragment,t),E(Le.$$.fragment,t),E(tt.$$.fragment,t),E(ot.$$.fragment,t),E(rt.$$.fragment,t),E(be.$$.fragment,t),E(st.$$.fragment,t),E(at.$$.fragment,t),E(it.$$.fragment,t),E(lt.$$.fragment,t),E(ct.$$.fragment,t),E(mt.$$.fragment,t),E(Te.$$.fragment,t),E(Ee.$$.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(We.$$.fragment,t),E(Ft.$$.fragment,t),E(je.$$.fragment,t),E(Ze.$$.fragment,t),E(Tt.$$.fragment,t),E(Et.$$.fragment,t),E(Ct.$$.fragment,t),E(Ue.$$.fragment,t),E(ke.$$.fragment,t),E(It.$$.fragment,t),E(Wt.$$.fragment,t),E(Jt.$$.fragment,t),E(Ne.$$.fragment,t),E(xe.$$.fragment,t),E(Ut.$$.fragment,t),E(kt.$$.fragment,t),E(xt.$$.fragment,t),E(Re.$$.fragment,t),E(Pe.$$.fragment,t),Or=!1},d(t){o(c),t&&o(b),t&&o(h),M(l),t&&o(Ir),t&&o(O),M(Le),t&&o(Wr),t&&o(ue),t&&o(jr),t&&o(qt),t&&o(Zr),t&&o(Xt),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(Nr),t&&o(z),M(rt),M(be),t&&o(xr),t&&o(oe),M(st),t&&o(Vr),t&&o(A),M(at),M(it),t&&o(Rr),t&&o(re),M(lt),t&&o(Pr),t&&o(q),M(ct),M(mt),M(Te),M(Ee),t&&o(Gr),t&&o(se),M(ht),t&&o(Br),t&&o(N),M(pt),M(_t),M($e),M(Ce),t&&o(Sr),t&&o(ie),M(yt),t&&o(Ar),t&&o(j),M(bt),M(We),M(Ft),M(je),M(Ze),t&&o(qr),t&&o(ce),M(Tt),t&&o(Xr),t&&o(X),M(Et),M(Ct),M(Ue),M(ke),t&&o(Yr),t&&o(fe),M(It),t&&o(Dr),t&&o(x),M(Wt),M(Jt),M(Ne),M(xe),t&&o(Lr),t&&o(he),M(Ut),t&&o(Qr),t&&o(Z),M(kt),M(xt),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(I){return _c(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gc extends hc{constructor(c){super();pc(this,c,kc,Jc,gc,{})}}export{Gc as default,Uc as metadata};
