import{S as cn,i as fn,s as mn,e as r,k as p,w as $,t as s,M as hn,c as n,d as t,m as u,a as l,x as w,h as a,b as f,G as e,g as v,y as T,q as y,o as k,B as I,v as pn,L as ko}from"../../chunks/vendor-hf-doc-builder.js";import{T as Zt}from"../../chunks/Tip-hf-doc-builder.js";import{D as be}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Io}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as wt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as yo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function un(E){let d,C,h,c,_;return c=new Io({props:{code:`from transformers import CvtConfig, CvtModel

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

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

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

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

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

feature_extractor = AutoImageProcessor.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> 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>feature_extractor = 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 = 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=r("p"),C=s("Example:"),h=p(),$(c.$$.fragment)},l(i){d=n(i,"P",{});var m=l(d);C=a(m,"Example:"),m.forEach(t),h=u(i),w(c.$$.fragment,i)},m(i,m){v(i,d,m),e(d,C),v(i,h,m),T(c,i,m),_=!0},p:ko,i(i){_||(y(c.$$.fragment,i),_=!0)},o(i){k(c.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(h),I(c,i)}}}function bn(E){let d,C,h,c,_,i,m,x,G,V,F,z,M,O,J,A,Q,H;return{c(){d=r("p"),C=s("TF 2.0 models accepts two formats as inputs:"),h=p(),c=r("ul"),_=r("li"),i=s("having all inputs as keyword arguments (like PyTorch models), or"),m=p(),x=r("li"),G=s("having all inputs as a list, tuple or dict in the first positional arguments."),V=p(),F=r("p"),z=s("This second option is useful when using "),M=r("code"),O=s("tf.keras.Model.fit"),J=s(` method which currently requires having all the
tensors in the first argument of the model call function: `),A=r("code"),Q=s("model(inputs)"),H=s(".")},l(b){d=n(b,"P",{});var j=l(d);C=a(j,"TF 2.0 models accepts two formats as inputs:"),j.forEach(t),h=u(b),c=n(b,"UL",{});var q=l(c);_=n(q,"LI",{});var se=l(_);i=a(se,"having all inputs as keyword arguments (like PyTorch models), or"),se.forEach(t),m=u(q),x=n(q,"LI",{});var ae=l(x);G=a(ae,"having all inputs as a list, tuple or dict in the first positional arguments."),ae.forEach(t),q.forEach(t),V=u(b),F=n(b,"P",{});var P=l(F);z=a(P,"This second option is useful when using "),M=n(P,"CODE",{});var re=l(M);O=a(re,"tf.keras.Model.fit"),re.forEach(t),J=a(P,` method which currently requires having all the
tensors in the first argument of the model call function: `),A=n(P,"CODE",{});var ne=l(A);Q=a(ne,"model(inputs)"),ne.forEach(t),H=a(P,"."),P.forEach(t)},m(b,j){v(b,d,j),e(d,C),v(b,h,j),v(b,c,j),e(c,_),e(_,i),e(c,m),e(c,x),e(x,G),v(b,V,j),v(b,F,j),e(F,z),e(F,M),e(M,O),e(F,J),e(F,A),e(A,Q),e(F,H)},d(b){b&&t(d),b&&t(h),b&&t(c),b&&t(V),b&&t(F)}}}function $n(E){let d,C,h,c,_;return{c(){d=r("p"),C=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),c=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var m=l(d);C=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(m,"CODE",{});var x=l(h);c=a(x,"Module"),x.forEach(t),_=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){v(i,d,m),e(d,C),e(d,h),e(h,c),e(d,_)},d(i){i&&t(d)}}}function wn(E){let d,C,h,c,_;return c=new Io({props:{code:`from transformers import AutoImageProcessor, TFCvtModel
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("microsoft/cvt-13")
model = TFCvtModel.from_pretrained("microsoft/cvt-13")

inputs = image_processor(images=image, return_tensors="tf")
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state`,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(){d=r("p"),C=s("Examples:"),h=p(),$(c.$$.fragment)},l(i){d=n(i,"P",{});var m=l(d);C=a(m,"Examples:"),m.forEach(t),h=u(i),w(c.$$.fragment,i)},m(i,m){v(i,d,m),e(d,C),v(i,h,m),T(c,i,m),_=!0},p:ko,i(i){_||(y(c.$$.fragment,i),_=!0)},o(i){k(c.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(h),I(c,i)}}}function Tn(E){let d,C,h,c,_,i,m,x,G,V,F,z,M,O,J,A,Q,H;return{c(){d=r("p"),C=s("TF 2.0 models accepts two formats as inputs:"),h=p(),c=r("ul"),_=r("li"),i=s("having all inputs as keyword arguments (like PyTorch models), or"),m=p(),x=r("li"),G=s("having all inputs as a list, tuple or dict in the first positional arguments."),V=p(),F=r("p"),z=s("This second option is useful when using "),M=r("code"),O=s("tf.keras.Model.fit"),J=s(` method which currently requires having all the
tensors in the first argument of the model call function: `),A=r("code"),Q=s("model(inputs)"),H=s(".")},l(b){d=n(b,"P",{});var j=l(d);C=a(j,"TF 2.0 models accepts two formats as inputs:"),j.forEach(t),h=u(b),c=n(b,"UL",{});var q=l(c);_=n(q,"LI",{});var se=l(_);i=a(se,"having all inputs as keyword arguments (like PyTorch models), or"),se.forEach(t),m=u(q),x=n(q,"LI",{});var ae=l(x);G=a(ae,"having all inputs as a list, tuple or dict in the first positional arguments."),ae.forEach(t),q.forEach(t),V=u(b),F=n(b,"P",{});var P=l(F);z=a(P,"This second option is useful when using "),M=n(P,"CODE",{});var re=l(M);O=a(re,"tf.keras.Model.fit"),re.forEach(t),J=a(P,` method which currently requires having all the
tensors in the first argument of the model call function: `),A=n(P,"CODE",{});var ne=l(A);Q=a(ne,"model(inputs)"),ne.forEach(t),H=a(P,"."),P.forEach(t)},m(b,j){v(b,d,j),e(d,C),v(b,h,j),v(b,c,j),e(c,_),e(_,i),e(c,m),e(c,x),e(x,G),v(b,V,j),v(b,F,j),e(F,z),e(F,M),e(M,O),e(F,J),e(F,A),e(A,Q),e(F,H)},d(b){b&&t(d),b&&t(h),b&&t(c),b&&t(V),b&&t(F)}}}function yn(E){let d,C,h,c,_;return{c(){d=r("p"),C=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r("code"),c=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var m=l(d);C=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=n(m,"CODE",{});var x=l(h);c=a(x,"Module"),x.forEach(t),_=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){v(i,d,m),e(d,C),e(d,h),e(h,c),e(d,_)},d(i){i&&t(d)}}}function kn(E){let d,C,h,c,_;return c=new Io({props:{code:`from transformers import AutoImageProcessor, TFCvtForImageClassification
import tensorflow as tf
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("microsoft/cvt-13")
model = TFCvtForImageClassification.from_pretrained("microsoft/cvt-13")

inputs = image_processor(images=image, return_tensors="tf")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = tf.math.argmax(logits, axis=-1)[0]
print("Predicted class:", model.config.id2label[int(predicted_class_idx)])`,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(){d=r("p"),C=s("Examples:"),h=p(),$(c.$$.fragment)},l(i){d=n(i,"P",{});var m=l(d);C=a(m,"Examples:"),m.forEach(t),h=u(i),w(c.$$.fragment,i)},m(i,m){v(i,d,m),e(d,C),v(i,h,m),T(c,i,m),_=!0},p:ko,i(i){_||(y(c.$$.fragment,i),_=!0)},o(i){k(c.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(h),I(c,i)}}}function In(E){let d,C,h,c,_,i,m,x,G,V,F,z,M,O,J,A,Q,H,b,j,q,se,ae,P,re,ne,Fo,Tt,ts,xo,yt,Gt,os,Eo,kt,ss,jo,te,He,as,It,rs,ns,is,D,ls,Re,ds,cs,Ft,fs,ms,xt,hs,ps,Et,us,gs,jt,vs,_s,Cs,ie,bs,Ue,$s,ws,Be,Ts,ys,Po,oe,ks,Ke,Is,Fs,Xe,xs,Es,Mo,le,$e,Jt,Ye,js,Qt,Ps,Ao,S,Ze,Ms,de,As,Pt,qs,Ns,Ge,Ls,zs,Os,ce,Ds,Mt,Vs,Ss,At,Ws,Hs,Rs,we,qo,fe,Te,eo,Je,Us,to,Bs,No,ee,Qe,Ks,et,Xs,tt,Ys,Zs,Gs,R,ot,Js,me,Qs,qt,ea,ta,oo,oa,sa,aa,ye,ra,ke,Lo,he,Ie,so,st,na,ao,ia,zo,W,at,la,ro,da,ca,rt,fa,nt,ma,ha,pa,U,it,ua,pe,ga,Nt,va,_a,no,Ca,ba,$a,Fe,wa,xe,Oo,ue,Ee,io,lt,Ta,lo,ya,Do,N,dt,ka,co,Ia,Fa,ct,xa,Lt,Ea,ja,Pa,ft,Ma,mt,Aa,qa,Na,je,La,B,ht,za,ge,Oa,zt,Da,Va,fo,Sa,Wa,Ha,Pe,Ra,Me,Vo,ve,Ae,mo,pt,Ua,ho,Ba,So,L,ut,Ka,po,Xa,Ya,gt,Za,Ot,Ga,Ja,Qa,vt,er,_t,tr,or,sr,qe,ar,K,Ct,rr,_e,nr,Dt,ir,lr,uo,dr,cr,fr,Ne,mr,Le,Wo;return i=new wt({}),O=new wt({}),Ye=new wt({}),Ze=new be({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.25.1/src/transformers/models/cvt/configuration_cvt.py#L29"}}),we=new yo({props:{anchor:"transformers.CvtConfig.example",$$slots:{default:[un]},$$scope:{ctx:E}}}),Je=new wt({}),Qe=new be({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.25.1/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.25.1/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.25.1/src/transformers/models/cvt/modeling_cvt.py#L590"}}),ot=new be({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 <code>CvtImageProcessor</code>. 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.25.1/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.25.1/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.25.1/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>
`}}),ye=new Zt({props:{$$slots:{default:[gn]},$$scope:{ctx:E}}}),ke=new yo({props:{anchor:"transformers.CvtModel.forward.example",$$slots:{default:[vn]},$$scope:{ctx:E}}}),st=new wt({}),at=new be({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.25.1/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.25.1/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.25.1/src/transformers/models/cvt/modeling_cvt.py#L653"}}),it=new be({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 <code>CvtImageProcessor</code>. 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.25.1/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.25.1/src/transformers/models/cvt/modeling_cvt.py#L668",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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.25.1/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new Zt({props:{$$slots:{default:[_n]},$$scope:{ctx:E}}}),xe=new yo({props:{anchor:"transformers.CvtForImageClassification.forward.example",$$slots:{default:[Cn]},$$scope:{ctx:E}}}),lt=new wt({}),dt=new be({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.25.1/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.25.1/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.25.1/src/transformers/models/cvt/modeling_tf_cvt.py#L789"}}),je=new Zt({props:{$$slots:{default:[bn]},$$scope:{ctx:E}}}),ht=new be({props:{name:"call",anchor:"transformers.TFCvtModel.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__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.25.1/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.25.1/src/transformers/models/cvt/modeling_tf_cvt.py#L795",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.25.1/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</li>
<li><strong>cls_token_value</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 1, hidden_size)</code>) \u2014 Classification token at the output of the last layer of the model.</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.models.cvt.modeling_tf_cvt.TFBaseModelOutputWithCLSToken</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Pe=new Zt({props:{$$slots:{default:[$n]},$$scope:{ctx:E}}}),Me=new yo({props:{anchor:"transformers.TFCvtModel.call.example",$$slots:{default:[wn]},$$scope:{ctx:E}}}),pt=new wt({}),ut=new be({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.25.1/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.25.1/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.25.1/src/transformers/models/cvt/modeling_tf_cvt.py#L860"}}),qe=new Zt({props:{$$slots:{default:[Tn]},$$scope:{ctx:E}}}),Ct=new be({props:{name:"call",anchor:"transformers.TFCvtForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__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.25.1/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.25.1/src/transformers/models/cvt/modeling_tf_cvt.py#L878",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.25.1/en/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ne=new Zt({props:{$$slots:{default:[yn]},$$scope:{ctx:E}}}),Le=new yo({props:{anchor:"transformers.TFCvtForImageClassification.call.example",$$slots:{default:[kn]},$$scope:{ctx:E}}}),{c(){d=r("meta"),C=p(),h=r("h1"),c=r("a"),_=r("span"),$(i.$$.fragment),m=p(),x=r("span"),G=s("Convolutional Vision Transformer (CvT)"),V=p(),F=r("h2"),z=r("a"),M=r("span"),$(O.$$.fragment),J=p(),A=r("span"),Q=s("Overview"),H=p(),b=r("p"),j=s("The CvT model was proposed in "),q=r("a"),se=s("CvT: Introducing Convolutions to Vision Transformers"),ae=s(" by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the "),P=r("a"),re=s("Vision Transformer (ViT)"),ne=s(" in performance and efficiency by introducing convolutions into ViT to yield the best of both designs."),Fo=p(),Tt=r("p"),ts=s("The abstract from the paper is the following:"),xo=p(),yt=r("p"),Gt=r("em"),os=s(`We present in this paper a new architecture, named Convolutional vision Transformer (CvT), that improves Vision Transformer (ViT)
in performance and efficiency by introducing convolutions into ViT to yield the best of both designs. This is accomplished through
two primary modifications: a hierarchy of Transformers containing a new convolutional token embedding, and a convolutional Transformer
block leveraging a convolutional projection. These changes introduce desirable properties of convolutional neural networks (CNNs)
to the ViT architecture (\\ie shift, scale, and distortion invariance) while maintaining the merits of Transformers (\\ie dynamic attention,
global context, and better generalization). We validate CvT by conducting extensive experiments, showing that this approach achieves
state-of-the-art performance over other Vision Transformers and ResNets on ImageNet-1k, with fewer parameters and lower FLOPs. In addition,
performance gains are maintained when pretrained on larger datasets (\\eg ImageNet-22k) and fine-tuned to downstream tasks. Pre-trained on
ImageNet-22k, our CvT-W24 obtains a top-1 accuracy of 87.7\\% on the ImageNet-1k val set. Finally, our results show that the positional encoding,
a crucial component in existing Vision Transformers, can be safely removed in our model, simplifying the design for higher resolution vision tasks.`),Eo=p(),kt=r("p"),ss=s("Tips:"),jo=p(),te=r("ul"),He=r("li"),as=s("CvT models are regular Vision Transformers, but trained with convolutions. They outperform the "),It=r("a"),rs=s("original model (ViT)"),ns=s(" when fine-tuned on ImageNet-1K and CIFAR-100."),is=p(),D=r("li"),ls=s("You can check out demo notebooks regarding inference as well as fine-tuning on custom data "),Re=r("a"),ds=s("here"),cs=s(" (you can just replace "),Ft=r("a"),fs=s("ViTFeatureExtractor"),ms=s(" by "),xt=r("a"),hs=s("AutoImageProcessor"),ps=s(" and "),Et=r("a"),us=s("ViTForImageClassification"),gs=s(" by "),jt=r("a"),vs=s("CvtForImageClassification"),_s=s(")."),Cs=p(),ie=r("li"),bs=s("The available checkpoints are either (1) pre-trained on "),Ue=r("a"),$s=s("ImageNet-22k"),ws=s(" (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on "),Be=r("a"),Ts=s("ImageNet-1k"),ys=s(` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Po=p(),oe=r("p"),ks=s("This model was contributed by "),Ke=r("a"),Is=s("anugunj"),Fs=s(". The original code can be found "),Xe=r("a"),xs=s("here"),Es=s("."),Mo=p(),le=r("h2"),$e=r("a"),Jt=r("span"),$(Ye.$$.fragment),js=p(),Qt=r("span"),Ps=s("CvtConfig"),Ao=p(),S=r("div"),$(Ze.$$.fragment),Ms=p(),de=r("p"),As=s("This is the configuration class to store the configuration of a "),Pt=r("a"),qs=s("CvtModel"),Ns=s(`. It is used to instantiate a CvT model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the CvT
`),Ge=r("a"),Ls=s("microsoft/cvt-13"),zs=s(" architecture."),Os=p(),ce=r("p"),Ds=s("Configuration objects inherit from "),Mt=r("a"),Vs=s("PretrainedConfig"),Ss=s(` and can be used to control the model outputs. Read the
documentation from `),At=r("a"),Ws=s("PretrainedConfig"),Hs=s(" for more information."),Rs=p(),$(we.$$.fragment),qo=p(),fe=r("h2"),Te=r("a"),eo=r("span"),$(Je.$$.fragment),Us=p(),to=r("span"),Bs=s("CvtModel"),No=p(),ee=r("div"),$(Qe.$$.fragment),Ks=p(),et=r("p"),Xs=s(`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),tt=r("a"),Ys=s("torch.nn.Module"),Zs=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gs=p(),R=r("div"),$(ot.$$.fragment),Js=p(),me=r("p"),Qs=s("The "),qt=r("a"),ea=s("CvtModel"),ta=s(" forward method, overrides the "),oo=r("code"),oa=s("__call__"),sa=s(" special method."),aa=p(),$(ye.$$.fragment),ra=p(),$(ke.$$.fragment),Lo=p(),he=r("h2"),Ie=r("a"),so=r("span"),$(st.$$.fragment),na=p(),ao=r("span"),ia=s("CvtForImageClassification"),zo=p(),W=r("div"),$(at.$$.fragment),la=p(),ro=r("p"),da=s(`Cvt Model transformer with an image classification head on top (a linear layer on top of the final hidden state of
the [CLS] token) e.g. for ImageNet.`),ca=p(),rt=r("p"),fa=s("This model is a PyTorch "),nt=r("a"),ma=s("torch.nn.Module"),ha=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pa=p(),U=r("div"),$(it.$$.fragment),ua=p(),pe=r("p"),ga=s("The "),Nt=r("a"),va=s("CvtForImageClassification"),_a=s(" forward method, overrides the "),no=r("code"),Ca=s("__call__"),ba=s(" special method."),$a=p(),$(Fe.$$.fragment),wa=p(),$(xe.$$.fragment),Oo=p(),ue=r("h2"),Ee=r("a"),io=r("span"),$(lt.$$.fragment),Ta=p(),lo=r("span"),ya=s("TFCvtModel"),Do=p(),N=r("div"),$(dt.$$.fragment),ka=p(),co=r("p"),Ia=s("The bare Cvt Model transformer outputting raw hidden-states without any specific head on top."),Fa=p(),ct=r("p"),xa=s("This model inherits from "),Lt=r("a"),Ea=s("TFPreTrainedModel"),ja=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pa=p(),ft=r("p"),Ma=s("This model is also a "),mt=r("a"),Aa=s("tf.keras.Model"),qa=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Na=p(),$(je.$$.fragment),La=p(),B=r("div"),$(ht.$$.fragment),za=p(),ge=r("p"),Oa=s("The "),zt=r("a"),Da=s("TFCvtModel"),Va=s(" forward method, overrides the "),fo=r("code"),Sa=s("__call__"),Wa=s(" special method."),Ha=p(),$(Pe.$$.fragment),Ra=p(),$(Me.$$.fragment),Vo=p(),ve=r("h2"),Ae=r("a"),mo=r("span"),$(pt.$$.fragment),Ua=p(),ho=r("span"),Ba=s("TFCvtForImageClassification"),So=p(),L=r("div"),$(ut.$$.fragment),Ka=p(),po=r("p"),Xa=s(`Cvt Model transformer with an image classification head on top (a linear layer on top of the final hidden state of
the [CLS] token) e.g. for ImageNet.`),Ya=p(),gt=r("p"),Za=s("This model inherits from "),Ot=r("a"),Ga=s("TFPreTrainedModel"),Ja=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qa=p(),vt=r("p"),er=s("This model is also a "),_t=r("a"),tr=s("tf.keras.Model"),or=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),sr=p(),$(qe.$$.fragment),ar=p(),K=r("div"),$(Ct.$$.fragment),rr=p(),_e=r("p"),nr=s("The "),Dt=r("a"),ir=s("TFCvtForImageClassification"),lr=s(" forward method, overrides the "),uo=r("code"),dr=s("__call__"),cr=s(" special method."),fr=p(),$(Ne.$$.fragment),mr=p(),$(Le.$$.fragment),this.h()},l(o){const g=hn('[data-svelte="svelte-1phssyn"]',document.head);d=n(g,"META",{name:!0,content:!0}),g.forEach(t),C=u(o),h=n(o,"H1",{class:!0});var bt=l(h);c=n(bt,"A",{id:!0,class:!0,href:!0});var go=l(c);_=n(go,"SPAN",{});var vo=l(_);w(i.$$.fragment,vo),vo.forEach(t),go.forEach(t),m=u(bt),x=n(bt,"SPAN",{});var _o=l(x);G=a(_o,"Convolutional Vision Transformer (CvT)"),_o.forEach(t),bt.forEach(t),V=u(o),F=n(o,"H2",{class:!0});var $t=l(F);z=n($t,"A",{id:!0,class:!0,href:!0});var Co=l(z);M=n(Co,"SPAN",{});var bo=l(M);w(O.$$.fragment,bo),bo.forEach(t),Co.forEach(t),J=u($t),A=n($t,"SPAN",{});var $o=l(A);Q=a($o,"Overview"),$o.forEach(t),$t.forEach(t),H=u(o),b=n(o,"P",{});var Ce=l(b);j=a(Ce,"The CvT model was proposed in "),q=n(Ce,"A",{href:!0,rel:!0});var wo=l(q);se=a(wo,"CvT: Introducing Convolutions to Vision Transformers"),wo.forEach(t),ae=a(Ce," by Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. The Convolutional vision Transformer (CvT) improves the "),P=n(Ce,"A",{href:!0});var To=l(P);re=a(To,"Vision Transformer (ViT)"),To.forEach(t),ne=a(Ce," in performance and efficiency by introducing convolutions into ViT to yield the best of both designs."),Ce.forEach(t),Fo=u(o),Tt=n(o,"P",{});var hr=l(Tt);ts=a(hr,"The abstract from the paper is the following:"),hr.forEach(t),xo=u(o),yt=n(o,"P",{});var pr=l(yt);Gt=n(pr,"EM",{});var ur=l(Gt);os=a(ur,`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.`),ur.forEach(t),pr.forEach(t),Eo=u(o),kt=n(o,"P",{});var gr=l(kt);ss=a(gr,"Tips:"),gr.forEach(t),jo=u(o),te=n(o,"UL",{});var Vt=l(te);He=n(Vt,"LI",{});var Ho=l(He);as=a(Ho,"CvT models are regular Vision Transformers, but trained with convolutions. They outperform the "),It=n(Ho,"A",{href:!0});var vr=l(It);rs=a(vr,"original model (ViT)"),vr.forEach(t),ns=a(Ho," when fine-tuned on ImageNet-1K and CIFAR-100."),Ho.forEach(t),is=u(Vt),D=n(Vt,"LI",{});var X=l(D);ls=a(X,"You can check out demo notebooks regarding inference as well as fine-tuning on custom data "),Re=n(X,"A",{href:!0,rel:!0});var _r=l(Re);ds=a(_r,"here"),_r.forEach(t),cs=a(X," (you can just replace "),Ft=n(X,"A",{href:!0});var Cr=l(Ft);fs=a(Cr,"ViTFeatureExtractor"),Cr.forEach(t),ms=a(X," by "),xt=n(X,"A",{href:!0});var br=l(xt);hs=a(br,"AutoImageProcessor"),br.forEach(t),ps=a(X," and "),Et=n(X,"A",{href:!0});var $r=l(Et);us=a($r,"ViTForImageClassification"),$r.forEach(t),gs=a(X," by "),jt=n(X,"A",{href:!0});var wr=l(jt);vs=a(wr,"CvtForImageClassification"),wr.forEach(t),_s=a(X,")."),X.forEach(t),Cs=u(Vt),ie=n(Vt,"LI",{});var St=l(ie);bs=a(St,"The available checkpoints are either (1) pre-trained on "),Ue=n(St,"A",{href:!0,rel:!0});var Tr=l(Ue);$s=a(Tr,"ImageNet-22k"),Tr.forEach(t),ws=a(St," (a collection of 14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on "),Be=n(St,"A",{href:!0,rel:!0});var yr=l(Be);Ts=a(yr,"ImageNet-1k"),yr.forEach(t),ys=a(St,` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),St.forEach(t),Vt.forEach(t),Po=u(o),oe=n(o,"P",{});var Wt=l(oe);ks=a(Wt,"This model was contributed by "),Ke=n(Wt,"A",{href:!0,rel:!0});var kr=l(Ke);Is=a(kr,"anugunj"),kr.forEach(t),Fs=a(Wt,". The original code can be found "),Xe=n(Wt,"A",{href:!0,rel:!0});var Ir=l(Xe);xs=a(Ir,"here"),Ir.forEach(t),Es=a(Wt,"."),Wt.forEach(t),Mo=u(o),le=n(o,"H2",{class:!0});var Ro=l(le);$e=n(Ro,"A",{id:!0,class:!0,href:!0});var Fr=l($e);Jt=n(Fr,"SPAN",{});var xr=l(Jt);w(Ye.$$.fragment,xr),xr.forEach(t),Fr.forEach(t),js=u(Ro),Qt=n(Ro,"SPAN",{});var Er=l(Qt);Ps=a(Er,"CvtConfig"),Er.forEach(t),Ro.forEach(t),Ao=u(o),S=n(o,"DIV",{class:!0});var ze=l(S);w(Ze.$$.fragment,ze),Ms=u(ze),de=n(ze,"P",{});var Ht=l(de);As=a(Ht,"This is the configuration class to store the configuration of a "),Pt=n(Ht,"A",{href:!0});var jr=l(Pt);qs=a(jr,"CvtModel"),jr.forEach(t),Ns=a(Ht,`. 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(Ht,"A",{href:!0,rel:!0});var Pr=l(Ge);Ls=a(Pr,"microsoft/cvt-13"),Pr.forEach(t),zs=a(Ht," architecture."),Ht.forEach(t),Os=u(ze),ce=n(ze,"P",{});var Rt=l(ce);Ds=a(Rt,"Configuration objects inherit from "),Mt=n(Rt,"A",{href:!0});var Mr=l(Mt);Vs=a(Mr,"PretrainedConfig"),Mr.forEach(t),Ss=a(Rt,` and can be used to control the model outputs. Read the
documentation from `),At=n(Rt,"A",{href:!0});var Ar=l(At);Ws=a(Ar,"PretrainedConfig"),Ar.forEach(t),Hs=a(Rt," for more information."),Rt.forEach(t),Rs=u(ze),w(we.$$.fragment,ze),ze.forEach(t),qo=u(o),fe=n(o,"H2",{class:!0});var Uo=l(fe);Te=n(Uo,"A",{id:!0,class:!0,href:!0});var qr=l(Te);eo=n(qr,"SPAN",{});var Nr=l(eo);w(Je.$$.fragment,Nr),Nr.forEach(t),qr.forEach(t),Us=u(Uo),to=n(Uo,"SPAN",{});var Lr=l(to);Bs=a(Lr,"CvtModel"),Lr.forEach(t),Uo.forEach(t),No=u(o),ee=n(o,"DIV",{class:!0});var Ut=l(ee);w(Qe.$$.fragment,Ut),Ks=u(Ut),et=n(Ut,"P",{});var Bo=l(et);Xs=a(Bo,`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),tt=n(Bo,"A",{href:!0,rel:!0});var zr=l(tt);Ys=a(zr,"torch.nn.Module"),zr.forEach(t),Zs=a(Bo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bo.forEach(t),Gs=u(Ut),R=n(Ut,"DIV",{class:!0});var Oe=l(R);w(ot.$$.fragment,Oe),Js=u(Oe),me=n(Oe,"P",{});var Bt=l(me);Qs=a(Bt,"The "),qt=n(Bt,"A",{href:!0});var Or=l(qt);ea=a(Or,"CvtModel"),Or.forEach(t),ta=a(Bt," forward method, overrides the "),oo=n(Bt,"CODE",{});var Dr=l(oo);oa=a(Dr,"__call__"),Dr.forEach(t),sa=a(Bt," special method."),Bt.forEach(t),aa=u(Oe),w(ye.$$.fragment,Oe),ra=u(Oe),w(ke.$$.fragment,Oe),Oe.forEach(t),Ut.forEach(t),Lo=u(o),he=n(o,"H2",{class:!0});var Ko=l(he);Ie=n(Ko,"A",{id:!0,class:!0,href:!0});var Vr=l(Ie);so=n(Vr,"SPAN",{});var Sr=l(so);w(st.$$.fragment,Sr),Sr.forEach(t),Vr.forEach(t),na=u(Ko),ao=n(Ko,"SPAN",{});var Wr=l(ao);ia=a(Wr,"CvtForImageClassification"),Wr.forEach(t),Ko.forEach(t),zo=u(o),W=n(o,"DIV",{class:!0});var De=l(W);w(at.$$.fragment,De),la=u(De),ro=n(De,"P",{});var Hr=l(ro);da=a(Hr,`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.`),Hr.forEach(t),ca=u(De),rt=n(De,"P",{});var Xo=l(rt);fa=a(Xo,"This model is a PyTorch "),nt=n(Xo,"A",{href:!0,rel:!0});var Rr=l(nt);ma=a(Rr,"torch.nn.Module"),Rr.forEach(t),ha=a(Xo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xo.forEach(t),pa=u(De),U=n(De,"DIV",{class:!0});var Ve=l(U);w(it.$$.fragment,Ve),ua=u(Ve),pe=n(Ve,"P",{});var Kt=l(pe);ga=a(Kt,"The "),Nt=n(Kt,"A",{href:!0});var Ur=l(Nt);va=a(Ur,"CvtForImageClassification"),Ur.forEach(t),_a=a(Kt," forward method, overrides the "),no=n(Kt,"CODE",{});var Br=l(no);Ca=a(Br,"__call__"),Br.forEach(t),ba=a(Kt," special method."),Kt.forEach(t),$a=u(Ve),w(Fe.$$.fragment,Ve),wa=u(Ve),w(xe.$$.fragment,Ve),Ve.forEach(t),De.forEach(t),Oo=u(o),ue=n(o,"H2",{class:!0});var Yo=l(ue);Ee=n(Yo,"A",{id:!0,class:!0,href:!0});var Kr=l(Ee);io=n(Kr,"SPAN",{});var Xr=l(io);w(lt.$$.fragment,Xr),Xr.forEach(t),Kr.forEach(t),Ta=u(Yo),lo=n(Yo,"SPAN",{});var Yr=l(lo);ya=a(Yr,"TFCvtModel"),Yr.forEach(t),Yo.forEach(t),Do=u(o),N=n(o,"DIV",{class:!0});var Y=l(N);w(dt.$$.fragment,Y),ka=u(Y),co=n(Y,"P",{});var Zr=l(co);Ia=a(Zr,"The bare Cvt Model transformer outputting raw hidden-states without any specific head on top."),Zr.forEach(t),Fa=u(Y),ct=n(Y,"P",{});var Zo=l(ct);xa=a(Zo,"This model inherits from "),Lt=n(Zo,"A",{href:!0});var Gr=l(Lt);Ea=a(Gr,"TFPreTrainedModel"),Gr.forEach(t),ja=a(Zo,`. 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.)`),Zo.forEach(t),Pa=u(Y),ft=n(Y,"P",{});var Go=l(ft);Ma=a(Go,"This model is also a "),mt=n(Go,"A",{href:!0,rel:!0});var Jr=l(mt);Aa=a(Jr,"tf.keras.Model"),Jr.forEach(t),qa=a(Go,` 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.`),Go.forEach(t),Na=u(Y),w(je.$$.fragment,Y),La=u(Y),B=n(Y,"DIV",{class:!0});var Se=l(B);w(ht.$$.fragment,Se),za=u(Se),ge=n(Se,"P",{});var Xt=l(ge);Oa=a(Xt,"The "),zt=n(Xt,"A",{href:!0});var Qr=l(zt);Da=a(Qr,"TFCvtModel"),Qr.forEach(t),Va=a(Xt," forward method, overrides the "),fo=n(Xt,"CODE",{});var en=l(fo);Sa=a(en,"__call__"),en.forEach(t),Wa=a(Xt," special method."),Xt.forEach(t),Ha=u(Se),w(Pe.$$.fragment,Se),Ra=u(Se),w(Me.$$.fragment,Se),Se.forEach(t),Y.forEach(t),Vo=u(o),ve=n(o,"H2",{class:!0});var Jo=l(ve);Ae=n(Jo,"A",{id:!0,class:!0,href:!0});var tn=l(Ae);mo=n(tn,"SPAN",{});var on=l(mo);w(pt.$$.fragment,on),on.forEach(t),tn.forEach(t),Ua=u(Jo),ho=n(Jo,"SPAN",{});var sn=l(ho);Ba=a(sn,"TFCvtForImageClassification"),sn.forEach(t),Jo.forEach(t),So=u(o),L=n(o,"DIV",{class:!0});var Z=l(L);w(ut.$$.fragment,Z),Ka=u(Z),po=n(Z,"P",{});var an=l(po);Xa=a(an,`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.`),an.forEach(t),Ya=u(Z),gt=n(Z,"P",{});var Qo=l(gt);Za=a(Qo,"This model inherits from "),Ot=n(Qo,"A",{href:!0});var rn=l(Ot);Ga=a(rn,"TFPreTrainedModel"),rn.forEach(t),Ja=a(Qo,`. 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.)`),Qo.forEach(t),Qa=u(Z),vt=n(Z,"P",{});var es=l(vt);er=a(es,"This model is also a "),_t=n(es,"A",{href:!0,rel:!0});var nn=l(_t);tr=a(nn,"tf.keras.Model"),nn.forEach(t),or=a(es,` 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.`),es.forEach(t),sr=u(Z),w(qe.$$.fragment,Z),ar=u(Z),K=n(Z,"DIV",{class:!0});var We=l(K);w(Ct.$$.fragment,We),rr=u(We),_e=n(We,"P",{});var Yt=l(_e);nr=a(Yt,"The "),Dt=n(Yt,"A",{href:!0});var ln=l(Dt);ir=a(ln,"TFCvtForImageClassification"),ln.forEach(t),lr=a(Yt," forward method, overrides the "),uo=n(Yt,"CODE",{});var dn=l(uo);dr=a(dn,"__call__"),dn.forEach(t),cr=a(Yt," special method."),Yt.forEach(t),fr=u(We),w(Ne.$$.fragment,We),mr=u(We),w(Le.$$.fragment,We),We.forEach(t),Z.forEach(t),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(Fn)),f(c,"id","convolutional-vision-transformer-cvt"),f(c,"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(c,"href","#convolutional-vision-transformer-cvt"),f(h,"class","relative group"),f(z,"id","overview"),f(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"),f(z,"href","#overview"),f(F,"class","relative group"),f(q,"href","https://arxiv.org/abs/2103.15808"),f(q,"rel","nofollow"),f(P,"href","vit"),f(It,"href","vit"),f(Re,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),f(Re,"rel","nofollow"),f(Ft,"href","/docs/transformers/v4.25.1/en/model_doc/vit#transformers.ViTImageProcessor"),f(xt,"href","/docs/transformers/v4.25.1/en/model_doc/auto#transformers.AutoImageProcessor"),f(Et,"href","/docs/transformers/v4.25.1/en/model_doc/vit#transformers.ViTForImageClassification"),f(jt,"href","/docs/transformers/v4.25.1/en/model_doc/cvt#transformers.CvtForImageClassification"),f(Ue,"href","http://www.image-net.org/"),f(Ue,"rel","nofollow"),f(Be,"href","http://www.image-net.org/challenges/LSVRC/2012/"),f(Be,"rel","nofollow"),f(Ke,"href","https://huggingface.co/anugunj"),f(Ke,"rel","nofollow"),f(Xe,"href","https://github.com/microsoft/CvT"),f(Xe,"rel","nofollow"),f($e,"id","transformers.CvtConfig"),f($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f($e,"href","#transformers.CvtConfig"),f(le,"class","relative group"),f(Pt,"href","/docs/transformers/v4.25.1/en/model_doc/cvt#transformers.CvtModel"),f(Ge,"href","https://huggingface.co/microsoft/cvt-13"),f(Ge,"rel","nofollow"),f(Mt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(At,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Te,"id","transformers.CvtModel"),f(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Te,"href","#transformers.CvtModel"),f(fe,"class","relative group"),f(tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(tt,"rel","nofollow"),f(qt,"href","/docs/transformers/v4.25.1/en/model_doc/cvt#transformers.CvtModel"),f(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ie,"id","transformers.CvtForImageClassification"),f(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ie,"href","#transformers.CvtForImageClassification"),f(he,"class","relative group"),f(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(nt,"rel","nofollow"),f(Nt,"href","/docs/transformers/v4.25.1/en/model_doc/cvt#transformers.CvtForImageClassification"),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(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(Ee,"id","transformers.TFCvtModel"),f(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ee,"href","#transformers.TFCvtModel"),f(ue,"class","relative group"),f(Lt,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),f(mt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(mt,"rel","nofollow"),f(zt,"href","/docs/transformers/v4.25.1/en/model_doc/cvt#transformers.TFCvtModel"),f(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Ae,"id","transformers.TFCvtForImageClassification"),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.TFCvtForImageClassification"),f(ve,"class","relative group"),f(Ot,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),f(_t,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(_t,"rel","nofollow"),f(Dt,"href","/docs/transformers/v4.25.1/en/model_doc/cvt#transformers.TFCvtForImageClassification"),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(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,d),v(o,C,g),v(o,h,g),e(h,c),e(c,_),T(i,_,null),e(h,m),e(h,x),e(x,G),v(o,V,g),v(o,F,g),e(F,z),e(z,M),T(O,M,null),e(F,J),e(F,A),e(A,Q),v(o,H,g),v(o,b,g),e(b,j),e(b,q),e(q,se),e(b,ae),e(b,P),e(P,re),e(b,ne),v(o,Fo,g),v(o,Tt,g),e(Tt,ts),v(o,xo,g),v(o,yt,g),e(yt,Gt),e(Gt,os),v(o,Eo,g),v(o,kt,g),e(kt,ss),v(o,jo,g),v(o,te,g),e(te,He),e(He,as),e(He,It),e(It,rs),e(He,ns),e(te,is),e(te,D),e(D,ls),e(D,Re),e(Re,ds),e(D,cs),e(D,Ft),e(Ft,fs),e(D,ms),e(D,xt),e(xt,hs),e(D,ps),e(D,Et),e(Et,us),e(D,gs),e(D,jt),e(jt,vs),e(D,_s),e(te,Cs),e(te,ie),e(ie,bs),e(ie,Ue),e(Ue,$s),e(ie,ws),e(ie,Be),e(Be,Ts),e(ie,ys),v(o,Po,g),v(o,oe,g),e(oe,ks),e(oe,Ke),e(Ke,Is),e(oe,Fs),e(oe,Xe),e(Xe,xs),e(oe,Es),v(o,Mo,g),v(o,le,g),e(le,$e),e($e,Jt),T(Ye,Jt,null),e(le,js),e(le,Qt),e(Qt,Ps),v(o,Ao,g),v(o,S,g),T(Ze,S,null),e(S,Ms),e(S,de),e(de,As),e(de,Pt),e(Pt,qs),e(de,Ns),e(de,Ge),e(Ge,Ls),e(de,zs),e(S,Os),e(S,ce),e(ce,Ds),e(ce,Mt),e(Mt,Vs),e(ce,Ss),e(ce,At),e(At,Ws),e(ce,Hs),e(S,Rs),T(we,S,null),v(o,qo,g),v(o,fe,g),e(fe,Te),e(Te,eo),T(Je,eo,null),e(fe,Us),e(fe,to),e(to,Bs),v(o,No,g),v(o,ee,g),T(Qe,ee,null),e(ee,Ks),e(ee,et),e(et,Xs),e(et,tt),e(tt,Ys),e(et,Zs),e(ee,Gs),e(ee,R),T(ot,R,null),e(R,Js),e(R,me),e(me,Qs),e(me,qt),e(qt,ea),e(me,ta),e(me,oo),e(oo,oa),e(me,sa),e(R,aa),T(ye,R,null),e(R,ra),T(ke,R,null),v(o,Lo,g),v(o,he,g),e(he,Ie),e(Ie,so),T(st,so,null),e(he,na),e(he,ao),e(ao,ia),v(o,zo,g),v(o,W,g),T(at,W,null),e(W,la),e(W,ro),e(ro,da),e(W,ca),e(W,rt),e(rt,fa),e(rt,nt),e(nt,ma),e(rt,ha),e(W,pa),e(W,U),T(it,U,null),e(U,ua),e(U,pe),e(pe,ga),e(pe,Nt),e(Nt,va),e(pe,_a),e(pe,no),e(no,Ca),e(pe,ba),e(U,$a),T(Fe,U,null),e(U,wa),T(xe,U,null),v(o,Oo,g),v(o,ue,g),e(ue,Ee),e(Ee,io),T(lt,io,null),e(ue,Ta),e(ue,lo),e(lo,ya),v(o,Do,g),v(o,N,g),T(dt,N,null),e(N,ka),e(N,co),e(co,Ia),e(N,Fa),e(N,ct),e(ct,xa),e(ct,Lt),e(Lt,Ea),e(ct,ja),e(N,Pa),e(N,ft),e(ft,Ma),e(ft,mt),e(mt,Aa),e(ft,qa),e(N,Na),T(je,N,null),e(N,La),e(N,B),T(ht,B,null),e(B,za),e(B,ge),e(ge,Oa),e(ge,zt),e(zt,Da),e(ge,Va),e(ge,fo),e(fo,Sa),e(ge,Wa),e(B,Ha),T(Pe,B,null),e(B,Ra),T(Me,B,null),v(o,Vo,g),v(o,ve,g),e(ve,Ae),e(Ae,mo),T(pt,mo,null),e(ve,Ua),e(ve,ho),e(ho,Ba),v(o,So,g),v(o,L,g),T(ut,L,null),e(L,Ka),e(L,po),e(po,Xa),e(L,Ya),e(L,gt),e(gt,Za),e(gt,Ot),e(Ot,Ga),e(gt,Ja),e(L,Qa),e(L,vt),e(vt,er),e(vt,_t),e(_t,tr),e(vt,or),e(L,sr),T(qe,L,null),e(L,ar),e(L,K),T(Ct,K,null),e(K,rr),e(K,_e),e(_e,nr),e(_e,Dt),e(Dt,ir),e(_e,lr),e(_e,uo),e(uo,dr),e(_e,cr),e(K,fr),T(Ne,K,null),e(K,mr),T(Le,K,null),Wo=!0},p(o,[g]){const bt={};g&2&&(bt.$$scope={dirty:g,ctx:o}),we.$set(bt);const go={};g&2&&(go.$$scope={dirty:g,ctx:o}),ye.$set(go);const vo={};g&2&&(vo.$$scope={dirty:g,ctx:o}),ke.$set(vo);const _o={};g&2&&(_o.$$scope={dirty:g,ctx:o}),Fe.$set(_o);const $t={};g&2&&($t.$$scope={dirty:g,ctx:o}),xe.$set($t);const Co={};g&2&&(Co.$$scope={dirty:g,ctx:o}),je.$set(Co);const bo={};g&2&&(bo.$$scope={dirty:g,ctx:o}),Pe.$set(bo);const $o={};g&2&&($o.$$scope={dirty:g,ctx:o}),Me.$set($o);const Ce={};g&2&&(Ce.$$scope={dirty:g,ctx:o}),qe.$set(Ce);const wo={};g&2&&(wo.$$scope={dirty:g,ctx:o}),Ne.$set(wo);const To={};g&2&&(To.$$scope={dirty:g,ctx:o}),Le.$set(To)},i(o){Wo||(y(i.$$.fragment,o),y(O.$$.fragment,o),y(Ye.$$.fragment,o),y(Ze.$$.fragment,o),y(we.$$.fragment,o),y(Je.$$.fragment,o),y(Qe.$$.fragment,o),y(ot.$$.fragment,o),y(ye.$$.fragment,o),y(ke.$$.fragment,o),y(st.$$.fragment,o),y(at.$$.fragment,o),y(it.$$.fragment,o),y(Fe.$$.fragment,o),y(xe.$$.fragment,o),y(lt.$$.fragment,o),y(dt.$$.fragment,o),y(je.$$.fragment,o),y(ht.$$.fragment,o),y(Pe.$$.fragment,o),y(Me.$$.fragment,o),y(pt.$$.fragment,o),y(ut.$$.fragment,o),y(qe.$$.fragment,o),y(Ct.$$.fragment,o),y(Ne.$$.fragment,o),y(Le.$$.fragment,o),Wo=!0)},o(o){k(i.$$.fragment,o),k(O.$$.fragment,o),k(Ye.$$.fragment,o),k(Ze.$$.fragment,o),k(we.$$.fragment,o),k(Je.$$.fragment,o),k(Qe.$$.fragment,o),k(ot.$$.fragment,o),k(ye.$$.fragment,o),k(ke.$$.fragment,o),k(st.$$.fragment,o),k(at.$$.fragment,o),k(it.$$.fragment,o),k(Fe.$$.fragment,o),k(xe.$$.fragment,o),k(lt.$$.fragment,o),k(dt.$$.fragment,o),k(je.$$.fragment,o),k(ht.$$.fragment,o),k(Pe.$$.fragment,o),k(Me.$$.fragment,o),k(pt.$$.fragment,o),k(ut.$$.fragment,o),k(qe.$$.fragment,o),k(Ct.$$.fragment,o),k(Ne.$$.fragment,o),k(Le.$$.fragment,o),Wo=!1},d(o){t(d),o&&t(C),o&&t(h),I(i),o&&t(V),o&&t(F),I(O),o&&t(H),o&&t(b),o&&t(Fo),o&&t(Tt),o&&t(xo),o&&t(yt),o&&t(Eo),o&&t(kt),o&&t(jo),o&&t(te),o&&t(Po),o&&t(oe),o&&t(Mo),o&&t(le),I(Ye),o&&t(Ao),o&&t(S),I(Ze),I(we),o&&t(qo),o&&t(fe),I(Je),o&&t(No),o&&t(ee),I(Qe),I(ot),I(ye),I(ke),o&&t(Lo),o&&t(he),I(st),o&&t(zo),o&&t(W),I(at),I(it),I(Fe),I(xe),o&&t(Oo),o&&t(ue),I(lt),o&&t(Do),o&&t(N),I(dt),I(je),I(ht),I(Pe),I(Me),o&&t(Vo),o&&t(ve),I(pt),o&&t(So),o&&t(L),I(ut),I(qe),I(Ct),I(Ne),I(Le)}}}const Fn={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"},{local:"transformers.TFCvtModel",title:"TFCvtModel"},{local:"transformers.TFCvtForImageClassification",title:"TFCvtForImageClassification"}],title:"Convolutional Vision Transformer (CvT)"};function xn(E){return pn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Nn extends cn{constructor(d){super();fn(this,d,xn,In,mn,{})}}export{Nn as default,Fn as metadata};
