import{s as Es,o as zs,n as V}from"../chunks/scheduler.9bc65507.js";import{S as Ls,i as Hs,g as n,s as c,u as C,A as Vs,h as a,f as t,c as d,j as _,v as b,y as h,k as f,o as r,a as i,w as M,d as y,t as w,x as T}from"../chunks/index.78c82d43.js";import{T as Ct}from"../chunks/Tip.87d55b76.js";import{D as S}from"../chunks/Docstring.f3d04bd2.js";import{C as Et}from"../chunks/CodeBlock.48618ec2.js";import{I as Ce}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Wt}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as Ps}from"../chunks/PipelineTag.75b0f707.js";function Rs(j){let o,v="Example:",p,m,u;return m=new Et({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(){o=n("p"),o.textContent=v,p=c(),C(m.$$.fragment)},l(s){o=a(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=v),p=d(s),b(m.$$.fragment,s)},m(s,g){i(s,o,g),i(s,p,g),M(m,s,g),u=!0},p:V,i(s){u||(y(m.$$.fragment,s),u=!0)},o(s){w(m.$$.fragment,s),u=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function Bs(j){let o,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=n("p"),o.innerHTML=v},l(p){o=a(p,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){i(p,o,m)},p:V,d(p){p&&t(o)}}}function As(j){let o,v="Example:",p,m,u;return m=new Et({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(){o=n("p"),o.textContent=v,p=c(),C(m.$$.fragment)},l(s){o=a(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=v),p=d(s),b(m.$$.fragment,s)},m(s,g){i(s,o,g),i(s,p,g),M(m,s,g),u=!0},p:V,i(s){u||(y(m.$$.fragment,s),u=!0)},o(s){w(m.$$.fragment,s),u=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function Gs(j){let o,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=n("p"),o.innerHTML=v},l(p){o=a(p,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){i(p,o,m)},p:V,d(p){p&&t(o)}}}function qs(j){let o,v="Example:",p,m,u;return m=new Et({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(){o=n("p"),o.textContent=v,p=c(),C(m.$$.fragment)},l(s){o=a(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-11lpom8"&&(o.textContent=v),p=d(s),b(m.$$.fragment,s)},m(s,g){i(s,o,g),i(s,p,g),M(m,s,g),u=!0},p:V,i(s){u||(y(m.$$.fragment,s),u=!0)},o(s){w(m.$$.fragment,s),u=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function Qs(j){let o,v="TF 2.0 models accepts two formats as inputs:",p,m,u="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional arguments.</li>",s,g,I=`This second option is useful when using <code>tf.keras.Model.fit</code> method which currently requires having all the
tensors in the first argument of the model call function: <code>model(inputs)</code>.`;return{c(){o=n("p"),o.textContent=v,p=c(),m=n("ul"),m.innerHTML=u,s=c(),g=n("p"),g.innerHTML=I},l($){o=a($,"P",{"data-svelte-h":!0}),h(o)!=="svelte-ha0dwg"&&(o.textContent=v),p=d($),m=a($,"UL",{"data-svelte-h":!0}),h(m)!=="svelte-1ar3osv"&&(m.innerHTML=u),s=d($),g=a($,"P",{"data-svelte-h":!0}),h(g)!=="svelte-wrmwvd"&&(g.innerHTML=I)},m($,x){i($,o,x),i($,p,x),i($,m,x),i($,s,x),i($,g,x)},p:V,d($){$&&(t(o),t(p),t(m),t(s),t(g))}}}function Ss(j){let o,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=n("p"),o.innerHTML=v},l(p){o=a(p,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){i(p,o,m)},p:V,d(p){p&&t(o)}}}function Xs(j){let o,v="Examples:",p,m,u;return m=new Et({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(){o=n("p"),o.textContent=v,p=c(),C(m.$$.fragment)},l(s){o=a(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-kvfsh7"&&(o.textContent=v),p=d(s),b(m.$$.fragment,s)},m(s,g){i(s,o,g),i(s,p,g),M(m,s,g),u=!0},p:V,i(s){u||(y(m.$$.fragment,s),u=!0)},o(s){w(m.$$.fragment,s),u=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function Ys(j){let o,v="TF 2.0 models accepts two formats as inputs:",p,m,u="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional arguments.</li>",s,g,I=`This second option is useful when using <code>tf.keras.Model.fit</code> method which currently requires having all the
tensors in the first argument of the model call function: <code>model(inputs)</code>.`;return{c(){o=n("p"),o.textContent=v,p=c(),m=n("ul"),m.innerHTML=u,s=c(),g=n("p"),g.innerHTML=I},l($){o=a($,"P",{"data-svelte-h":!0}),h(o)!=="svelte-ha0dwg"&&(o.textContent=v),p=d($),m=a($,"UL",{"data-svelte-h":!0}),h(m)!=="svelte-1ar3osv"&&(m.innerHTML=u),s=d($),g=a($,"P",{"data-svelte-h":!0}),h(g)!=="svelte-wrmwvd"&&(g.innerHTML=I)},m($,x){i($,o,x),i($,p,x),i($,m,x),i($,s,x),i($,g,x)},p:V,d($){$&&(t(o),t(p),t(m),t(s),t(g))}}}function Ds(j){let o,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=n("p"),o.innerHTML=v},l(p){o=a(p,"P",{"data-svelte-h":!0}),h(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(p,m){i(p,o,m)},p:V,d(p){p&&t(o)}}}function Os(j){let o,v="Examples:",p,m,u;return m=new Et({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(){o=n("p"),o.textContent=v,p=c(),C(m.$$.fragment)},l(s){o=a(s,"P",{"data-svelte-h":!0}),h(o)!=="svelte-kvfsh7"&&(o.textContent=v),p=d(s),b(m.$$.fragment,s)},m(s,g){i(s,o,g),i(s,p,g),M(m,s,g),u=!0},p:V,i(s){u||(y(m.$$.fragment,s),u=!0)},o(s){w(m.$$.fragment,s),u=!1},d(s){s&&(t(o),t(p)),T(m,s)}}}function Ks(j){let o,v,p,m,u,s,g,I,$,x,Xo="Convolutional Vision Transformer (CvT)",zt,P,X,bt,be,po,Ye,Yo="Overview",Lt,Me,Do='The CvT model was proposed in <a href="https://arxiv.org/abs/2103.15808" rel="nofollow">CvT: Introducing Convolutions to Vision Transformers</a> by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the <a href="vit">Vision Transformer (ViT)</a> in performance and efficiency by introducing convolutions into ViT to yield the best of both designs.',Ht,ye,Oo="The abstract from the paper is the following:",Vt,we,Ko=`<em>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.</em>`,Pt,Te,es="Tips:",Rt,$e,ts=`<li>CvT models are regular Vision Transformers, but trained with convolutions. They outperform the <a href="vit">original model (ViT)</a> when fine-tuned on ImageNet-1K and CIFAR-100.</li> <li>You can check out demo notebooks regarding inference as well as fine-tuning on custom data <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer" rel="nofollow">here</a> (you can just replace <a href="/docs/transformers/v4.33.3/en/model_doc/vit#transformers.ViTFeatureExtractor">ViTFeatureExtractor</a> by <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> and <a href="/docs/transformers/v4.33.3/en/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a> by <a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a>).</li> <li>The available checkpoints are either (1) pre-trained on <a href="http://www.image-net.org/" rel="nofollow">ImageNet-22k</a> (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on <a href="http://www.image-net.org/challenges/LSVRC/2012/" rel="nofollow">ImageNet-1k</a> (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).</li>`,Bt,je,os='This model was contributed by <a href="https://huggingface.co/anugunj" rel="nofollow">anugunj</a>. The original code can be found <a href="https://github.com/microsoft/CvT" rel="nofollow">here</a>.',At,R,Y,Mt,xe,ho,De,ss="Resources",Gt,ke,ns="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with CvT.",qt,Fe,Qt,Ie,as='<li><a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',St,Ue,rs="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",Xt,B,D,yt,Ze,fo,Oe,ls="CvtConfig",Yt,U,Je,go,Ke,is=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.CvtModel">CvtModel</a>. 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
<a href="https://huggingface.co/microsoft/cvt-13" rel="nofollow">microsoft/cvt-13</a> architecture.`,uo,et,cs=`Configuration objects inherit from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,vo,O,Dt,A,K,wt,Ne,_o,tt,ds="CvtModel",Ot,H,We,Co,ot,ms=`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,bo,J,Ee,Mo,st,ps='The <a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.CvtModel">CvtModel</a> forward method, overrides the <code>__call__</code> special method.',yo,ee,wo,te,Kt,G,oe,Tt,ze,To,nt,hs="CvtForImageClassification",eo,Z,Le,$o,at,fs=`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.`,jo,rt,gs=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,xo,N,He,ko,lt,us='The <a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Fo,se,Io,ne,to,q,ae,$t,Ve,Uo,it,vs="TFCvtModel",oo,k,Pe,Zo,ct,_s="The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.",Jo,dt,Cs=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. 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.)`,No,mt,bs=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> 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.`,Wo,re,Eo,W,Re,zo,pt,Ms='The <a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.TFCvtModel">TFCvtModel</a> forward method, overrides the <code>__call__</code> special method.',Lo,le,Ho,ie,so,Q,ce,jt,Be,Vo,ht,ys="TFCvtForImageClassification",no,F,Ae,Po,ft,ws=`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.`,Ro,gt,Ts=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. 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.)`,Bo,ut,$s=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> 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.`,Ao,de,Go,E,Ge,qo,vt,js='The <a href="/docs/transformers/v4.33.3/en/model_doc/cvt#transformers.TFCvtForImageClassification">TFCvtForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Qo,me,So,pe,ao,xt,ro;return I=new Ce({}),be=new Ce({}),xe=new Ce({}),Fe=new Ps({props:{pipeline:"image-classification"}}),Ze=new Ce({}),Je=new S({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.33.3/src/transformers/models/cvt/configuration_cvt.py#L29"}}),O=new Wt({props:{anchor:"transformers.CvtConfig.example",$$slots:{default:[Rs]},$$scope:{ctx:j}}}),Ne=new Ce({}),We=new S({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.33.3/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.33.3/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.3/src/transformers/models/cvt/modeling_cvt.py#L590"}}),Ee=new S({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.33.3/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.33.3/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.3/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.33.3/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>) — 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>) — 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>) — 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>
`}}),ee=new Ct({props:{$$slots:{default:[Bs]},$$scope:{ctx:j}}}),te=new Wt({props:{anchor:"transformers.CvtModel.forward.example",$$slots:{default:[As]},$$scope:{ctx:j}}}),ze=new Ce({}),Le=new S({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.33.3/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.33.3/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.3/src/transformers/models/cvt/modeling_cvt.py#L651"}}),He=new S({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.33.3/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.33.3/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.33.3/src/transformers/models/cvt/modeling_cvt.py#L666",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.3/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) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),se=new Ct({props:{$$slots:{default:[Gs]},$$scope:{ctx:j}}}),ne=new Wt({props:{anchor:"transformers.CvtForImageClassification.forward.example",$$slots:{default:[qs]},$$scope:{ctx:j}}}),Ve=new Ce({}),Pe=new S({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.33.3/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.33.3/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.33.3/src/transformers/models/cvt/modeling_tf_cvt.py#L762"}}),re=new Ct({props:{$$slots:{default:[Qs]},$$scope:{ctx:j}}}),Re=new S({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.33.3/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.33.3/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.33.3/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.33.3/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>) — 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>) — 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>) — 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>
`}}),le=new Ct({props:{$$slots:{default:[Ss]},$$scope:{ctx:j}}}),ie=new Wt({props:{anchor:"transformers.TFCvtModel.call.example",$$slots:{default:[Xs]},$$scope:{ctx:j}}}),Be=new Ce({}),Ae=new S({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.33.3/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.33.3/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.33.3/src/transformers/models/cvt/modeling_tf_cvt.py#L826"}}),de=new Ct({props:{$$slots:{default:[Ys]},$$scope:{ctx:j}}}),Ge=new S({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.33.3/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.33.3/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.33.3/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.33.3/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) — 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>) — 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>) — 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>
`}}),me=new Ct({props:{$$slots:{default:[Ds]},$$scope:{ctx:j}}}),pe=new Wt({props:{anchor:"transformers.TFCvtForImageClassification.call.example",$$slots:{default:[Os]},$$scope:{ctx:j}}}),{c(){o=n("meta"),v=c(),p=n("p"),m=c(),u=n("h1"),s=n("a"),g=n("span"),C(I.$$.fragment),$=c(),x=n("span"),x.textContent=Xo,zt=c(),P=n("h2"),X=n("a"),bt=n("span"),C(be.$$.fragment),po=c(),Ye=n("span"),Ye.textContent=Yo,Lt=c(),Me=n("p"),Me.innerHTML=Do,Ht=c(),ye=n("p"),ye.textContent=Oo,Vt=c(),we=n("p"),we.innerHTML=Ko,Pt=c(),Te=n("p"),Te.textContent=es,Rt=c(),$e=n("ul"),$e.innerHTML=ts,Bt=c(),je=n("p"),je.innerHTML=os,At=c(),R=n("h2"),Y=n("a"),Mt=n("span"),C(xe.$$.fragment),ho=c(),De=n("span"),De.textContent=ss,Gt=c(),ke=n("p"),ke.textContent=ns,qt=c(),C(Fe.$$.fragment),Qt=c(),Ie=n("ul"),Ie.innerHTML=as,St=c(),Ue=n("p"),Ue.textContent=rs,Xt=c(),B=n("h2"),D=n("a"),yt=n("span"),C(Ze.$$.fragment),fo=c(),Oe=n("span"),Oe.textContent=ls,Yt=c(),U=n("div"),C(Je.$$.fragment),go=c(),Ke=n("p"),Ke.innerHTML=is,uo=c(),et=n("p"),et.innerHTML=cs,vo=c(),C(O.$$.fragment),Dt=c(),A=n("h2"),K=n("a"),wt=n("span"),C(Ne.$$.fragment),_o=c(),tt=n("span"),tt.textContent=ds,Ot=c(),H=n("div"),C(We.$$.fragment),Co=c(),ot=n("p"),ot.innerHTML=ms,bo=c(),J=n("div"),C(Ee.$$.fragment),Mo=c(),st=n("p"),st.innerHTML=ps,yo=c(),C(ee.$$.fragment),wo=c(),C(te.$$.fragment),Kt=c(),G=n("h2"),oe=n("a"),Tt=n("span"),C(ze.$$.fragment),To=c(),nt=n("span"),nt.textContent=hs,eo=c(),Z=n("div"),C(Le.$$.fragment),$o=c(),at=n("p"),at.textContent=fs,jo=c(),rt=n("p"),rt.innerHTML=gs,xo=c(),N=n("div"),C(He.$$.fragment),ko=c(),lt=n("p"),lt.innerHTML=us,Fo=c(),C(se.$$.fragment),Io=c(),C(ne.$$.fragment),to=c(),q=n("h2"),ae=n("a"),$t=n("span"),C(Ve.$$.fragment),Uo=c(),it=n("span"),it.textContent=vs,oo=c(),k=n("div"),C(Pe.$$.fragment),Zo=c(),ct=n("p"),ct.textContent=_s,Jo=c(),dt=n("p"),dt.innerHTML=Cs,No=c(),mt=n("p"),mt.innerHTML=bs,Wo=c(),C(re.$$.fragment),Eo=c(),W=n("div"),C(Re.$$.fragment),zo=c(),pt=n("p"),pt.innerHTML=Ms,Lo=c(),C(le.$$.fragment),Ho=c(),C(ie.$$.fragment),so=c(),Q=n("h2"),ce=n("a"),jt=n("span"),C(Be.$$.fragment),Vo=c(),ht=n("span"),ht.textContent=ys,no=c(),F=n("div"),C(Ae.$$.fragment),Po=c(),ft=n("p"),ft.textContent=ws,Ro=c(),gt=n("p"),gt.innerHTML=Ts,Bo=c(),ut=n("p"),ut.innerHTML=$s,Ao=c(),C(de.$$.fragment),Go=c(),E=n("div"),C(Ge.$$.fragment),qo=c(),vt=n("p"),vt.innerHTML=js,Qo=c(),C(me.$$.fragment),So=c(),C(pe.$$.fragment),ao=c(),xt=n("p"),this.h()},l(e){const l=Vs("svelte-1phssyn",document.head);o=a(l,"META",{name:!0,content:!0}),l.forEach(t),v=d(e),p=a(e,"P",{}),_(p).forEach(t),m=d(e),u=a(e,"H1",{class:!0});var qe=_(u);s=a(qe,"A",{id:!0,class:!0,href:!0});var kt=_(s);g=a(kt,"SPAN",{});var Ft=_(g);b(I.$$.fragment,Ft),Ft.forEach(t),kt.forEach(t),$=d(qe),x=a(qe,"SPAN",{"data-svelte-h":!0}),h(x)!=="svelte-1f6r71x"&&(x.textContent=Xo),qe.forEach(t),zt=d(e),P=a(e,"H2",{class:!0});var Qe=_(P);X=a(Qe,"A",{id:!0,class:!0,href:!0});var It=_(X);bt=a(It,"SPAN",{});var Ut=_(bt);b(be.$$.fragment,Ut),Ut.forEach(t),It.forEach(t),po=d(Qe),Ye=a(Qe,"SPAN",{"data-svelte-h":!0}),h(Ye)!=="svelte-1jsw1pg"&&(Ye.textContent=Yo),Qe.forEach(t),Lt=d(e),Me=a(e,"P",{"data-svelte-h":!0}),h(Me)!=="svelte-1ijngll"&&(Me.innerHTML=Do),Ht=d(e),ye=a(e,"P",{"data-svelte-h":!0}),h(ye)!=="svelte-vfdo9a"&&(ye.textContent=Oo),Vt=d(e),we=a(e,"P",{"data-svelte-h":!0}),h(we)!=="svelte-1j8nzd3"&&(we.innerHTML=Ko),Pt=d(e),Te=a(e,"P",{"data-svelte-h":!0}),h(Te)!=="svelte-axv494"&&(Te.textContent=es),Rt=d(e),$e=a(e,"UL",{"data-svelte-h":!0}),h($e)!=="svelte-1sl3c09"&&($e.innerHTML=ts),Bt=d(e),je=a(e,"P",{"data-svelte-h":!0}),h(je)!=="svelte-bcvfwe"&&(je.innerHTML=os),At=d(e),R=a(e,"H2",{class:!0});var Se=_(R);Y=a(Se,"A",{id:!0,class:!0,href:!0});var Zt=_(Y);Mt=a(Zt,"SPAN",{});var Jt=_(Mt);b(xe.$$.fragment,Jt),Jt.forEach(t),Zt.forEach(t),ho=d(Se),De=a(Se,"SPAN",{"data-svelte-h":!0}),h(De)!=="svelte-w4zzv6"&&(De.textContent=ss),Se.forEach(t),Gt=d(e),ke=a(e,"P",{"data-svelte-h":!0}),h(ke)!=="svelte-wslymy"&&(ke.textContent=ns),qt=d(e),b(Fe.$$.fragment,e),Qt=d(e),Ie=a(e,"UL",{"data-svelte-h":!0}),h(Ie)!=="svelte-13j09w6"&&(Ie.innerHTML=as),St=d(e),Ue=a(e,"P",{"data-svelte-h":!0}),h(Ue)!=="svelte-1xesile"&&(Ue.textContent=rs),Xt=d(e),B=a(e,"H2",{class:!0});var Xe=_(B);D=a(Xe,"A",{id:!0,class:!0,href:!0});var Nt=_(D);yt=a(Nt,"SPAN",{});var xs=_(yt);b(Ze.$$.fragment,xs),xs.forEach(t),Nt.forEach(t),fo=d(Xe),Oe=a(Xe,"SPAN",{"data-svelte-h":!0}),h(Oe)!=="svelte-1jj3pwi"&&(Oe.textContent=ls),Xe.forEach(t),Yt=d(e),U=a(e,"DIV",{class:!0});var he=_(U);b(Je.$$.fragment,he),go=d(he),Ke=a(he,"P",{"data-svelte-h":!0}),h(Ke)!=="svelte-dbwm1c"&&(Ke.innerHTML=is),uo=d(he),et=a(he,"P",{"data-svelte-h":!0}),h(et)!=="svelte-cfh5wl"&&(et.innerHTML=cs),vo=d(he),b(O.$$.fragment,he),he.forEach(t),Dt=d(e),A=a(e,"H2",{class:!0});var lo=_(A);K=a(lo,"A",{id:!0,class:!0,href:!0});var ks=_(K);wt=a(ks,"SPAN",{});var Fs=_(wt);b(Ne.$$.fragment,Fs),Fs.forEach(t),ks.forEach(t),_o=d(lo),tt=a(lo,"SPAN",{"data-svelte-h":!0}),h(tt)!=="svelte-fy8yn9"&&(tt.textContent=ds),lo.forEach(t),Ot=d(e),H=a(e,"DIV",{class:!0});var _t=_(H);b(We.$$.fragment,_t),Co=d(_t),ot=a(_t,"P",{"data-svelte-h":!0}),h(ot)!=="svelte-1qa4t0c"&&(ot.innerHTML=ms),bo=d(_t),J=a(_t,"DIV",{class:!0});var fe=_(J);b(Ee.$$.fragment,fe),Mo=d(fe),st=a(fe,"P",{"data-svelte-h":!0}),h(st)!=="svelte-1xdnano"&&(st.innerHTML=ps),yo=d(fe),b(ee.$$.fragment,fe),wo=d(fe),b(te.$$.fragment,fe),fe.forEach(t),_t.forEach(t),Kt=d(e),G=a(e,"H2",{class:!0});var io=_(G);oe=a(io,"A",{id:!0,class:!0,href:!0});var Is=_(oe);Tt=a(Is,"SPAN",{});var Us=_(Tt);b(ze.$$.fragment,Us),Us.forEach(t),Is.forEach(t),To=d(io),nt=a(io,"SPAN",{"data-svelte-h":!0}),h(nt)!=="svelte-x8dssw"&&(nt.textContent=hs),io.forEach(t),eo=d(e),Z=a(e,"DIV",{class:!0});var ge=_(Z);b(Le.$$.fragment,ge),$o=d(ge),at=a(ge,"P",{"data-svelte-h":!0}),h(at)!=="svelte-ztj7cy"&&(at.textContent=fs),jo=d(ge),rt=a(ge,"P",{"data-svelte-h":!0}),h(rt)!=="svelte-1gjh92c"&&(rt.innerHTML=gs),xo=d(ge),N=a(ge,"DIV",{class:!0});var ue=_(N);b(He.$$.fragment,ue),ko=d(ue),lt=a(ue,"P",{"data-svelte-h":!0}),h(lt)!=="svelte-1it51f4"&&(lt.innerHTML=us),Fo=d(ue),b(se.$$.fragment,ue),Io=d(ue),b(ne.$$.fragment,ue),ue.forEach(t),ge.forEach(t),to=d(e),q=a(e,"H2",{class:!0});var co=_(q);ae=a(co,"A",{id:!0,class:!0,href:!0});var Zs=_(ae);$t=a(Zs,"SPAN",{});var Js=_($t);b(Ve.$$.fragment,Js),Js.forEach(t),Zs.forEach(t),Uo=d(co),it=a(co,"SPAN",{"data-svelte-h":!0}),h(it)!=="svelte-1313eij"&&(it.textContent=vs),co.forEach(t),oo=d(e),k=a(e,"DIV",{class:!0});var z=_(k);b(Pe.$$.fragment,z),Zo=d(z),ct=a(z,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-5yjryq"&&(ct.textContent=_s),Jo=d(z),dt=a(z,"P",{"data-svelte-h":!0}),h(dt)!=="svelte-1e9g3w8"&&(dt.innerHTML=Cs),No=d(z),mt=a(z,"P",{"data-svelte-h":!0}),h(mt)!=="svelte-1ivrf8m"&&(mt.innerHTML=bs),Wo=d(z),b(re.$$.fragment,z),Eo=d(z),W=a(z,"DIV",{class:!0});var ve=_(W);b(Re.$$.fragment,ve),zo=d(ve),pt=a(ve,"P",{"data-svelte-h":!0}),h(pt)!=="svelte-wpvpr4"&&(pt.innerHTML=Ms),Lo=d(ve),b(le.$$.fragment,ve),Ho=d(ve),b(ie.$$.fragment,ve),ve.forEach(t),z.forEach(t),so=d(e),Q=a(e,"H2",{class:!0});var mo=_(Q);ce=a(mo,"A",{id:!0,class:!0,href:!0});var Ns=_(ce);jt=a(Ns,"SPAN",{});var Ws=_(jt);b(Be.$$.fragment,Ws),Ws.forEach(t),Ns.forEach(t),Vo=d(mo),ht=a(mo,"SPAN",{"data-svelte-h":!0}),h(ht)!=="svelte-1cj975i"&&(ht.textContent=ys),mo.forEach(t),no=d(e),F=a(e,"DIV",{class:!0});var L=_(F);b(Ae.$$.fragment,L),Po=d(L),ft=a(L,"P",{"data-svelte-h":!0}),h(ft)!=="svelte-ztj7cy"&&(ft.textContent=ws),Ro=d(L),gt=a(L,"P",{"data-svelte-h":!0}),h(gt)!=="svelte-1e9g3w8"&&(gt.innerHTML=Ts),Bo=d(L),ut=a(L,"P",{"data-svelte-h":!0}),h(ut)!=="svelte-1ivrf8m"&&(ut.innerHTML=$s),Ao=d(L),b(de.$$.fragment,L),Go=d(L),E=a(L,"DIV",{class:!0});var _e=_(E);b(Ge.$$.fragment,_e),qo=d(_e),vt=a(_e,"P",{"data-svelte-h":!0}),h(vt)!=="svelte-1djo4c8"&&(vt.innerHTML=js),Qo=d(_e),b(me.$$.fragment,_e),So=d(_e),b(pe.$$.fragment,_e),_e.forEach(t),L.forEach(t),ao=d(e),xt=a(e,"P",{}),_(xt).forEach(t),this.h()},h(){f(o,"name","hf:doc:metadata"),f(o,"content",JSON.stringify(en)),f(s,"id","convolutional-vision-transformer-cvt"),f(s,"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"),f(s,"href","#convolutional-vision-transformer-cvt"),f(u,"class","relative group"),f(X,"id","overview"),f(X,"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"),f(X,"href","#overview"),f(P,"class","relative group"),f(Y,"id","resources"),f(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Y,"href","#resources"),f(R,"class","relative group"),f(D,"id","transformers.CvtConfig"),f(D,"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"),f(D,"href","#transformers.CvtConfig"),f(B,"class","relative group"),f(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(K,"id","transformers.CvtModel"),f(K,"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"),f(K,"href","#transformers.CvtModel"),f(A,"class","relative group"),f(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(oe,"id","transformers.CvtForImageClassification"),f(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(oe,"href","#transformers.CvtForImageClassification"),f(G,"class","relative group"),f(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ae,"id","transformers.TFCvtModel"),f(ae,"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"),f(ae,"href","#transformers.TFCvtModel"),f(q,"class","relative group"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ce,"id","transformers.TFCvtForImageClassification"),f(ce,"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"),f(ce,"href","#transformers.TFCvtForImageClassification"),f(Q,"class","relative group"),f(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,l){r(document.head,o),i(e,v,l),i(e,p,l),i(e,m,l),i(e,u,l),r(u,s),r(s,g),M(I,g,null),r(u,$),r(u,x),i(e,zt,l),i(e,P,l),r(P,X),r(X,bt),M(be,bt,null),r(P,po),r(P,Ye),i(e,Lt,l),i(e,Me,l),i(e,Ht,l),i(e,ye,l),i(e,Vt,l),i(e,we,l),i(e,Pt,l),i(e,Te,l),i(e,Rt,l),i(e,$e,l),i(e,Bt,l),i(e,je,l),i(e,At,l),i(e,R,l),r(R,Y),r(Y,Mt),M(xe,Mt,null),r(R,ho),r(R,De),i(e,Gt,l),i(e,ke,l),i(e,qt,l),M(Fe,e,l),i(e,Qt,l),i(e,Ie,l),i(e,St,l),i(e,Ue,l),i(e,Xt,l),i(e,B,l),r(B,D),r(D,yt),M(Ze,yt,null),r(B,fo),r(B,Oe),i(e,Yt,l),i(e,U,l),M(Je,U,null),r(U,go),r(U,Ke),r(U,uo),r(U,et),r(U,vo),M(O,U,null),i(e,Dt,l),i(e,A,l),r(A,K),r(K,wt),M(Ne,wt,null),r(A,_o),r(A,tt),i(e,Ot,l),i(e,H,l),M(We,H,null),r(H,Co),r(H,ot),r(H,bo),r(H,J),M(Ee,J,null),r(J,Mo),r(J,st),r(J,yo),M(ee,J,null),r(J,wo),M(te,J,null),i(e,Kt,l),i(e,G,l),r(G,oe),r(oe,Tt),M(ze,Tt,null),r(G,To),r(G,nt),i(e,eo,l),i(e,Z,l),M(Le,Z,null),r(Z,$o),r(Z,at),r(Z,jo),r(Z,rt),r(Z,xo),r(Z,N),M(He,N,null),r(N,ko),r(N,lt),r(N,Fo),M(se,N,null),r(N,Io),M(ne,N,null),i(e,to,l),i(e,q,l),r(q,ae),r(ae,$t),M(Ve,$t,null),r(q,Uo),r(q,it),i(e,oo,l),i(e,k,l),M(Pe,k,null),r(k,Zo),r(k,ct),r(k,Jo),r(k,dt),r(k,No),r(k,mt),r(k,Wo),M(re,k,null),r(k,Eo),r(k,W),M(Re,W,null),r(W,zo),r(W,pt),r(W,Lo),M(le,W,null),r(W,Ho),M(ie,W,null),i(e,so,l),i(e,Q,l),r(Q,ce),r(ce,jt),M(Be,jt,null),r(Q,Vo),r(Q,ht),i(e,no,l),i(e,F,l),M(Ae,F,null),r(F,Po),r(F,ft),r(F,Ro),r(F,gt),r(F,Bo),r(F,ut),r(F,Ao),M(de,F,null),r(F,Go),r(F,E),M(Ge,E,null),r(E,qo),r(E,vt),r(E,Qo),M(me,E,null),r(E,So),M(pe,E,null),i(e,ao,l),i(e,xt,l),ro=!0},p(e,[l]){const qe={};l&2&&(qe.$$scope={dirty:l,ctx:e}),O.$set(qe);const kt={};l&2&&(kt.$$scope={dirty:l,ctx:e}),ee.$set(kt);const Ft={};l&2&&(Ft.$$scope={dirty:l,ctx:e}),te.$set(Ft);const Qe={};l&2&&(Qe.$$scope={dirty:l,ctx:e}),se.$set(Qe);const It={};l&2&&(It.$$scope={dirty:l,ctx:e}),ne.$set(It);const Ut={};l&2&&(Ut.$$scope={dirty:l,ctx:e}),re.$set(Ut);const Se={};l&2&&(Se.$$scope={dirty:l,ctx:e}),le.$set(Se);const Zt={};l&2&&(Zt.$$scope={dirty:l,ctx:e}),ie.$set(Zt);const Jt={};l&2&&(Jt.$$scope={dirty:l,ctx:e}),de.$set(Jt);const Xe={};l&2&&(Xe.$$scope={dirty:l,ctx:e}),me.$set(Xe);const Nt={};l&2&&(Nt.$$scope={dirty:l,ctx:e}),pe.$set(Nt)},i(e){ro||(y(I.$$.fragment,e),y(be.$$.fragment,e),y(xe.$$.fragment,e),y(Fe.$$.fragment,e),y(Ze.$$.fragment,e),y(Je.$$.fragment,e),y(O.$$.fragment,e),y(Ne.$$.fragment,e),y(We.$$.fragment,e),y(Ee.$$.fragment,e),y(ee.$$.fragment,e),y(te.$$.fragment,e),y(ze.$$.fragment,e),y(Le.$$.fragment,e),y(He.$$.fragment,e),y(se.$$.fragment,e),y(ne.$$.fragment,e),y(Ve.$$.fragment,e),y(Pe.$$.fragment,e),y(re.$$.fragment,e),y(Re.$$.fragment,e),y(le.$$.fragment,e),y(ie.$$.fragment,e),y(Be.$$.fragment,e),y(Ae.$$.fragment,e),y(de.$$.fragment,e),y(Ge.$$.fragment,e),y(me.$$.fragment,e),y(pe.$$.fragment,e),ro=!0)},o(e){w(I.$$.fragment,e),w(be.$$.fragment,e),w(xe.$$.fragment,e),w(Fe.$$.fragment,e),w(Ze.$$.fragment,e),w(Je.$$.fragment,e),w(O.$$.fragment,e),w(Ne.$$.fragment,e),w(We.$$.fragment,e),w(Ee.$$.fragment,e),w(ee.$$.fragment,e),w(te.$$.fragment,e),w(ze.$$.fragment,e),w(Le.$$.fragment,e),w(He.$$.fragment,e),w(se.$$.fragment,e),w(ne.$$.fragment,e),w(Ve.$$.fragment,e),w(Pe.$$.fragment,e),w(re.$$.fragment,e),w(Re.$$.fragment,e),w(le.$$.fragment,e),w(ie.$$.fragment,e),w(Be.$$.fragment,e),w(Ae.$$.fragment,e),w(de.$$.fragment,e),w(Ge.$$.fragment,e),w(me.$$.fragment,e),w(pe.$$.fragment,e),ro=!1},d(e){e&&(t(v),t(p),t(m),t(u),t(zt),t(P),t(Lt),t(Me),t(Ht),t(ye),t(Vt),t(we),t(Pt),t(Te),t(Rt),t($e),t(Bt),t(je),t(At),t(R),t(Gt),t(ke),t(qt),t(Qt),t(Ie),t(St),t(Ue),t(Xt),t(B),t(Yt),t(U),t(Dt),t(A),t(Ot),t(H),t(Kt),t(G),t(eo),t(Z),t(to),t(q),t(oo),t(k),t(so),t(Q),t(no),t(F),t(ao),t(xt)),t(o),T(I),T(be),T(xe),T(Fe,e),T(Ze),T(Je),T(O),T(Ne),T(We),T(Ee),T(ee),T(te),T(ze),T(Le),T(He),T(se),T(ne),T(Ve),T(Pe),T(re),T(Re),T(le),T(ie),T(Be),T(Ae),T(de),T(Ge),T(me),T(pe)}}}const en={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 tn(j){return zs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mn extends Ls{constructor(o){super(),Hs(this,o,tn,Ks,Es,{})}}export{mn as component};
