import{S as ol,i as sl,s as al,e as n,k as f,w as C,t as s,M as nl,c as r,d as o,m as h,a as l,x as w,h as a,b as d,G as e,g,y as T,q as M,o as $,B as k,v as rl,L as Ro}from"../../chunks/vendor-hf-doc-builder.js";import{T as mo}from"../../chunks/Tip-hf-doc-builder.js";import{D as we}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Bo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Qe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as zo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ll}from"../../chunks/PipelineTag-hf-doc-builder.js";function il(F){let c,b,v,m,_;return m=new Bo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEN2dENvbmZpZyUyQyUyMEN2dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEN2dCUyMG1zZnQlMkZjdnQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ3Z0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMG1zZnQlMkZjdnQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEN2dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CvtConfig, CvtModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Cvt msft/cvt style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CvtConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the msft/cvt style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CvtModel(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=n("p"),b=s("Example:"),v=f(),C(m.$$.fragment)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Example:"),p.forEach(o),v=h(i),w(m.$$.fragment,i)},m(i,p){g(i,c,p),e(c,b),g(i,v,p),T(m,i,p),_=!0},p:Ro,i(i){_||(M(m.$$.fragment,i),_=!0)},o(i){$(m.$$.fragment,i),_=!1},d(i){i&&o(c),i&&o(v),k(m,i)}}}function cl(F){let c,b,v,m,_;return{c(){c=n("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=n("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r(p,"CODE",{});var j=l(v);m=a(j,"Module"),j.forEach(o),_=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){g(i,c,p),e(c,b),e(c,v),e(v,m),e(c,_)},d(i){i&&o(c)}}}function dl(F){let c,b,v,m,_;return m=new Bo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEN2dE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZjdnQtMTMlMjIpJTBBbW9kZWwlMjAlM0QlMjBDdnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGY3Z0LTEzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, CvtModel
<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;microsoft/cvt-13&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CvtModel.from_pretrained(<span class="hljs-string">&quot;microsoft/cvt-13&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">384</span>, <span class="hljs-number">14</span>, <span class="hljs-number">14</span>]`}}),{c(){c=n("p"),b=s("Example:"),v=f(),C(m.$$.fragment)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Example:"),p.forEach(o),v=h(i),w(m.$$.fragment,i)},m(i,p){g(i,c,p),e(c,b),g(i,v,p),T(m,i,p),_=!0},p:Ro,i(i){_||(M(m.$$.fragment,i),_=!0)},o(i){$(m.$$.fragment,i),_=!1},d(i){i&&o(c),i&&o(v),k(m,i)}}}function ml(F){let c,b,v,m,_;return{c(){c=n("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=n("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r(p,"CODE",{});var j=l(v);m=a(j,"Module"),j.forEach(o),_=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){g(i,c,p),e(c,b),e(c,v),e(v,m),e(c,_)},d(i){i&&o(c)}}}function fl(F){let c,b,v,m,_;return m=new Bo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEFtb2RlbCUyMCUzRCUyMEN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, CvtForImageClassification
<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;microsoft/cvt-13&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CvtForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/cvt-13&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){c=n("p"),b=s("Example:"),v=f(),C(m.$$.fragment)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Example:"),p.forEach(o),v=h(i),w(m.$$.fragment,i)},m(i,p){g(i,c,p),e(c,b),g(i,v,p),T(m,i,p),_=!0},p:Ro,i(i){_||(M(m.$$.fragment,i),_=!0)},o(i){$(m.$$.fragment,i),_=!1},d(i){i&&o(c),i&&o(v),k(m,i)}}}function hl(F){let c,b,v,m,_,i,p,j,D,z,E,V,Z,A,O,x,K,q;return{c(){c=n("p"),b=s("TF 2.0 models accepts two formats as inputs:"),v=f(),m=n("ul"),_=n("li"),i=s("having all inputs as keyword arguments (like PyTorch models), or"),p=f(),j=n("li"),D=s("having all inputs as a list, tuple or dict in the first positional arguments."),z=f(),E=n("p"),V=s("This second option is useful when using "),Z=n("code"),A=s("tf.keras.Model.fit"),O=s(` method which currently requires having all the
tensors in the first argument of the model call function: `),x=n("code"),K=s("model(inputs)"),q=s(".")},l(y){c=r(y,"P",{});var I=l(c);b=a(I,"TF 2.0 models accepts two formats as inputs:"),I.forEach(o),v=h(y),m=r(y,"UL",{});var N=l(m);_=r(N,"LI",{});var ae=l(_);i=a(ae,"having all inputs as keyword arguments (like PyTorch models), or"),ae.forEach(o),p=h(N),j=r(N,"LI",{});var ne=l(j);D=a(ne,"having all inputs as a list, tuple or dict in the first positional arguments."),ne.forEach(o),N.forEach(o),z=h(y),E=r(y,"P",{});var U=l(E);V=a(U,"This second option is useful when using "),Z=r(U,"CODE",{});var re=l(Z);A=a(re,"tf.keras.Model.fit"),re.forEach(o),O=a(U,` method which currently requires having all the
tensors in the first argument of the model call function: `),x=r(U,"CODE",{});var le=l(x);K=a(le,"model(inputs)"),le.forEach(o),q=a(U,"."),U.forEach(o)},m(y,I){g(y,c,I),e(c,b),g(y,v,I),g(y,m,I),e(m,_),e(_,i),e(m,p),e(m,j),e(j,D),g(y,z,I),g(y,E,I),e(E,V),e(E,Z),e(Z,A),e(E,O),e(E,x),e(x,K),e(E,q)},d(y){y&&o(c),y&&o(v),y&&o(m),y&&o(z),y&&o(E)}}}function pl(F){let c,b,v,m,_;return{c(){c=n("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=n("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r(p,"CODE",{});var j=l(v);m=a(j,"Module"),j.forEach(o),_=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){g(i,c,p),e(c,b),e(c,v),e(v,m),e(c,_)},d(i){i&&o(c)}}}function ul(F){let c,b,v,m,_;return m=new Bo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGQ3Z0TW9kZWwlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRGQ3Z0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFCvtModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/cvt-13&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCvtModel.from_pretrained(<span class="hljs-string">&quot;microsoft/cvt-13&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=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`}}),{c(){c=n("p"),b=s("Examples:"),v=f(),C(m.$$.fragment)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Examples:"),p.forEach(o),v=h(i),w(m.$$.fragment,i)},m(i,p){g(i,c,p),e(c,b),g(i,v,p),T(m,i,p),_=!0},p:Ro,i(i){_||(M(m.$$.fragment,i),_=!0)},o(i){$(m.$$.fragment,i),_=!1},d(i){i&&o(c),i&&o(v),k(m,i)}}}function gl(F){let c,b,v,m,_,i,p,j,D,z,E,V,Z,A,O,x,K,q;return{c(){c=n("p"),b=s("TF 2.0 models accepts two formats as inputs:"),v=f(),m=n("ul"),_=n("li"),i=s("having all inputs as keyword arguments (like PyTorch models), or"),p=f(),j=n("li"),D=s("having all inputs as a list, tuple or dict in the first positional arguments."),z=f(),E=n("p"),V=s("This second option is useful when using "),Z=n("code"),A=s("tf.keras.Model.fit"),O=s(` method which currently requires having all the
tensors in the first argument of the model call function: `),x=n("code"),K=s("model(inputs)"),q=s(".")},l(y){c=r(y,"P",{});var I=l(c);b=a(I,"TF 2.0 models accepts two formats as inputs:"),I.forEach(o),v=h(y),m=r(y,"UL",{});var N=l(m);_=r(N,"LI",{});var ae=l(_);i=a(ae,"having all inputs as keyword arguments (like PyTorch models), or"),ae.forEach(o),p=h(N),j=r(N,"LI",{});var ne=l(j);D=a(ne,"having all inputs as a list, tuple or dict in the first positional arguments."),ne.forEach(o),N.forEach(o),z=h(y),E=r(y,"P",{});var U=l(E);V=a(U,"This second option is useful when using "),Z=r(U,"CODE",{});var re=l(Z);A=a(re,"tf.keras.Model.fit"),re.forEach(o),O=a(U,` method which currently requires having all the
tensors in the first argument of the model call function: `),x=r(U,"CODE",{});var le=l(x);K=a(le,"model(inputs)"),le.forEach(o),q=a(U,"."),U.forEach(o)},m(y,I){g(y,c,I),e(c,b),g(y,v,I),g(y,m,I),e(m,_),e(_,i),e(m,p),e(m,j),e(j,D),g(y,z,I),g(y,E,I),e(E,V),e(E,Z),e(Z,A),e(E,O),e(E,x),e(x,K),e(E,q)},d(y){y&&o(c),y&&o(v),y&&o(m),y&&o(z),y&&o(E)}}}function vl(F){let c,b,v,m,_;return{c(){c=n("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=n("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r(p,"CODE",{});var j=l(v);m=a(j,"Module"),j.forEach(o),_=a(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(i,p){g(i,c,p),e(c,b),e(c,v),e(v,m),e(c,_)},d(i){i&&o(c)}}}function _l(F){let c,b,v,m,_;return m=new Bo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGQ3Z0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZjdnQtMTMlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfY2xhc3NfaWR4JTIwJTNEJTIwdGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQlMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QmludChwcmVkaWN0ZWRfY2xhc3NfaWR4KSU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFCvtForImageClassification
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/cvt-13&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCvtForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/cvt-13&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=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>logits = outputs.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_class_idx = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[<span class="hljs-built_in">int</span>(predicted_class_idx)])`}}),{c(){c=n("p"),b=s("Examples:"),v=f(),C(m.$$.fragment)},l(i){c=r(i,"P",{});var p=l(c);b=a(p,"Examples:"),p.forEach(o),v=h(i),w(m.$$.fragment,i)},m(i,p){g(i,c,p),e(c,b),g(i,v,p),T(m,i,p),_=!0},p:Ro,i(i){_||(M(m.$$.fragment,i),_=!0)},o(i){$(m.$$.fragment,i),_=!1},d(i){i&&o(c),i&&o(v),k(m,i)}}}function bl(F){let c,b,v,m,_,i,p,j,D,z,E,V,Z,A,O,x,K,q,y,I,N,ae,ne,U,re,le,qo,Zt,Ms,Go,xt,fo,$s,So,Nt,ks,Lo,te,Xe,Es,Wt,js,Fs,Is,P,Us,Ye,Zs,xs,Jt,Ns,Ws,Vt,Js,Vs,At,As,Ps,Pt,zs,Rs,Bs,ie,qs,He,Gs,Ss,De,Ls,Qs,Qo,oe,Xs,Oe,Ys,Hs,Ke,Ds,Os,Xo,ce,Te,ho,et,Ks,po,ea,Yo,zt,ta,Ho,tt,Do,Me,se,Rt,oa,sa,ot,aa,na,st,ra,la,ia,Bt,ca,qt,da,Oo,Gt,ma,Ko,de,$e,uo,at,fa,go,ha,es,R,nt,pa,me,ua,St,ga,va,rt,_a,ba,ya,fe,Ca,Lt,wa,Ta,Qt,Ma,$a,ka,ke,ts,he,Ee,vo,lt,Ea,_o,ja,os,ee,it,Fa,ct,Ia,dt,Ua,Za,xa,G,mt,Na,pe,Wa,Xt,Ja,Va,bo,Aa,Pa,za,je,Ra,Fe,ss,ue,Ie,yo,ft,Ba,Co,qa,as,B,ht,Ga,wo,Sa,La,pt,Qa,ut,Xa,Ya,Ha,S,gt,Da,ge,Oa,Yt,Ka,en,To,tn,on,sn,Ue,an,Ze,ns,ve,xe,Mo,vt,nn,$o,rn,rs,W,_t,ln,ko,cn,dn,bt,mn,Ht,fn,hn,pn,yt,un,Ct,gn,vn,_n,Ne,bn,L,wt,yn,_e,Cn,Dt,wn,Tn,Eo,Mn,$n,kn,We,En,Je,ls,be,Ve,jo,Tt,jn,Fo,Fn,is,J,Mt,In,Io,Un,Zn,$t,xn,Ot,Nn,Wn,Jn,kt,Vn,Et,An,Pn,zn,Ae,Rn,Q,jt,Bn,ye,qn,Kt,Gn,Sn,Uo,Ln,Qn,Xn,Pe,Yn,ze,cs;return i=new Qe({}),A=new Qe({}),et=new Qe({}),tt=new ll({props:{pipeline:"image-classification"}}),at=new Qe({}),nt=new we({props:{name:"class transformers.CvtConfig",anchor:"transformers.CvtConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"patch_sizes",val:" = [7, 3, 3]"},{name:"patch_stride",val:" = [4, 2, 2]"},{name:"patch_padding",val:" = [2, 1, 1]"},{name:"embed_dim",val:" = [64, 192, 384]"},{name:"num_heads",val:" = [1, 3, 6]"},{name:"depth",val:" = [1, 2, 10]"},{name:"mlp_ratio",val:" = [4.0, 4.0, 4.0]"},{name:"attention_drop_rate",val:" = [0.0, 0.0, 0.0]"},{name:"drop_rate",val:" = [0.0, 0.0, 0.0]"},{name:"drop_path_rate",val:" = [0.0, 0.0, 0.1]"},{name:"qkv_bias",val:" = [True, True, True]"},{name:"cls_token",val:" = [False, False, True]"},{name:"qkv_projection_method",val:" = ['dw_bn', 'dw_bn', 'dw_bn']"},{name:"kernel_qkv",val:" = [3, 3, 3]"},{name:"padding_kv",val:" = [1, 1, 1]"},{name:"stride_kv",val:" = [2, 2, 2]"},{name:"padding_q",val:" = [1, 1, 1]"},{name:"stride_q",val:" = [1, 1, 1]"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CvtConfig.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.CvtConfig.patch_sizes",description:`<strong>patch_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[7, 3, 3]</code>) &#x2014;
The kernel size of each encoder&#x2019;s patch embedding.`,name:"patch_sizes"},{anchor:"transformers.CvtConfig.patch_stride",description:`<strong>patch_stride</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 2, 2]</code>) &#x2014;
The stride size of each encoder&#x2019;s patch embedding.`,name:"patch_stride"},{anchor:"transformers.CvtConfig.patch_padding",description:`<strong>patch_padding</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 1, 1]</code>) &#x2014;
The padding size of each encoder&#x2019;s patch embedding.`,name:"patch_padding"},{anchor:"transformers.CvtConfig.embed_dim",description:`<strong>embed_dim</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[64, 192, 384]</code>) &#x2014;
Dimension of each of the encoder blocks.`,name:"embed_dim"},{anchor:"transformers.CvtConfig.num_heads",description:`<strong>num_heads</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 3, 6]</code>) &#x2014;
Number of attention heads for each attention layer in each block of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.CvtConfig.depth",description:`<strong>depth</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 10]</code>) &#x2014;
The number of layers in each encoder block.`,name:"depth"},{anchor:"transformers.CvtConfig.mlp_ratios",description:`<strong>mlp_ratios</strong> (<code>List[float]</code>, <em>optional</em>, defaults to <code>[4.0, 4.0, 4.0, 4.0]</code>) &#x2014;
Ratio of the size of the hidden layer compared to the size of the input layer of the Mix FFNs in the
encoder blocks.`,name:"mlp_ratios"},{anchor:"transformers.CvtConfig.attention_drop_rate",description:`<strong>attention_drop_rate</strong> (<code>List[float]</code>, <em>optional</em>, defaults to <code>[0.0, 0.0, 0.0]</code>) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_drop_rate"},{anchor:"transformers.CvtConfig.drop_rate",description:`<strong>drop_rate</strong> (<code>List[float]</code>, <em>optional</em>, defaults to <code>[0.0, 0.0, 0.0]</code>) &#x2014;
The dropout ratio for the patch embeddings probabilities.`,name:"drop_rate"},{anchor:"transformers.CvtConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>List[float]</code>, <em>optional</em>, defaults to <code>[0.0, 0.0, 0.1]</code>) &#x2014;
The dropout probability for stochastic depth, used in the blocks of the Transformer encoder.`,name:"drop_path_rate"},{anchor:"transformers.CvtConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>List[bool]</code>, <em>optional</em>, defaults to <code>[True, True, True]</code>) &#x2014;
The bias bool for query, key and value in attentions`,name:"qkv_bias"},{anchor:"transformers.CvtConfig.cls_token",description:`<strong>cls_token</strong> (<code>List[bool]</code>, <em>optional</em>, defaults to <code>[False, False, True]</code>) &#x2014;
Whether or not to add a classification token to the output of each of the last 3 stages.`,name:"cls_token"},{anchor:"transformers.CvtConfig.qkv_projection_method",description:`<strong>qkv_projection_method</strong> (<code>List[string]</code>, <em>optional</em>, defaults to [&#x201C;dw_bn&#x201D;, &#x201C;dw_bn&#x201D;, &#x201C;dw_bn&#x201D;]\`) &#x2014;
The projection method for query, key and value Default is depth-wise convolutions with batch norm. For
Linear projection use &#x201C;avg&#x201D;.`,name:"qkv_projection_method"},{anchor:"transformers.CvtConfig.kernel_qkv",description:`<strong>kernel_qkv</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 3]</code>) &#x2014;
The kernel size for query, key and value in attention layer`,name:"kernel_qkv"},{anchor:"transformers.CvtConfig.padding_kv",description:`<strong>padding_kv</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1, 1]</code>) &#x2014;
The padding size for key and value in attention layer`,name:"padding_kv"},{anchor:"transformers.CvtConfig.stride_kv",description:`<strong>stride_kv</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 2, 2]</code>) &#x2014;
The stride size for key and value in attention layer`,name:"stride_kv"},{anchor:"transformers.CvtConfig.padding_q",description:`<strong>padding_q</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1, 1]</code>) &#x2014;
The padding size for query in attention layer`,name:"padding_q"},{anchor:"transformers.CvtConfig.stride_q",description:`<strong>stride_q</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1, 1]</code>) &#x2014;
The stride size for query in attention layer`,name:"stride_q"},{anchor:"transformers.CvtConfig.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.CvtConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/cvt/configuration_cvt.py#L29"}}),ke=new zo({props:{anchor:"transformers.CvtConfig.example",$$slots:{default:[il]},$$scope:{ctx:F}}}),lt=new Qe({}),it=new we({props:{name:"class transformers.CvtModel",anchor:"transformers.CvtModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.CvtModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtConfig">CvtConfig</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.31.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.31.0/src/transformers/models/cvt/modeling_cvt.py#L590"}}),mt=new we({props:{name:"forward",anchor:"transformers.CvtModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CvtModel.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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.CvtModel.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.CvtModel.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.31.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.31.0/src/transformers/models/cvt/modeling_cvt.py#L605",returnDescription:`
<p>A <code>transformers.models.cvt.modeling_cvt.BaseModelOutputWithCLSToken</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.31.0/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><strong>cls_token_value</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 1, hidden_size)</code>) \u2014 Classification token at the output of the last layer of the model.</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>
</ul>
`,returnType:`
<p><code>transformers.models.cvt.modeling_cvt.BaseModelOutputWithCLSToken</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new mo({props:{$$slots:{default:[cl]},$$scope:{ctx:F}}}),Fe=new zo({props:{anchor:"transformers.CvtModel.forward.example",$$slots:{default:[dl]},$$scope:{ctx:F}}}),ft=new Qe({}),ht=new we({props:{name:"class transformers.CvtForImageClassification",anchor:"transformers.CvtForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.CvtForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtConfig">CvtConfig</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.31.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.31.0/src/transformers/models/cvt/modeling_cvt.py#L651"}}),gt=new we({props:{name:"forward",anchor:"transformers.CvtForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CvtForImageClassification.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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.CvtForImageClassification.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.CvtForImageClassification.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CvtForImageClassification.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.31.0/src/transformers/models/cvt/modeling_cvt.py#L666",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new mo({props:{$$slots:{default:[ml]},$$scope:{ctx:F}}}),Ze=new zo({props:{anchor:"transformers.CvtForImageClassification.forward.example",$$slots:{default:[fl]},$$scope:{ctx:F}}}),vt=new Qe({}),_t=new we({props:{name:"class transformers.TFCvtModel",anchor:"transformers.TFCvtModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCvtModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtConfig">CvtConfig</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.31.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/cvt/modeling_tf_cvt.py#L762"}}),Ne=new mo({props:{$$slots:{default:[hl]},$$scope:{ctx:F}}}),wt=new we({props:{name:"call",anchor:"transformers.TFCvtModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCvtModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.TFCvtModel.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCvtModel.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCvtModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/cvt/modeling_tf_cvt.py#L768",returnDescription:`
<p>A <code>transformers.models.cvt.modeling_tf_cvt.TFBaseModelOutputWithCLSToken</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.31.0/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><strong>cls_token_value</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 1, hidden_size)</code>) \u2014 Classification token at the output of the last layer of the model.</li>
<li><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>. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.models.cvt.modeling_tf_cvt.TFBaseModelOutputWithCLSToken</code> or <code>tuple(tf.Tensor)</code></p>
`}}),We=new mo({props:{$$slots:{default:[pl]},$$scope:{ctx:F}}}),Je=new zo({props:{anchor:"transformers.TFCvtModel.call.example",$$slots:{default:[ul]},$$scope:{ctx:F}}}),Tt=new Qe({}),Mt=new we({props:{name:"class transformers.TFCvtForImageClassification",anchor:"transformers.TFCvtForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCvtForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtConfig">CvtConfig</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.31.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/cvt/modeling_tf_cvt.py#L826"}}),Ae=new mo({props:{$$slots:{default:[gl]},$$scope:{ctx:F}}}),jt=new we({props:{name:"call",anchor:"transformers.TFCvtForImageClassification.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCvtForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.TFCvtForImageClassification.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCvtForImageClassification.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCvtForImageClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFCvtForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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.31.0/src/transformers/models/cvt/modeling_tf_cvt.py#L844",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</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.31.0/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</li>
<li><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, num_channels, height, width)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Pe=new mo({props:{$$slots:{default:[vl]},$$scope:{ctx:F}}}),ze=new zo({props:{anchor:"transformers.TFCvtForImageClassification.call.example",$$slots:{default:[_l]},$$scope:{ctx:F}}}),{c(){c=n("meta"),b=f(),v=n("h1"),m=n("a"),_=n("span"),C(i.$$.fragment),p=f(),j=n("span"),D=s("Convolutional Vision Transformer (CvT)"),z=f(),E=n("h2"),V=n("a"),Z=n("span"),C(A.$$.fragment),O=f(),x=n("span"),K=s("Overview"),q=f(),y=n("p"),I=s("The CvT model was proposed in "),N=n("a"),ae=s("CvT: Introducing Convolutions to Vision Transformers"),ne=s(" by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the "),U=n("a"),re=s("Vision Transformer (ViT)"),le=s(" in performance and efficiency by introducing convolutions into ViT to yield the best of both designs."),qo=f(),Zt=n("p"),Ms=s("The abstract from the paper is the following:"),Go=f(),xt=n("p"),fo=n("em"),$s=s(`We present in this paper a new architecture, named Convolutional vision Transformer (CvT), that improves Vision Transformer (ViT)
in performance and efficiency by introducing convolutions into ViT to yield the best of both designs. This is accomplished through
two primary modifications: a hierarchy of Transformers containing a new convolutional token embedding, and a convolutional Transformer
block leveraging a convolutional projection. These changes introduce desirable properties of convolutional neural networks (CNNs)
to the ViT architecture (\\ie shift, scale, and distortion invariance) while maintaining the merits of Transformers (\\ie dynamic attention,
global context, and better generalization). We validate CvT by conducting extensive experiments, showing that this approach achieves
state-of-the-art performance over other Vision Transformers and ResNets on ImageNet-1k, with fewer parameters and lower FLOPs. In addition,
performance gains are maintained when pretrained on larger datasets (\\eg ImageNet-22k) and fine-tuned to downstream tasks. Pre-trained on
ImageNet-22k, our CvT-W24 obtains a top-1 accuracy of 87.7\\% on the ImageNet-1k val set. Finally, our results show that the positional encoding,
a crucial component in existing Vision Transformers, can be safely removed in our model, simplifying the design for higher resolution vision tasks.`),So=f(),Nt=n("p"),ks=s("Tips:"),Lo=f(),te=n("ul"),Xe=n("li"),Es=s("CvT models are regular Vision Transformers, but trained with convolutions. They outperform the "),Wt=n("a"),js=s("original model (ViT)"),Fs=s(" when fine-tuned on ImageNet-1K and CIFAR-100."),Is=f(),P=n("li"),Us=s("You can check out demo notebooks regarding inference as well as fine-tuning on custom data "),Ye=n("a"),Zs=s("here"),xs=s(" (you can just replace "),Jt=n("a"),Ns=s("ViTFeatureExtractor"),Ws=s(" by "),Vt=n("a"),Js=s("AutoImageProcessor"),Vs=s(" and "),At=n("a"),As=s("ViTForImageClassification"),Ps=s(" by "),Pt=n("a"),zs=s("CvtForImageClassification"),Rs=s(")."),Bs=f(),ie=n("li"),qs=s("The available checkpoints are either (1) pre-trained on "),He=n("a"),Gs=s("ImageNet-22k"),Ss=s(" (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on "),De=n("a"),Ls=s("ImageNet-1k"),Qs=s(` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Qo=f(),oe=n("p"),Xs=s("This model was contributed by "),Oe=n("a"),Ys=s("anugunj"),Hs=s(". The original code can be found "),Ke=n("a"),Ds=s("here"),Os=s("."),Xo=f(),ce=n("h2"),Te=n("a"),ho=n("span"),C(et.$$.fragment),Ks=f(),po=n("span"),ea=s("Resources"),Yo=f(),zt=n("p"),ta=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CvT."),Ho=f(),C(tt.$$.fragment),Do=f(),Me=n("ul"),se=n("li"),Rt=n("a"),oa=s("CvtForImageClassification"),sa=s(" is supported by this "),ot=n("a"),aa=s("example script"),na=s(" and "),st=n("a"),ra=s("notebook"),la=s("."),ia=f(),Bt=n("li"),ca=s("See also: "),qt=n("a"),da=s("Image classification task guide"),Oo=f(),Gt=n("p"),ma=s("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Ko=f(),de=n("h2"),$e=n("a"),uo=n("span"),C(at.$$.fragment),fa=f(),go=n("span"),ha=s("CvtConfig"),es=f(),R=n("div"),C(nt.$$.fragment),pa=f(),me=n("p"),ua=s("This is the configuration class to store the configuration of a "),St=n("a"),ga=s("CvtModel"),va=s(`. It is used to instantiate a CvT 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 CvT
`),rt=n("a"),_a=s("microsoft/cvt-13"),ba=s(" architecture."),ya=f(),fe=n("p"),Ca=s("Configuration objects inherit from "),Lt=n("a"),wa=s("PretrainedConfig"),Ta=s(` and can be used to control the model outputs. Read the
documentation from `),Qt=n("a"),Ma=s("PretrainedConfig"),$a=s(" for more information."),ka=f(),C(ke.$$.fragment),ts=f(),he=n("h2"),Ee=n("a"),vo=n("span"),C(lt.$$.fragment),Ea=f(),_o=n("span"),ja=s("CvtModel"),os=f(),ee=n("div"),C(it.$$.fragment),Fa=f(),ct=n("p"),Ia=s(`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),dt=n("a"),Ua=s("torch.nn.Module"),Za=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xa=f(),G=n("div"),C(mt.$$.fragment),Na=f(),pe=n("p"),Wa=s("The "),Xt=n("a"),Ja=s("CvtModel"),Va=s(" forward method, overrides the "),bo=n("code"),Aa=s("__call__"),Pa=s(" special method."),za=f(),C(je.$$.fragment),Ra=f(),C(Fe.$$.fragment),ss=f(),ue=n("h2"),Ie=n("a"),yo=n("span"),C(ft.$$.fragment),Ba=f(),Co=n("span"),qa=s("CvtForImageClassification"),as=f(),B=n("div"),C(ht.$$.fragment),Ga=f(),wo=n("p"),Sa=s(`Cvt 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.`),La=f(),pt=n("p"),Qa=s("This model is a PyTorch "),ut=n("a"),Xa=s("torch.nn.Module"),Ya=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ha=f(),S=n("div"),C(gt.$$.fragment),Da=f(),ge=n("p"),Oa=s("The "),Yt=n("a"),Ka=s("CvtForImageClassification"),en=s(" forward method, overrides the "),To=n("code"),tn=s("__call__"),on=s(" special method."),sn=f(),C(Ue.$$.fragment),an=f(),C(Ze.$$.fragment),ns=f(),ve=n("h2"),xe=n("a"),Mo=n("span"),C(vt.$$.fragment),nn=f(),$o=n("span"),rn=s("TFCvtModel"),rs=f(),W=n("div"),C(_t.$$.fragment),ln=f(),ko=n("p"),cn=s("The bare Cvt Model transformer outputting raw hidden-states without any specific head on top."),dn=f(),bt=n("p"),mn=s("This model inherits from "),Ht=n("a"),fn=s("TFPreTrainedModel"),hn=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pn=f(),yt=n("p"),un=s("This model is also a "),Ct=n("a"),gn=s("tf.keras.Model"),vn=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),_n=f(),C(Ne.$$.fragment),bn=f(),L=n("div"),C(wt.$$.fragment),yn=f(),_e=n("p"),Cn=s("The "),Dt=n("a"),wn=s("TFCvtModel"),Tn=s(" forward method, overrides the "),Eo=n("code"),Mn=s("__call__"),$n=s(" special method."),kn=f(),C(We.$$.fragment),En=f(),C(Je.$$.fragment),ls=f(),be=n("h2"),Ve=n("a"),jo=n("span"),C(Tt.$$.fragment),jn=f(),Fo=n("span"),Fn=s("TFCvtForImageClassification"),is=f(),J=n("div"),C(Mt.$$.fragment),In=f(),Io=n("p"),Un=s(`Cvt 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.`),Zn=f(),$t=n("p"),xn=s("This model inherits from "),Ot=n("a"),Nn=s("TFPreTrainedModel"),Wn=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Jn=f(),kt=n("p"),Vn=s("This model is also a "),Et=n("a"),An=s("tf.keras.Model"),Pn=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),zn=f(),C(Ae.$$.fragment),Rn=f(),Q=n("div"),C(jt.$$.fragment),Bn=f(),ye=n("p"),qn=s("The "),Kt=n("a"),Gn=s("TFCvtForImageClassification"),Sn=s(" forward method, overrides the "),Uo=n("code"),Ln=s("__call__"),Qn=s(" special method."),Xn=f(),C(Pe.$$.fragment),Yn=f(),C(ze.$$.fragment),this.h()},l(t){const u=nl('[data-svelte="svelte-1phssyn"]',document.head);c=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=h(t),v=r(t,"H1",{class:!0});var Ft=l(v);m=r(Ft,"A",{id:!0,class:!0,href:!0});var Zo=l(m);_=r(Zo,"SPAN",{});var xo=l(_);w(i.$$.fragment,xo),xo.forEach(o),Zo.forEach(o),p=h(Ft),j=r(Ft,"SPAN",{});var No=l(j);D=a(No,"Convolutional Vision Transformer (CvT)"),No.forEach(o),Ft.forEach(o),z=h(t),E=r(t,"H2",{class:!0});var It=l(E);V=r(It,"A",{id:!0,class:!0,href:!0});var Wo=l(V);Z=r(Wo,"SPAN",{});var Jo=l(Z);w(A.$$.fragment,Jo),Jo.forEach(o),Wo.forEach(o),O=h(It),x=r(It,"SPAN",{});var Vo=l(x);K=a(Vo,"Overview"),Vo.forEach(o),It.forEach(o),q=h(t),y=r(t,"P",{});var Ce=l(y);I=a(Ce,"The CvT model was proposed in "),N=r(Ce,"A",{href:!0,rel:!0});var Ao=l(N);ae=a(Ao,"CvT: Introducing Convolutions to Vision Transformers"),Ao.forEach(o),ne=a(Ce," by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the "),U=r(Ce,"A",{href:!0});var Po=l(U);re=a(Po,"Vision Transformer (ViT)"),Po.forEach(o),le=a(Ce," in performance and efficiency by introducing convolutions into ViT to yield the best of both designs."),Ce.forEach(o),qo=h(t),Zt=r(t,"P",{});var Dn=l(Zt);Ms=a(Dn,"The abstract from the paper is the following:"),Dn.forEach(o),Go=h(t),xt=r(t,"P",{});var On=l(xt);fo=r(On,"EM",{});var Kn=l(fo);$s=a(Kn,`We present in this paper a new architecture, named Convolutional vision Transformer (CvT), that improves Vision Transformer (ViT)
in performance and efficiency by introducing convolutions into ViT to yield the best of both designs. This is accomplished through
two primary modifications: a hierarchy of Transformers containing a new convolutional token embedding, and a convolutional Transformer
block leveraging a convolutional projection. These changes introduce desirable properties of convolutional neural networks (CNNs)
to the ViT architecture (\\ie shift, scale, and distortion invariance) while maintaining the merits of Transformers (\\ie dynamic attention,
global context, and better generalization). We validate CvT by conducting extensive experiments, showing that this approach achieves
state-of-the-art performance over other Vision Transformers and ResNets on ImageNet-1k, with fewer parameters and lower FLOPs. In addition,
performance gains are maintained when pretrained on larger datasets (\\eg ImageNet-22k) and fine-tuned to downstream tasks. Pre-trained on
ImageNet-22k, our CvT-W24 obtains a top-1 accuracy of 87.7\\% on the ImageNet-1k val set. Finally, our results show that the positional encoding,
a crucial component in existing Vision Transformers, can be safely removed in our model, simplifying the design for higher resolution vision tasks.`),Kn.forEach(o),On.forEach(o),So=h(t),Nt=r(t,"P",{});var er=l(Nt);ks=a(er,"Tips:"),er.forEach(o),Lo=h(t),te=r(t,"UL",{});var eo=l(te);Xe=r(eo,"LI",{});var ds=l(Xe);Es=a(ds,"CvT models are regular Vision Transformers, but trained with convolutions. They outperform the "),Wt=r(ds,"A",{href:!0});var tr=l(Wt);js=a(tr,"original model (ViT)"),tr.forEach(o),Fs=a(ds," when fine-tuned on ImageNet-1K and CIFAR-100."),ds.forEach(o),Is=h(eo),P=r(eo,"LI",{});var X=l(P);Us=a(X,"You can check out demo notebooks regarding inference as well as fine-tuning on custom data "),Ye=r(X,"A",{href:!0,rel:!0});var or=l(Ye);Zs=a(or,"here"),or.forEach(o),xs=a(X," (you can just replace "),Jt=r(X,"A",{href:!0});var sr=l(Jt);Ns=a(sr,"ViTFeatureExtractor"),sr.forEach(o),Ws=a(X," by "),Vt=r(X,"A",{href:!0});var ar=l(Vt);Js=a(ar,"AutoImageProcessor"),ar.forEach(o),Vs=a(X," and "),At=r(X,"A",{href:!0});var nr=l(At);As=a(nr,"ViTForImageClassification"),nr.forEach(o),Ps=a(X," by "),Pt=r(X,"A",{href:!0});var rr=l(Pt);zs=a(rr,"CvtForImageClassification"),rr.forEach(o),Rs=a(X,")."),X.forEach(o),Bs=h(eo),ie=r(eo,"LI",{});var to=l(ie);qs=a(to,"The available checkpoints are either (1) pre-trained on "),He=r(to,"A",{href:!0,rel:!0});var lr=l(He);Gs=a(lr,"ImageNet-22k"),lr.forEach(o),Ss=a(to," (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on "),De=r(to,"A",{href:!0,rel:!0});var ir=l(De);Ls=a(ir,"ImageNet-1k"),ir.forEach(o),Qs=a(to,` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),to.forEach(o),eo.forEach(o),Qo=h(t),oe=r(t,"P",{});var oo=l(oe);Xs=a(oo,"This model was contributed by "),Oe=r(oo,"A",{href:!0,rel:!0});var cr=l(Oe);Ys=a(cr,"anugunj"),cr.forEach(o),Hs=a(oo,". The original code can be found "),Ke=r(oo,"A",{href:!0,rel:!0});var dr=l(Ke);Ds=a(dr,"here"),dr.forEach(o),Os=a(oo,"."),oo.forEach(o),Xo=h(t),ce=r(t,"H2",{class:!0});var ms=l(ce);Te=r(ms,"A",{id:!0,class:!0,href:!0});var mr=l(Te);ho=r(mr,"SPAN",{});var fr=l(ho);w(et.$$.fragment,fr),fr.forEach(o),mr.forEach(o),Ks=h(ms),po=r(ms,"SPAN",{});var hr=l(po);ea=a(hr,"Resources"),hr.forEach(o),ms.forEach(o),Yo=h(t),zt=r(t,"P",{});var pr=l(zt);ta=a(pr,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CvT."),pr.forEach(o),Ho=h(t),w(tt.$$.fragment,t),Do=h(t),Me=r(t,"UL",{});var fs=l(Me);se=r(fs,"LI",{});var Ut=l(se);Rt=r(Ut,"A",{href:!0});var ur=l(Rt);oa=a(ur,"CvtForImageClassification"),ur.forEach(o),sa=a(Ut," is supported by this "),ot=r(Ut,"A",{href:!0,rel:!0});var gr=l(ot);aa=a(gr,"example script"),gr.forEach(o),na=a(Ut," and "),st=r(Ut,"A",{href:!0,rel:!0});var vr=l(st);ra=a(vr,"notebook"),vr.forEach(o),la=a(Ut,"."),Ut.forEach(o),ia=h(fs),Bt=r(fs,"LI",{});var Hn=l(Bt);ca=a(Hn,"See also: "),qt=r(Hn,"A",{href:!0});var _r=l(qt);da=a(_r,"Image classification task guide"),_r.forEach(o),Hn.forEach(o),fs.forEach(o),Oo=h(t),Gt=r(t,"P",{});var br=l(Gt);ma=a(br,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),br.forEach(o),Ko=h(t),de=r(t,"H2",{class:!0});var hs=l(de);$e=r(hs,"A",{id:!0,class:!0,href:!0});var yr=l($e);uo=r(yr,"SPAN",{});var Cr=l(uo);w(at.$$.fragment,Cr),Cr.forEach(o),yr.forEach(o),fa=h(hs),go=r(hs,"SPAN",{});var wr=l(go);ha=a(wr,"CvtConfig"),wr.forEach(o),hs.forEach(o),es=h(t),R=r(t,"DIV",{class:!0});var Re=l(R);w(nt.$$.fragment,Re),pa=h(Re),me=r(Re,"P",{});var so=l(me);ua=a(so,"This is the configuration class to store the configuration of a "),St=r(so,"A",{href:!0});var Tr=l(St);ga=a(Tr,"CvtModel"),Tr.forEach(o),va=a(so,`. It is used to instantiate a CvT 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 CvT
`),rt=r(so,"A",{href:!0,rel:!0});var Mr=l(rt);_a=a(Mr,"microsoft/cvt-13"),Mr.forEach(o),ba=a(so," architecture."),so.forEach(o),ya=h(Re),fe=r(Re,"P",{});var ao=l(fe);Ca=a(ao,"Configuration objects inherit from "),Lt=r(ao,"A",{href:!0});var $r=l(Lt);wa=a($r,"PretrainedConfig"),$r.forEach(o),Ta=a(ao,` and can be used to control the model outputs. Read the
documentation from `),Qt=r(ao,"A",{href:!0});var kr=l(Qt);Ma=a(kr,"PretrainedConfig"),kr.forEach(o),$a=a(ao," for more information."),ao.forEach(o),ka=h(Re),w(ke.$$.fragment,Re),Re.forEach(o),ts=h(t),he=r(t,"H2",{class:!0});var ps=l(he);Ee=r(ps,"A",{id:!0,class:!0,href:!0});var Er=l(Ee);vo=r(Er,"SPAN",{});var jr=l(vo);w(lt.$$.fragment,jr),jr.forEach(o),Er.forEach(o),Ea=h(ps),_o=r(ps,"SPAN",{});var Fr=l(_o);ja=a(Fr,"CvtModel"),Fr.forEach(o),ps.forEach(o),os=h(t),ee=r(t,"DIV",{class:!0});var no=l(ee);w(it.$$.fragment,no),Fa=h(no),ct=r(no,"P",{});var us=l(ct);Ia=a(us,`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),dt=r(us,"A",{href:!0,rel:!0});var Ir=l(dt);Ua=a(Ir,"torch.nn.Module"),Ir.forEach(o),Za=a(us,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),us.forEach(o),xa=h(no),G=r(no,"DIV",{class:!0});var Be=l(G);w(mt.$$.fragment,Be),Na=h(Be),pe=r(Be,"P",{});var ro=l(pe);Wa=a(ro,"The "),Xt=r(ro,"A",{href:!0});var Ur=l(Xt);Ja=a(Ur,"CvtModel"),Ur.forEach(o),Va=a(ro," forward method, overrides the "),bo=r(ro,"CODE",{});var Zr=l(bo);Aa=a(Zr,"__call__"),Zr.forEach(o),Pa=a(ro," special method."),ro.forEach(o),za=h(Be),w(je.$$.fragment,Be),Ra=h(Be),w(Fe.$$.fragment,Be),Be.forEach(o),no.forEach(o),ss=h(t),ue=r(t,"H2",{class:!0});var gs=l(ue);Ie=r(gs,"A",{id:!0,class:!0,href:!0});var xr=l(Ie);yo=r(xr,"SPAN",{});var Nr=l(yo);w(ft.$$.fragment,Nr),Nr.forEach(o),xr.forEach(o),Ba=h(gs),Co=r(gs,"SPAN",{});var Wr=l(Co);qa=a(Wr,"CvtForImageClassification"),Wr.forEach(o),gs.forEach(o),as=h(t),B=r(t,"DIV",{class:!0});var qe=l(B);w(ht.$$.fragment,qe),Ga=h(qe),wo=r(qe,"P",{});var Jr=l(wo);Sa=a(Jr,`Cvt 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.`),Jr.forEach(o),La=h(qe),pt=r(qe,"P",{});var vs=l(pt);Qa=a(vs,"This model is a PyTorch "),ut=r(vs,"A",{href:!0,rel:!0});var Vr=l(ut);Xa=a(Vr,"torch.nn.Module"),Vr.forEach(o),Ya=a(vs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vs.forEach(o),Ha=h(qe),S=r(qe,"DIV",{class:!0});var Ge=l(S);w(gt.$$.fragment,Ge),Da=h(Ge),ge=r(Ge,"P",{});var lo=l(ge);Oa=a(lo,"The "),Yt=r(lo,"A",{href:!0});var Ar=l(Yt);Ka=a(Ar,"CvtForImageClassification"),Ar.forEach(o),en=a(lo," forward method, overrides the "),To=r(lo,"CODE",{});var Pr=l(To);tn=a(Pr,"__call__"),Pr.forEach(o),on=a(lo," special method."),lo.forEach(o),sn=h(Ge),w(Ue.$$.fragment,Ge),an=h(Ge),w(Ze.$$.fragment,Ge),Ge.forEach(o),qe.forEach(o),ns=h(t),ve=r(t,"H2",{class:!0});var _s=l(ve);xe=r(_s,"A",{id:!0,class:!0,href:!0});var zr=l(xe);Mo=r(zr,"SPAN",{});var Rr=l(Mo);w(vt.$$.fragment,Rr),Rr.forEach(o),zr.forEach(o),nn=h(_s),$o=r(_s,"SPAN",{});var Br=l($o);rn=a(Br,"TFCvtModel"),Br.forEach(o),_s.forEach(o),rs=h(t),W=r(t,"DIV",{class:!0});var Y=l(W);w(_t.$$.fragment,Y),ln=h(Y),ko=r(Y,"P",{});var qr=l(ko);cn=a(qr,"The bare Cvt Model transformer outputting raw hidden-states without any specific head on top."),qr.forEach(o),dn=h(Y),bt=r(Y,"P",{});var bs=l(bt);mn=a(bs,"This model inherits from "),Ht=r(bs,"A",{href:!0});var Gr=l(Ht);fn=a(Gr,"TFPreTrainedModel"),Gr.forEach(o),hn=a(bs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),bs.forEach(o),pn=h(Y),yt=r(Y,"P",{});var ys=l(yt);un=a(ys,"This model is also a "),Ct=r(ys,"A",{href:!0,rel:!0});var Sr=l(Ct);gn=a(Sr,"tf.keras.Model"),Sr.forEach(o),vn=a(ys,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ys.forEach(o),_n=h(Y),w(Ne.$$.fragment,Y),bn=h(Y),L=r(Y,"DIV",{class:!0});var Se=l(L);w(wt.$$.fragment,Se),yn=h(Se),_e=r(Se,"P",{});var io=l(_e);Cn=a(io,"The "),Dt=r(io,"A",{href:!0});var Lr=l(Dt);wn=a(Lr,"TFCvtModel"),Lr.forEach(o),Tn=a(io," forward method, overrides the "),Eo=r(io,"CODE",{});var Qr=l(Eo);Mn=a(Qr,"__call__"),Qr.forEach(o),$n=a(io," special method."),io.forEach(o),kn=h(Se),w(We.$$.fragment,Se),En=h(Se),w(Je.$$.fragment,Se),Se.forEach(o),Y.forEach(o),ls=h(t),be=r(t,"H2",{class:!0});var Cs=l(be);Ve=r(Cs,"A",{id:!0,class:!0,href:!0});var Xr=l(Ve);jo=r(Xr,"SPAN",{});var Yr=l(jo);w(Tt.$$.fragment,Yr),Yr.forEach(o),Xr.forEach(o),jn=h(Cs),Fo=r(Cs,"SPAN",{});var Hr=l(Fo);Fn=a(Hr,"TFCvtForImageClassification"),Hr.forEach(o),Cs.forEach(o),is=h(t),J=r(t,"DIV",{class:!0});var H=l(J);w(Mt.$$.fragment,H),In=h(H),Io=r(H,"P",{});var Dr=l(Io);Un=a(Dr,`Cvt 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.`),Dr.forEach(o),Zn=h(H),$t=r(H,"P",{});var ws=l($t);xn=a(ws,"This model inherits from "),Ot=r(ws,"A",{href:!0});var Or=l(Ot);Nn=a(Or,"TFPreTrainedModel"),Or.forEach(o),Wn=a(ws,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ws.forEach(o),Jn=h(H),kt=r(H,"P",{});var Ts=l(kt);Vn=a(Ts,"This model is also a "),Et=r(Ts,"A",{href:!0,rel:!0});var Kr=l(Et);An=a(Kr,"tf.keras.Model"),Kr.forEach(o),Pn=a(Ts,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ts.forEach(o),zn=h(H),w(Ae.$$.fragment,H),Rn=h(H),Q=r(H,"DIV",{class:!0});var Le=l(Q);w(jt.$$.fragment,Le),Bn=h(Le),ye=r(Le,"P",{});var co=l(ye);qn=a(co,"The "),Kt=r(co,"A",{href:!0});var el=l(Kt);Gn=a(el,"TFCvtForImageClassification"),el.forEach(o),Sn=a(co," forward method, overrides the "),Uo=r(co,"CODE",{});var tl=l(Uo);Ln=a(tl,"__call__"),tl.forEach(o),Qn=a(co," special method."),co.forEach(o),Xn=h(Le),w(Pe.$$.fragment,Le),Yn=h(Le),w(ze.$$.fragment,Le),Le.forEach(o),H.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(yl)),d(m,"id","convolutional-vision-transformer-cvt"),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","#convolutional-vision-transformer-cvt"),d(v,"class","relative group"),d(V,"id","overview"),d(V,"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(V,"href","#overview"),d(E,"class","relative group"),d(N,"href","https://arxiv.org/abs/2103.15808"),d(N,"rel","nofollow"),d(U,"href","vit"),d(Wt,"href","vit"),d(Ye,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),d(Ye,"rel","nofollow"),d(Jt,"href","/docs/transformers/v4.31.0/en/model_doc/vit#transformers.ViTFeatureExtractor"),d(Vt,"href","/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor"),d(At,"href","/docs/transformers/v4.31.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(Pt,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtForImageClassification"),d(He,"href","http://www.image-net.org/"),d(He,"rel","nofollow"),d(De,"href","http://www.image-net.org/challenges/LSVRC/2012/"),d(De,"rel","nofollow"),d(Oe,"href","https://huggingface.co/anugunj"),d(Oe,"rel","nofollow"),d(Ke,"href","https://github.com/microsoft/CvT"),d(Ke,"rel","nofollow"),d(Te,"id","resources"),d(Te,"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(Te,"href","#resources"),d(ce,"class","relative group"),d(Rt,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtForImageClassification"),d(ot,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(ot,"rel","nofollow"),d(st,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(st,"rel","nofollow"),d(qt,"href","../tasks/image_classification"),d($e,"id","transformers.CvtConfig"),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","#transformers.CvtConfig"),d(de,"class","relative group"),d(St,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtModel"),d(rt,"href","https://huggingface.co/microsoft/cvt-13"),d(rt,"rel","nofollow"),d(Lt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Qt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Ee,"id","transformers.CvtModel"),d(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ee,"href","#transformers.CvtModel"),d(he,"class","relative group"),d(dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(dt,"rel","nofollow"),d(Xt,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtModel"),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(ee,"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.CvtForImageClassification"),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.CvtForImageClassification"),d(ue,"class","relative group"),d(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ut,"rel","nofollow"),d(Yt,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.CvtForImageClassification"),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(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(xe,"id","transformers.TFCvtModel"),d(xe,"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(xe,"href","#transformers.TFCvtModel"),d(ve,"class","relative group"),d(Ht,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(Ct,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Ct,"rel","nofollow"),d(Dt,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.TFCvtModel"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"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.TFCvtForImageClassification"),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.TFCvtForImageClassification"),d(be,"class","relative group"),d(Ot,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(Et,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Et,"rel","nofollow"),d(Kt,"href","/docs/transformers/v4.31.0/en/model_doc/cvt#transformers.TFCvtForImageClassification"),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(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,c),g(t,b,u),g(t,v,u),e(v,m),e(m,_),T(i,_,null),e(v,p),e(v,j),e(j,D),g(t,z,u),g(t,E,u),e(E,V),e(V,Z),T(A,Z,null),e(E,O),e(E,x),e(x,K),g(t,q,u),g(t,y,u),e(y,I),e(y,N),e(N,ae),e(y,ne),e(y,U),e(U,re),e(y,le),g(t,qo,u),g(t,Zt,u),e(Zt,Ms),g(t,Go,u),g(t,xt,u),e(xt,fo),e(fo,$s),g(t,So,u),g(t,Nt,u),e(Nt,ks),g(t,Lo,u),g(t,te,u),e(te,Xe),e(Xe,Es),e(Xe,Wt),e(Wt,js),e(Xe,Fs),e(te,Is),e(te,P),e(P,Us),e(P,Ye),e(Ye,Zs),e(P,xs),e(P,Jt),e(Jt,Ns),e(P,Ws),e(P,Vt),e(Vt,Js),e(P,Vs),e(P,At),e(At,As),e(P,Ps),e(P,Pt),e(Pt,zs),e(P,Rs),e(te,Bs),e(te,ie),e(ie,qs),e(ie,He),e(He,Gs),e(ie,Ss),e(ie,De),e(De,Ls),e(ie,Qs),g(t,Qo,u),g(t,oe,u),e(oe,Xs),e(oe,Oe),e(Oe,Ys),e(oe,Hs),e(oe,Ke),e(Ke,Ds),e(oe,Os),g(t,Xo,u),g(t,ce,u),e(ce,Te),e(Te,ho),T(et,ho,null),e(ce,Ks),e(ce,po),e(po,ea),g(t,Yo,u),g(t,zt,u),e(zt,ta),g(t,Ho,u),T(tt,t,u),g(t,Do,u),g(t,Me,u),e(Me,se),e(se,Rt),e(Rt,oa),e(se,sa),e(se,ot),e(ot,aa),e(se,na),e(se,st),e(st,ra),e(se,la),e(Me,ia),e(Me,Bt),e(Bt,ca),e(Bt,qt),e(qt,da),g(t,Oo,u),g(t,Gt,u),e(Gt,ma),g(t,Ko,u),g(t,de,u),e(de,$e),e($e,uo),T(at,uo,null),e(de,fa),e(de,go),e(go,ha),g(t,es,u),g(t,R,u),T(nt,R,null),e(R,pa),e(R,me),e(me,ua),e(me,St),e(St,ga),e(me,va),e(me,rt),e(rt,_a),e(me,ba),e(R,ya),e(R,fe),e(fe,Ca),e(fe,Lt),e(Lt,wa),e(fe,Ta),e(fe,Qt),e(Qt,Ma),e(fe,$a),e(R,ka),T(ke,R,null),g(t,ts,u),g(t,he,u),e(he,Ee),e(Ee,vo),T(lt,vo,null),e(he,Ea),e(he,_o),e(_o,ja),g(t,os,u),g(t,ee,u),T(it,ee,null),e(ee,Fa),e(ee,ct),e(ct,Ia),e(ct,dt),e(dt,Ua),e(ct,Za),e(ee,xa),e(ee,G),T(mt,G,null),e(G,Na),e(G,pe),e(pe,Wa),e(pe,Xt),e(Xt,Ja),e(pe,Va),e(pe,bo),e(bo,Aa),e(pe,Pa),e(G,za),T(je,G,null),e(G,Ra),T(Fe,G,null),g(t,ss,u),g(t,ue,u),e(ue,Ie),e(Ie,yo),T(ft,yo,null),e(ue,Ba),e(ue,Co),e(Co,qa),g(t,as,u),g(t,B,u),T(ht,B,null),e(B,Ga),e(B,wo),e(wo,Sa),e(B,La),e(B,pt),e(pt,Qa),e(pt,ut),e(ut,Xa),e(pt,Ya),e(B,Ha),e(B,S),T(gt,S,null),e(S,Da),e(S,ge),e(ge,Oa),e(ge,Yt),e(Yt,Ka),e(ge,en),e(ge,To),e(To,tn),e(ge,on),e(S,sn),T(Ue,S,null),e(S,an),T(Ze,S,null),g(t,ns,u),g(t,ve,u),e(ve,xe),e(xe,Mo),T(vt,Mo,null),e(ve,nn),e(ve,$o),e($o,rn),g(t,rs,u),g(t,W,u),T(_t,W,null),e(W,ln),e(W,ko),e(ko,cn),e(W,dn),e(W,bt),e(bt,mn),e(bt,Ht),e(Ht,fn),e(bt,hn),e(W,pn),e(W,yt),e(yt,un),e(yt,Ct),e(Ct,gn),e(yt,vn),e(W,_n),T(Ne,W,null),e(W,bn),e(W,L),T(wt,L,null),e(L,yn),e(L,_e),e(_e,Cn),e(_e,Dt),e(Dt,wn),e(_e,Tn),e(_e,Eo),e(Eo,Mn),e(_e,$n),e(L,kn),T(We,L,null),e(L,En),T(Je,L,null),g(t,ls,u),g(t,be,u),e(be,Ve),e(Ve,jo),T(Tt,jo,null),e(be,jn),e(be,Fo),e(Fo,Fn),g(t,is,u),g(t,J,u),T(Mt,J,null),e(J,In),e(J,Io),e(Io,Un),e(J,Zn),e(J,$t),e($t,xn),e($t,Ot),e(Ot,Nn),e($t,Wn),e(J,Jn),e(J,kt),e(kt,Vn),e(kt,Et),e(Et,An),e(kt,Pn),e(J,zn),T(Ae,J,null),e(J,Rn),e(J,Q),T(jt,Q,null),e(Q,Bn),e(Q,ye),e(ye,qn),e(ye,Kt),e(Kt,Gn),e(ye,Sn),e(ye,Uo),e(Uo,Ln),e(ye,Qn),e(Q,Xn),T(Pe,Q,null),e(Q,Yn),T(ze,Q,null),cs=!0},p(t,[u]){const Ft={};u&2&&(Ft.$$scope={dirty:u,ctx:t}),ke.$set(Ft);const Zo={};u&2&&(Zo.$$scope={dirty:u,ctx:t}),je.$set(Zo);const xo={};u&2&&(xo.$$scope={dirty:u,ctx:t}),Fe.$set(xo);const No={};u&2&&(No.$$scope={dirty:u,ctx:t}),Ue.$set(No);const It={};u&2&&(It.$$scope={dirty:u,ctx:t}),Ze.$set(It);const Wo={};u&2&&(Wo.$$scope={dirty:u,ctx:t}),Ne.$set(Wo);const Jo={};u&2&&(Jo.$$scope={dirty:u,ctx:t}),We.$set(Jo);const Vo={};u&2&&(Vo.$$scope={dirty:u,ctx:t}),Je.$set(Vo);const Ce={};u&2&&(Ce.$$scope={dirty:u,ctx:t}),Ae.$set(Ce);const Ao={};u&2&&(Ao.$$scope={dirty:u,ctx:t}),Pe.$set(Ao);const Po={};u&2&&(Po.$$scope={dirty:u,ctx:t}),ze.$set(Po)},i(t){cs||(M(i.$$.fragment,t),M(A.$$.fragment,t),M(et.$$.fragment,t),M(tt.$$.fragment,t),M(at.$$.fragment,t),M(nt.$$.fragment,t),M(ke.$$.fragment,t),M(lt.$$.fragment,t),M(it.$$.fragment,t),M(mt.$$.fragment,t),M(je.$$.fragment,t),M(Fe.$$.fragment,t),M(ft.$$.fragment,t),M(ht.$$.fragment,t),M(gt.$$.fragment,t),M(Ue.$$.fragment,t),M(Ze.$$.fragment,t),M(vt.$$.fragment,t),M(_t.$$.fragment,t),M(Ne.$$.fragment,t),M(wt.$$.fragment,t),M(We.$$.fragment,t),M(Je.$$.fragment,t),M(Tt.$$.fragment,t),M(Mt.$$.fragment,t),M(Ae.$$.fragment,t),M(jt.$$.fragment,t),M(Pe.$$.fragment,t),M(ze.$$.fragment,t),cs=!0)},o(t){$(i.$$.fragment,t),$(A.$$.fragment,t),$(et.$$.fragment,t),$(tt.$$.fragment,t),$(at.$$.fragment,t),$(nt.$$.fragment,t),$(ke.$$.fragment,t),$(lt.$$.fragment,t),$(it.$$.fragment,t),$(mt.$$.fragment,t),$(je.$$.fragment,t),$(Fe.$$.fragment,t),$(ft.$$.fragment,t),$(ht.$$.fragment,t),$(gt.$$.fragment,t),$(Ue.$$.fragment,t),$(Ze.$$.fragment,t),$(vt.$$.fragment,t),$(_t.$$.fragment,t),$(Ne.$$.fragment,t),$(wt.$$.fragment,t),$(We.$$.fragment,t),$(Je.$$.fragment,t),$(Tt.$$.fragment,t),$(Mt.$$.fragment,t),$(Ae.$$.fragment,t),$(jt.$$.fragment,t),$(Pe.$$.fragment,t),$(ze.$$.fragment,t),cs=!1},d(t){o(c),t&&o(b),t&&o(v),k(i),t&&o(z),t&&o(E),k(A),t&&o(q),t&&o(y),t&&o(qo),t&&o(Zt),t&&o(Go),t&&o(xt),t&&o(So),t&&o(Nt),t&&o(Lo),t&&o(te),t&&o(Qo),t&&o(oe),t&&o(Xo),t&&o(ce),k(et),t&&o(Yo),t&&o(zt),t&&o(Ho),k(tt,t),t&&o(Do),t&&o(Me),t&&o(Oo),t&&o(Gt),t&&o(Ko),t&&o(de),k(at),t&&o(es),t&&o(R),k(nt),k(ke),t&&o(ts),t&&o(he),k(lt),t&&o(os),t&&o(ee),k(it),k(mt),k(je),k(Fe),t&&o(ss),t&&o(ue),k(ft),t&&o(as),t&&o(B),k(ht),k(gt),k(Ue),k(Ze),t&&o(ns),t&&o(ve),k(vt),t&&o(rs),t&&o(W),k(_t),k(Ne),k(wt),k(We),k(Je),t&&o(ls),t&&o(be),k(Tt),t&&o(is),t&&o(J),k(Mt),k(Ae),k(jt),k(Pe),k(ze)}}}const yl={local:"convolutional-vision-transformer-cvt",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.CvtConfig",title:"CvtConfig"},{local:"transformers.CvtModel",title:"CvtModel"},{local:"transformers.CvtForImageClassification",title:"CvtForImageClassification"},{local:"transformers.TFCvtModel",title:"TFCvtModel"},{local:"transformers.TFCvtForImageClassification",title:"TFCvtForImageClassification"}],title:"Convolutional Vision Transformer (CvT)"};function Cl(F){return rl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fl extends ol{constructor(c){super();sl(this,c,Cl,bl,al,{})}}export{Fl as default,yl as metadata};
