import{S as tr,i as or,s as ar,e as n,k as p,w as b,t as a,M as rr,c as s,d as o,m as u,a as i,x as w,h as r,b as c,G as e,g as v,y as $,q as T,o as y,B as k,v as nr,L as ha}from"../../chunks/vendor-hf-doc-builder.js";import{T as er}from"../../chunks/Tip-hf-doc-builder.js";import{D as ht}from"../../chunks/Docstring-hf-doc-builder.js";import{C as pa}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as pt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ma}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function sr(I){let d,C,g,m,_;return m=new pa({props:{code:`from transformers import CvtModel, CvtConfig

# Initializing a Cvt msft/cvt style configuration
configuration = CvtConfig()

# Initializing a model from the msft/cvt style configuration
model = CvtModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CvtModel, CvtConfig

<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 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(){d=n("p"),C=a("Example:"),g=p(),b(m.$$.fragment)},l(l){d=s(l,"P",{});var h=i(d);C=r(h,"Example:"),h.forEach(o),g=u(l),w(m.$$.fragment,l)},m(l,h){v(l,d,h),e(d,C),v(l,g,h),$(m,l,h),_=!0},p:ha,i(l){_||(T(m.$$.fragment,l),_=!0)},o(l){y(m.$$.fragment,l),_=!1},d(l){l&&o(d),l&&o(g),k(m,l)}}}function ir(I){let d,C,g,m,_;return{c(){d=n("p"),C=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),m=a("Module"),_=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var h=i(d);C=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(h,"CODE",{});var P=i(g);m=r(P,"Module"),P.forEach(o),_=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(l,h){v(l,d,h),e(d,C),e(d,g),e(g,m),e(d,_)},d(l){l&&o(d)}}}function lr(I){let d,C,g,m,_;return m=new pa({props:{code:`from transformers import AutoFeatureExtractor, CvtModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/cvt-13")
model = CvtModel.from_pretrained("microsoft/cvt-13")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, 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>feature_extractor = AutoFeatureExtractor.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 = feature_extractor(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(){d=n("p"),C=a("Example:"),g=p(),b(m.$$.fragment)},l(l){d=s(l,"P",{});var h=i(d);C=r(h,"Example:"),h.forEach(o),g=u(l),w(m.$$.fragment,l)},m(l,h){v(l,d,h),e(d,C),v(l,g,h),$(m,l,h),_=!0},p:ha,i(l){_||(T(m.$$.fragment,l),_=!0)},o(l){y(m.$$.fragment,l),_=!1},d(l){l&&o(d),l&&o(g),k(m,l)}}}function cr(I){let d,C,g,m,_;return{c(){d=n("p"),C=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),m=a("Module"),_=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var h=i(d);C=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(h,"CODE",{});var P=i(g);m=r(P,"Module"),P.forEach(o),_=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(l,h){v(l,d,h),e(d,C),e(d,g),e(g,m),e(d,_)},d(l){l&&o(d)}}}function dr(I){let d,C,g,m,_;return m=new pa({props:{code:`from transformers import AutoFeatureExtractor, CvtForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/cvt-13")
model = CvtForImageClassification.from_pretrained("microsoft/cvt-13")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, 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>feature_extractor = AutoFeatureExtractor.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 = feature_extractor(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(){d=n("p"),C=a("Example:"),g=p(),b(m.$$.fragment)},l(l){d=s(l,"P",{});var h=i(d);C=r(h,"Example:"),h.forEach(o),g=u(l),w(m.$$.fragment,l)},m(l,h){v(l,d,h),e(d,C),v(l,g,h),$(m,l,h),_=!0},p:ha,i(l){_||(T(m.$$.fragment,l),_=!0)},o(l){y(m.$$.fragment,l),_=!1},d(l){l&&o(d),l&&o(g),k(m,l)}}}function fr(I){let d,C,g,m,_,l,h,P,Nt,ut,z,X,Je,se,Lt,Qe,Vt,gt,N,zt,ie,St,Dt,Ie,Ot,Wt,vt,Fe,Rt,_t,Me,et,Ht,Ct,Ae,Bt,bt,L,le,Ut,Pe,Xt,Yt,Kt,x,Zt,ce,Gt,Jt,qe,Qt,eo,Ne,to,oo,Le,ao,ro,Ve,no,so,io,S,lo,de,co,fo,fe,mo,ho,wt,V,po,me,uo,go,he,vo,_o,$t,D,Y,tt,pe,Co,ot,bo,Tt,E,ue,wo,O,$o,ze,To,yo,ge,ko,xo,Eo,W,jo,Se,Io,Fo,De,Mo,Ao,Po,K,yt,R,Z,at,ve,qo,rt,No,kt,q,_e,Lo,Ce,Vo,be,zo,So,Do,F,we,Oo,H,Wo,Oe,Ro,Ho,nt,Bo,Uo,Xo,G,Yo,J,xt,B,Q,st,$e,Ko,it,Zo,Et,j,Te,Go,lt,Jo,Qo,ye,ea,ke,ta,oa,aa,M,xe,ra,U,na,We,sa,ia,ct,la,ca,da,ee,fa,te,jt;return l=new pt({}),se=new pt({}),pe=new pt({}),ue=new ht({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/vr_17548/src/transformers/models/cvt/configuration_cvt.py#L29"}}),K=new ma({props:{anchor:"transformers.CvtConfig.example",$$slots:{default:[sr]},$$scope:{ctx:I}}}),ve=new pt({}),_e=new ht({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/pr_17548/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/pr_17548/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/vr_17548/src/transformers/models/cvt/modeling_cvt.py#L583"}}),we=new ht({props:{name:"forward",anchor:"transformers.CvtModel.forward",parameters:[{name:"pixel_values",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = 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 <code>CvtFeatureExtractor</code>. See
<code>CvtFeatureExtractor.__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/pr_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/cvt/modeling_cvt.py#L598",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/pr_17548/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>
`}}),G=new er({props:{$$slots:{default:[ir]},$$scope:{ctx:I}}}),J=new ma({props:{anchor:"transformers.CvtModel.forward.example",$$slots:{default:[lr]},$$scope:{ctx:I}}}),$e=new pt({}),Te=new ht({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/pr_17548/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/pr_17548/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/vr_17548/src/transformers/models/cvt/modeling_cvt.py#L640"}}),xe=new ht({props:{name:"forward",anchor:"transformers.CvtForImageClassification.forward",parameters:[{name:"pixel_values",val:" = None"},{name:"labels",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = 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 <code>CvtFeatureExtractor</code>. See
<code>CvtFeatureExtractor.__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/pr_17548/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/vr_17548/src/transformers/models/cvt/modeling_cvt.py#L655",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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/pr_17548/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/pr_17548/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ee=new er({props:{$$slots:{default:[cr]},$$scope:{ctx:I}}}),te=new ma({props:{anchor:"transformers.CvtForImageClassification.forward.example",$$slots:{default:[dr]},$$scope:{ctx:I}}}),{c(){d=n("meta"),C=p(),g=n("h1"),m=n("a"),_=n("span"),b(l.$$.fragment),h=p(),P=n("span"),Nt=a("Convolutional Vision Transformer (CvT)"),ut=p(),z=n("h2"),X=n("a"),Je=n("span"),b(se.$$.fragment),Lt=p(),Qe=n("span"),Vt=a("Overview"),gt=p(),N=n("p"),zt=a("The CvT model was proposed in "),ie=n("a"),St=a("CvT: Introducing Convolutions to Vision Transformers"),Dt=a(" by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the "),Ie=n("a"),Ot=a("Vision Transformer (ViT)"),Wt=a(" in performance and efficiency by introducing convolutions into ViT to yield the best of both designs."),vt=p(),Fe=n("p"),Rt=a("The abstract from the paper is the following:"),_t=p(),Me=n("p"),et=n("em"),Ht=a(`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.`),Ct=p(),Ae=n("p"),Bt=a("Tips:"),bt=p(),L=n("ul"),le=n("li"),Ut=a("CvT models are regular Vision Transformers, but trained with convolutions. They outperform the "),Pe=n("a"),Xt=a("original model (ViT)"),Yt=a(" when fine-tuned on ImageNet-1K and CIFAR-100."),Kt=p(),x=n("li"),Zt=a("You can check out demo notebooks regarding inference as well as fine-tuning on custom data "),ce=n("a"),Gt=a("here"),Jt=a(" (you can just replace "),qe=n("a"),Qt=a("ViTFeatureExtractor"),eo=a(" by "),Ne=n("a"),to=a("AutoFeatureExtractor"),oo=a(" and "),Le=n("a"),ao=a("ViTForImageClassification"),ro=a(" by "),Ve=n("a"),no=a("CvtForImageClassification"),so=a(")."),io=p(),S=n("li"),lo=a("The available checkpoints are either (1) pre-trained on "),de=n("a"),co=a("ImageNet-22k"),fo=a(" (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on "),fe=n("a"),mo=a("ImageNet-1k"),ho=a(` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),wt=p(),V=n("p"),po=a("This model was contributed by "),me=n("a"),uo=a("anugunj"),go=a(". The original code can be found "),he=n("a"),vo=a("here"),_o=a("."),$t=p(),D=n("h2"),Y=n("a"),tt=n("span"),b(pe.$$.fragment),Co=p(),ot=n("span"),bo=a("CvtConfig"),Tt=p(),E=n("div"),b(ue.$$.fragment),wo=p(),O=n("p"),$o=a("This is the configuration class to store the configuration of a "),ze=n("a"),To=a("CvtModel"),yo=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
`),ge=n("a"),ko=a("microsoft/cvt-13"),xo=a(" architecture."),Eo=p(),W=n("p"),jo=a("Configuration objects inherit from "),Se=n("a"),Io=a("PretrainedConfig"),Fo=a(` and can be used to control the model outputs. Read the
documentation from `),De=n("a"),Mo=a("PretrainedConfig"),Ao=a(" for more information."),Po=p(),b(K.$$.fragment),yt=p(),R=n("h2"),Z=n("a"),at=n("span"),b(ve.$$.fragment),qo=p(),rt=n("span"),No=a("CvtModel"),kt=p(),q=n("div"),b(_e.$$.fragment),Lo=p(),Ce=n("p"),Vo=a(`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),be=n("a"),zo=a("torch.nn.Module"),So=a(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Do=p(),F=n("div"),b(we.$$.fragment),Oo=p(),H=n("p"),Wo=a("The "),Oe=n("a"),Ro=a("CvtModel"),Ho=a(" forward method, overrides the "),nt=n("code"),Bo=a("__call__"),Uo=a(" special method."),Xo=p(),b(G.$$.fragment),Yo=p(),b(J.$$.fragment),xt=p(),B=n("h2"),Q=n("a"),st=n("span"),b($e.$$.fragment),Ko=p(),it=n("span"),Zo=a("CvtForImageClassification"),Et=p(),j=n("div"),b(Te.$$.fragment),Go=p(),lt=n("p"),Jo=a(`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.`),Qo=p(),ye=n("p"),ea=a("This model is a PyTorch "),ke=n("a"),ta=a("torch.nn.Module"),oa=a(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),aa=p(),M=n("div"),b(xe.$$.fragment),ra=p(),U=n("p"),na=a("The "),We=n("a"),sa=a("CvtForImageClassification"),ia=a(" forward method, overrides the "),ct=n("code"),la=a("__call__"),ca=a(" special method."),da=p(),b(ee.$$.fragment),fa=p(),b(te.$$.fragment),this.h()},l(t){const f=rr('[data-svelte="svelte-1phssyn"]',document.head);d=s(f,"META",{name:!0,content:!0}),f.forEach(o),C=u(t),g=s(t,"H1",{class:!0});var Ee=i(g);m=s(Ee,"A",{id:!0,class:!0,href:!0});var dt=i(m);_=s(dt,"SPAN",{});var ft=i(_);w(l.$$.fragment,ft),ft.forEach(o),dt.forEach(o),h=u(Ee),P=s(Ee,"SPAN",{});var mt=i(P);Nt=r(mt,"Convolutional Vision Transformer (CvT)"),mt.forEach(o),Ee.forEach(o),ut=u(t),z=s(t,"H2",{class:!0});var je=i(z);X=s(je,"A",{id:!0,class:!0,href:!0});var ua=i(X);Je=s(ua,"SPAN",{});var ga=i(Je);w(se.$$.fragment,ga),ga.forEach(o),ua.forEach(o),Lt=u(je),Qe=s(je,"SPAN",{});var va=i(Qe);Vt=r(va,"Overview"),va.forEach(o),je.forEach(o),gt=u(t),N=s(t,"P",{});var Re=i(N);zt=r(Re,"The CvT model was proposed in "),ie=s(Re,"A",{href:!0,rel:!0});var _a=i(ie);St=r(_a,"CvT: Introducing Convolutions to Vision Transformers"),_a.forEach(o),Dt=r(Re," by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the "),Ie=s(Re,"A",{href:!0});var Ca=i(Ie);Ot=r(Ca,"Vision Transformer (ViT)"),Ca.forEach(o),Wt=r(Re," in performance and efficiency by introducing convolutions into ViT to yield the best of both designs."),Re.forEach(o),vt=u(t),Fe=s(t,"P",{});var ba=i(Fe);Rt=r(ba,"The abstract from the paper is the following:"),ba.forEach(o),_t=u(t),Me=s(t,"P",{});var wa=i(Me);et=s(wa,"EM",{});var $a=i(et);Ht=r($a,`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.`),$a.forEach(o),wa.forEach(o),Ct=u(t),Ae=s(t,"P",{});var Ta=i(Ae);Bt=r(Ta,"Tips:"),Ta.forEach(o),bt=u(t),L=s(t,"UL",{});var He=i(L);le=s(He,"LI",{});var It=i(le);Ut=r(It,"CvT models are regular Vision Transformers, but trained with convolutions. They outperform the "),Pe=s(It,"A",{href:!0});var ya=i(Pe);Xt=r(ya,"original model (ViT)"),ya.forEach(o),Yt=r(It," when fine-tuned on ImageNet-1K and CIFAR-100."),It.forEach(o),Kt=u(He),x=s(He,"LI",{});var A=i(x);Zt=r(A,"You can check out demo notebooks regarding inference as well as fine-tuning on custom data "),ce=s(A,"A",{href:!0,rel:!0});var ka=i(ce);Gt=r(ka,"here"),ka.forEach(o),Jt=r(A," (you can just replace "),qe=s(A,"A",{href:!0});var xa=i(qe);Qt=r(xa,"ViTFeatureExtractor"),xa.forEach(o),eo=r(A," by "),Ne=s(A,"A",{href:!0});var Ea=i(Ne);to=r(Ea,"AutoFeatureExtractor"),Ea.forEach(o),oo=r(A," and "),Le=s(A,"A",{href:!0});var ja=i(Le);ao=r(ja,"ViTForImageClassification"),ja.forEach(o),ro=r(A," by "),Ve=s(A,"A",{href:!0});var Ia=i(Ve);no=r(Ia,"CvtForImageClassification"),Ia.forEach(o),so=r(A,")."),A.forEach(o),io=u(He),S=s(He,"LI",{});var Be=i(S);lo=r(Be,"The available checkpoints are either (1) pre-trained on "),de=s(Be,"A",{href:!0,rel:!0});var Fa=i(de);co=r(Fa,"ImageNet-22k"),Fa.forEach(o),fo=r(Be," (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on "),fe=s(Be,"A",{href:!0,rel:!0});var Ma=i(fe);mo=r(Ma,"ImageNet-1k"),Ma.forEach(o),ho=r(Be,` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Be.forEach(o),He.forEach(o),wt=u(t),V=s(t,"P",{});var Ue=i(V);po=r(Ue,"This model was contributed by "),me=s(Ue,"A",{href:!0,rel:!0});var Aa=i(me);uo=r(Aa,"anugunj"),Aa.forEach(o),go=r(Ue,". The original code can be found "),he=s(Ue,"A",{href:!0,rel:!0});var Pa=i(he);vo=r(Pa,"here"),Pa.forEach(o),_o=r(Ue,"."),Ue.forEach(o),$t=u(t),D=s(t,"H2",{class:!0});var Ft=i(D);Y=s(Ft,"A",{id:!0,class:!0,href:!0});var qa=i(Y);tt=s(qa,"SPAN",{});var Na=i(tt);w(pe.$$.fragment,Na),Na.forEach(o),qa.forEach(o),Co=u(Ft),ot=s(Ft,"SPAN",{});var La=i(ot);bo=r(La,"CvtConfig"),La.forEach(o),Ft.forEach(o),Tt=u(t),E=s(t,"DIV",{class:!0});var oe=i(E);w(ue.$$.fragment,oe),wo=u(oe),O=s(oe,"P",{});var Xe=i(O);$o=r(Xe,"This is the configuration class to store the configuration of a "),ze=s(Xe,"A",{href:!0});var Va=i(ze);To=r(Va,"CvtModel"),Va.forEach(o),yo=r(Xe,`. 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
`),ge=s(Xe,"A",{href:!0,rel:!0});var za=i(ge);ko=r(za,"microsoft/cvt-13"),za.forEach(o),xo=r(Xe," architecture."),Xe.forEach(o),Eo=u(oe),W=s(oe,"P",{});var Ye=i(W);jo=r(Ye,"Configuration objects inherit from "),Se=s(Ye,"A",{href:!0});var Sa=i(Se);Io=r(Sa,"PretrainedConfig"),Sa.forEach(o),Fo=r(Ye,` and can be used to control the model outputs. Read the
documentation from `),De=s(Ye,"A",{href:!0});var Da=i(De);Mo=r(Da,"PretrainedConfig"),Da.forEach(o),Ao=r(Ye," for more information."),Ye.forEach(o),Po=u(oe),w(K.$$.fragment,oe),oe.forEach(o),yt=u(t),R=s(t,"H2",{class:!0});var Mt=i(R);Z=s(Mt,"A",{id:!0,class:!0,href:!0});var Oa=i(Z);at=s(Oa,"SPAN",{});var Wa=i(at);w(ve.$$.fragment,Wa),Wa.forEach(o),Oa.forEach(o),qo=u(Mt),rt=s(Mt,"SPAN",{});var Ra=i(rt);No=r(Ra,"CvtModel"),Ra.forEach(o),Mt.forEach(o),kt=u(t),q=s(t,"DIV",{class:!0});var Ke=i(q);w(_e.$$.fragment,Ke),Lo=u(Ke),Ce=s(Ke,"P",{});var At=i(Ce);Vo=r(At,`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),be=s(At,"A",{href:!0,rel:!0});var Ha=i(be);zo=r(Ha,"torch.nn.Module"),Ha.forEach(o),So=r(At,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),At.forEach(o),Do=u(Ke),F=s(Ke,"DIV",{class:!0});var ae=i(F);w(we.$$.fragment,ae),Oo=u(ae),H=s(ae,"P",{});var Ze=i(H);Wo=r(Ze,"The "),Oe=s(Ze,"A",{href:!0});var Ba=i(Oe);Ro=r(Ba,"CvtModel"),Ba.forEach(o),Ho=r(Ze," forward method, overrides the "),nt=s(Ze,"CODE",{});var Ua=i(nt);Bo=r(Ua,"__call__"),Ua.forEach(o),Uo=r(Ze," special method."),Ze.forEach(o),Xo=u(ae),w(G.$$.fragment,ae),Yo=u(ae),w(J.$$.fragment,ae),ae.forEach(o),Ke.forEach(o),xt=u(t),B=s(t,"H2",{class:!0});var Pt=i(B);Q=s(Pt,"A",{id:!0,class:!0,href:!0});var Xa=i(Q);st=s(Xa,"SPAN",{});var Ya=i(st);w($e.$$.fragment,Ya),Ya.forEach(o),Xa.forEach(o),Ko=u(Pt),it=s(Pt,"SPAN",{});var Ka=i(it);Zo=r(Ka,"CvtForImageClassification"),Ka.forEach(o),Pt.forEach(o),Et=u(t),j=s(t,"DIV",{class:!0});var re=i(j);w(Te.$$.fragment,re),Go=u(re),lt=s(re,"P",{});var Za=i(lt);Jo=r(Za,`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.`),Za.forEach(o),Qo=u(re),ye=s(re,"P",{});var qt=i(ye);ea=r(qt,"This model is a PyTorch "),ke=s(qt,"A",{href:!0,rel:!0});var Ga=i(ke);ta=r(Ga,"torch.nn.Module"),Ga.forEach(o),oa=r(qt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qt.forEach(o),aa=u(re),M=s(re,"DIV",{class:!0});var ne=i(M);w(xe.$$.fragment,ne),ra=u(ne),U=s(ne,"P",{});var Ge=i(U);na=r(Ge,"The "),We=s(Ge,"A",{href:!0});var Ja=i(We);sa=r(Ja,"CvtForImageClassification"),Ja.forEach(o),ia=r(Ge," forward method, overrides the "),ct=s(Ge,"CODE",{});var Qa=i(ct);la=r(Qa,"__call__"),Qa.forEach(o),ca=r(Ge," special method."),Ge.forEach(o),da=u(ne),w(ee.$$.fragment,ne),fa=u(ne),w(te.$$.fragment,ne),ne.forEach(o),re.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(mr)),c(m,"id","convolutional-vision-transformer-cvt"),c(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"),c(m,"href","#convolutional-vision-transformer-cvt"),c(g,"class","relative group"),c(X,"id","overview"),c(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"),c(X,"href","#overview"),c(z,"class","relative group"),c(ie,"href","https://arxiv.org/abs/2103.15808"),c(ie,"rel","nofollow"),c(Ie,"href","vit"),c(Pe,"href","vit"),c(ce,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),c(ce,"rel","nofollow"),c(qe,"href","/docs/transformers/pr_17548/en/model_doc/vit#transformers.ViTFeatureExtractor"),c(Ne,"href","/docs/transformers/pr_17548/en/model_doc/auto#transformers.AutoFeatureExtractor"),c(Le,"href","/docs/transformers/pr_17548/en/model_doc/vit#transformers.ViTForImageClassification"),c(Ve,"href","/docs/transformers/pr_17548/en/model_doc/cvt#transformers.CvtForImageClassification"),c(de,"href","http://www.image-net.org/"),c(de,"rel","nofollow"),c(fe,"href","http://www.image-net.org/challenges/LSVRC/2012/"),c(fe,"rel","nofollow"),c(me,"href","https://huggingface.co/anugunj"),c(me,"rel","nofollow"),c(he,"href","https://github.com/microsoft/CvT"),c(he,"rel","nofollow"),c(Y,"id","transformers.CvtConfig"),c(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"),c(Y,"href","#transformers.CvtConfig"),c(D,"class","relative group"),c(ze,"href","/docs/transformers/pr_17548/en/model_doc/cvt#transformers.CvtModel"),c(ge,"href","https://huggingface.co/microsoft/cvt-13"),c(ge,"rel","nofollow"),c(Se,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),c(De,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"id","transformers.CvtModel"),c(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Z,"href","#transformers.CvtModel"),c(R,"class","relative group"),c(be,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(be,"rel","nofollow"),c(Oe,"href","/docs/transformers/pr_17548/en/model_doc/cvt#transformers.CvtModel"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Q,"id","transformers.CvtForImageClassification"),c(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Q,"href","#transformers.CvtForImageClassification"),c(B,"class","relative group"),c(ke,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ke,"rel","nofollow"),c(We,"href","/docs/transformers/pr_17548/en/model_doc/cvt#transformers.CvtForImageClassification"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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,f){e(document.head,d),v(t,C,f),v(t,g,f),e(g,m),e(m,_),$(l,_,null),e(g,h),e(g,P),e(P,Nt),v(t,ut,f),v(t,z,f),e(z,X),e(X,Je),$(se,Je,null),e(z,Lt),e(z,Qe),e(Qe,Vt),v(t,gt,f),v(t,N,f),e(N,zt),e(N,ie),e(ie,St),e(N,Dt),e(N,Ie),e(Ie,Ot),e(N,Wt),v(t,vt,f),v(t,Fe,f),e(Fe,Rt),v(t,_t,f),v(t,Me,f),e(Me,et),e(et,Ht),v(t,Ct,f),v(t,Ae,f),e(Ae,Bt),v(t,bt,f),v(t,L,f),e(L,le),e(le,Ut),e(le,Pe),e(Pe,Xt),e(le,Yt),e(L,Kt),e(L,x),e(x,Zt),e(x,ce),e(ce,Gt),e(x,Jt),e(x,qe),e(qe,Qt),e(x,eo),e(x,Ne),e(Ne,to),e(x,oo),e(x,Le),e(Le,ao),e(x,ro),e(x,Ve),e(Ve,no),e(x,so),e(L,io),e(L,S),e(S,lo),e(S,de),e(de,co),e(S,fo),e(S,fe),e(fe,mo),e(S,ho),v(t,wt,f),v(t,V,f),e(V,po),e(V,me),e(me,uo),e(V,go),e(V,he),e(he,vo),e(V,_o),v(t,$t,f),v(t,D,f),e(D,Y),e(Y,tt),$(pe,tt,null),e(D,Co),e(D,ot),e(ot,bo),v(t,Tt,f),v(t,E,f),$(ue,E,null),e(E,wo),e(E,O),e(O,$o),e(O,ze),e(ze,To),e(O,yo),e(O,ge),e(ge,ko),e(O,xo),e(E,Eo),e(E,W),e(W,jo),e(W,Se),e(Se,Io),e(W,Fo),e(W,De),e(De,Mo),e(W,Ao),e(E,Po),$(K,E,null),v(t,yt,f),v(t,R,f),e(R,Z),e(Z,at),$(ve,at,null),e(R,qo),e(R,rt),e(rt,No),v(t,kt,f),v(t,q,f),$(_e,q,null),e(q,Lo),e(q,Ce),e(Ce,Vo),e(Ce,be),e(be,zo),e(Ce,So),e(q,Do),e(q,F),$(we,F,null),e(F,Oo),e(F,H),e(H,Wo),e(H,Oe),e(Oe,Ro),e(H,Ho),e(H,nt),e(nt,Bo),e(H,Uo),e(F,Xo),$(G,F,null),e(F,Yo),$(J,F,null),v(t,xt,f),v(t,B,f),e(B,Q),e(Q,st),$($e,st,null),e(B,Ko),e(B,it),e(it,Zo),v(t,Et,f),v(t,j,f),$(Te,j,null),e(j,Go),e(j,lt),e(lt,Jo),e(j,Qo),e(j,ye),e(ye,ea),e(ye,ke),e(ke,ta),e(ye,oa),e(j,aa),e(j,M),$(xe,M,null),e(M,ra),e(M,U),e(U,na),e(U,We),e(We,sa),e(U,ia),e(U,ct),e(ct,la),e(U,ca),e(M,da),$(ee,M,null),e(M,fa),$(te,M,null),jt=!0},p(t,[f]){const Ee={};f&2&&(Ee.$$scope={dirty:f,ctx:t}),K.$set(Ee);const dt={};f&2&&(dt.$$scope={dirty:f,ctx:t}),G.$set(dt);const ft={};f&2&&(ft.$$scope={dirty:f,ctx:t}),J.$set(ft);const mt={};f&2&&(mt.$$scope={dirty:f,ctx:t}),ee.$set(mt);const je={};f&2&&(je.$$scope={dirty:f,ctx:t}),te.$set(je)},i(t){jt||(T(l.$$.fragment,t),T(se.$$.fragment,t),T(pe.$$.fragment,t),T(ue.$$.fragment,t),T(K.$$.fragment,t),T(ve.$$.fragment,t),T(_e.$$.fragment,t),T(we.$$.fragment,t),T(G.$$.fragment,t),T(J.$$.fragment,t),T($e.$$.fragment,t),T(Te.$$.fragment,t),T(xe.$$.fragment,t),T(ee.$$.fragment,t),T(te.$$.fragment,t),jt=!0)},o(t){y(l.$$.fragment,t),y(se.$$.fragment,t),y(pe.$$.fragment,t),y(ue.$$.fragment,t),y(K.$$.fragment,t),y(ve.$$.fragment,t),y(_e.$$.fragment,t),y(we.$$.fragment,t),y(G.$$.fragment,t),y(J.$$.fragment,t),y($e.$$.fragment,t),y(Te.$$.fragment,t),y(xe.$$.fragment,t),y(ee.$$.fragment,t),y(te.$$.fragment,t),jt=!1},d(t){o(d),t&&o(C),t&&o(g),k(l),t&&o(ut),t&&o(z),k(se),t&&o(gt),t&&o(N),t&&o(vt),t&&o(Fe),t&&o(_t),t&&o(Me),t&&o(Ct),t&&o(Ae),t&&o(bt),t&&o(L),t&&o(wt),t&&o(V),t&&o($t),t&&o(D),k(pe),t&&o(Tt),t&&o(E),k(ue),k(K),t&&o(yt),t&&o(R),k(ve),t&&o(kt),t&&o(q),k(_e),k(we),k(G),k(J),t&&o(xt),t&&o(B),k($e),t&&o(Et),t&&o(j),k(Te),k(xe),k(ee),k(te)}}}const mr={local:"convolutional-vision-transformer-cvt",sections:[{local:"overview",title:"Overview"},{local:"transformers.CvtConfig",title:"CvtConfig"},{local:"transformers.CvtModel",title:"CvtModel"},{local:"transformers.CvtForImageClassification",title:"CvtForImageClassification"}],title:"Convolutional Vision Transformer (CvT)"};function hr(I){return nr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class br extends tr{constructor(d){super();or(this,d,hr,fr,ar,{})}}export{br as default,mr as metadata};
