import{s as Ze,o as Je,n as be}from"../chunks/scheduler.9bc65507.js";import{S as We,i as Ne,g as p,s as l,r as $,A as ze,h as f,f as a,c as i,j as ve,u as T,x as C,k as Ce,y as _,a as r,v as y,d as w,t as j,w as x}from"../chunks/index.707bf1b6.js";import{T as we}from"../chunks/Tip.c2ecdbf4.js";import{D as Te}from"../chunks/Docstring.86474e80.js";import{C as Fe}from"../chunks/CodeBlock.54a9f38d.js";import{F as Le,M as Ie}from"../chunks/Markdown.8ab98a13.js";import{E as ke}from"../chunks/ExampleCodeBlock.034f3a73.js";import{P as He}from"../chunks/PipelineTag.44585822.js";import{H as xe,E as Re}from"../chunks/EditOnGithub.922df6ba.js";function Ve(F){let e,h="Example:",o,s,d;return s=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEN2dENvbmZpZyUyQyUyMEN2dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEN2dCUyMG1zZnQlMkZjdnQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ3Z0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMG1zZnQlMkZjdnQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEN2dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CvtConfig, CvtModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the msft/cvt style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CvtModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){e=p("p"),e.textContent=h,o=l(),$(s.$$.fragment)},l(n){e=f(n,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=h),o=i(n),T(s.$$.fragment,n)},m(n,m){r(n,e,m),r(n,o,m),y(s,n,m),d=!0},p:be,i(n){d||(w(s.$$.fragment,n),d=!0)},o(n){j(s.$$.fragment,n),d=!1},d(n){n&&(a(e),a(o)),x(s,n)}}}function Be(F){let e,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=h},l(o){e=f(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=h)},m(o,s){r(o,e,s)},p:be,d(o){o&&a(e)}}}function Ee(F){let e,h="Example:",o,s,d;return s=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEN2dE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZjdnQtMTMlMjIpJTBBbW9kZWwlMjAlM0QlMjBDdnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGY3Z0LTEzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, CvtModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">384</span>, <span class="hljs-number">14</span>, <span class="hljs-number">14</span>]`,wrap:!1}}),{c(){e=p("p"),e.textContent=h,o=l(),$(s.$$.fragment)},l(n){e=f(n,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=h),o=i(n),T(s.$$.fragment,n)},m(n,m){r(n,e,m),r(n,o,m),y(s,n,m),d=!0},p:be,i(n){d||(w(s.$$.fragment,n),d=!0)},o(n){j(s.$$.fragment,n),d=!1},d(n){n&&(a(e),a(o)),x(s,n)}}}function Pe(F){let e,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=h},l(o){e=f(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=h)},m(o,s){r(o,e,s)},p:be,d(o){o&&a(e)}}}function qe(F){let e,h="Example:",o,s,d;return s=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEFtb2RlbCUyMCUzRCUyMEN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, CvtForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`,wrap:!1}}),{c(){e=p("p"),e.textContent=h,o=l(),$(s.$$.fragment)},l(n){e=f(n,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=h),o=i(n),T(s.$$.fragment,n)},m(n,m){r(n,e,m),r(n,o,m),y(s,n,m),d=!0},p:be,i(n){d||(w(s.$$.fragment,n),d=!0)},o(n){j(s.$$.fragment,n),d=!1},d(n){n&&(a(e),a(o)),x(s,n)}}}function Ge(F){let e,h="## CvtModel[[transformers.CvtModel]]",o,s,d,n,m,G=`The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,v,k,A,D,Q,Me='The <a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.CvtModel">CvtModel</a> forward method, overrides the <code>__call__</code> special method.',O,R,de,U,K,X,q="## CvtForImageClassification[[transformers.CvtForImageClassification]]",ce,J,B,me,N,pe=`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.`,E,fe,he=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,I,W,P,ne,te,se='The <a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',ae,Y,ee,V,H;return d=new Te({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_30021/ja/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_30021/ja/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_30021/src/transformers/models/cvt/modeling_cvt.py#L575"}}),A=new Te({props:{name:"forward",anchor:"transformers.CvtModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.CvtModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30021/ja/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.CvtModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CvtModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_30021/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30021/src/transformers/models/cvt/modeling_cvt.py#L594",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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_30021/ja/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</li>
<li><strong>cls_token_value</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 1, hidden_size)</code>) — Classification token at the output of the last layer of the model.</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.cvt.modeling_cvt.BaseModelOutputWithCLSToken</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),R=new we({props:{$$slots:{default:[Be]},$$scope:{ctx:F}}}),U=new ke({props:{anchor:"transformers.CvtModel.forward.example",$$slots:{default:[Ee]},$$scope:{ctx:F}}}),B=new Te({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_30021/ja/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_30021/ja/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_30021/src/transformers/models/cvt/modeling_cvt.py#L633"}}),P=new Te({props:{name:"forward",anchor:"transformers.CvtForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.CvtForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30021/ja/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.CvtForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CvtForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_30021/ja/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_30021/src/transformers/models/cvt/modeling_cvt.py#L655",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30021/ja/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_30021/ja/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30021/ja/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new we({props:{$$slots:{default:[Pe]},$$scope:{ctx:F}}}),V=new ke({props:{anchor:"transformers.CvtForImageClassification.forward.example",$$slots:{default:[qe]},$$scope:{ctx:F}}}),{c(){e=p("p"),e.textContent=h,o=l(),s=p("div"),$(d.$$.fragment),n=l(),m=p("p"),m.innerHTML=G,v=l(),k=p("div"),$(A.$$.fragment),D=l(),Q=p("p"),Q.innerHTML=Me,O=l(),$(R.$$.fragment),de=l(),$(U.$$.fragment),K=l(),X=p("p"),X.textContent=q,ce=l(),J=p("div"),$(B.$$.fragment),me=l(),N=p("p"),N.textContent=pe,E=l(),fe=p("p"),fe.innerHTML=he,I=l(),W=p("div"),$(P.$$.fragment),ne=l(),te=p("p"),te.innerHTML=se,ae=l(),$(Y.$$.fragment),ee=l(),$(V.$$.fragment),this.h()},l(g){e=f(g,"P",{"data-svelte-h":!0}),C(e)!=="svelte-1jnzvk"&&(e.textContent=h),o=i(g),s=f(g,"DIV",{class:!0});var M=ve(s);T(d.$$.fragment,M),n=i(M),m=f(M,"P",{"data-svelte-h":!0}),C(m)!=="svelte-1wvfixi"&&(m.innerHTML=G),v=i(M),k=f(M,"DIV",{class:!0});var L=ve(k);T(A.$$.fragment,L),D=i(L),Q=f(L,"P",{"data-svelte-h":!0}),C(Q)!=="svelte-11b68xc"&&(Q.innerHTML=Me),O=i(L),T(R.$$.fragment,L),de=i(L),T(U.$$.fragment,L),L.forEach(a),M.forEach(a),K=i(g),X=f(g,"P",{"data-svelte-h":!0}),C(X)!=="svelte-1ttn2nc"&&(X.textContent=q),ce=i(g),J=f(g,"DIV",{class:!0});var Z=ve(J);T(B.$$.fragment,Z),me=i(Z),N=f(Z,"P",{"data-svelte-h":!0}),C(N)!=="svelte-ztj7cy"&&(N.textContent=pe),E=i(Z),fe=f(Z,"P",{"data-svelte-h":!0}),C(fe)!=="svelte-1qhb76u"&&(fe.innerHTML=he),I=i(Z),W=f(Z,"DIV",{class:!0});var z=ve(W);T(P.$$.fragment,z),ne=i(z),te=f(z,"P",{"data-svelte-h":!0}),C(te)!=="svelte-188fir0"&&(te.innerHTML=se),ae=i(z),T(Y.$$.fragment,z),ee=i(z),T(V.$$.fragment,z),z.forEach(a),Z.forEach(a),this.h()},h(){Ce(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Ce(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Ce(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Ce(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(g,M){r(g,e,M),r(g,o,M),r(g,s,M),y(d,s,null),_(s,n),_(s,m),_(s,v),_(s,k),y(A,k,null),_(k,D),_(k,Q),_(k,O),y(R,k,null),_(k,de),y(U,k,null),r(g,K,M),r(g,X,M),r(g,ce,M),r(g,J,M),y(B,J,null),_(J,me),_(J,N),_(J,E),_(J,fe),_(J,I),_(J,W),y(P,W,null),_(W,ne),_(W,te),_(W,ae),y(Y,W,null),_(W,ee),y(V,W,null),H=!0},p(g,M){const L={};M&2&&(L.$$scope={dirty:M,ctx:g}),R.$set(L);const Z={};M&2&&(Z.$$scope={dirty:M,ctx:g}),U.$set(Z);const z={};M&2&&(z.$$scope={dirty:M,ctx:g}),Y.$set(z);const re={};M&2&&(re.$$scope={dirty:M,ctx:g}),V.$set(re)},i(g){H||(w(d.$$.fragment,g),w(A.$$.fragment,g),w(R.$$.fragment,g),w(U.$$.fragment,g),w(B.$$.fragment,g),w(P.$$.fragment,g),w(Y.$$.fragment,g),w(V.$$.fragment,g),H=!0)},o(g){j(d.$$.fragment,g),j(A.$$.fragment,g),j(R.$$.fragment,g),j(U.$$.fragment,g),j(B.$$.fragment,g),j(P.$$.fragment,g),j(Y.$$.fragment,g),j(V.$$.fragment,g),H=!1},d(g){g&&(a(e),a(o),a(s),a(K),a(X),a(ce),a(J)),x(d),x(A),x(R),x(U),x(B),x(P),x(Y),x(V)}}}function Qe(F){let e,h;return e=new Ie({props:{$$slots:{default:[Ge]},$$scope:{ctx:F}}}),{c(){$(e.$$.fragment)},l(o){T(e.$$.fragment,o)},m(o,s){y(e,o,s),h=!0},p(o,s){const d={};s&2&&(d.$$scope={dirty:s,ctx:o}),e.$set(d)},i(o){h||(w(e.$$.fragment,o),h=!0)},o(o){j(e.$$.fragment,o),h=!1},d(o){x(e,o)}}}function Xe(F){let e,h="TF 2.0 models accepts two formats as inputs:",o,s,d="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional arguments.</li>",n,m,G=`This second option is useful when using <code>keras.Model.fit</code> method which currently requires having all the
tensors in the first argument of the model call function: <code>model(inputs)</code>.`;return{c(){e=p("p"),e.textContent=h,o=l(),s=p("ul"),s.innerHTML=d,n=l(),m=p("p"),m.innerHTML=G},l(v){e=f(v,"P",{"data-svelte-h":!0}),C(e)!=="svelte-ha0dwg"&&(e.textContent=h),o=i(v),s=f(v,"UL",{"data-svelte-h":!0}),C(s)!=="svelte-1ar3osv"&&(s.innerHTML=d),n=i(v),m=f(v,"P",{"data-svelte-h":!0}),C(m)!=="svelte-14kkttf"&&(m.innerHTML=G)},m(v,k){r(v,e,k),r(v,o,k),r(v,s,k),r(v,n,k),r(v,m,k)},p:be,d(v){v&&(a(e),a(o),a(s),a(n),a(m))}}}function Ye(F){let e,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=h},l(o){e=f(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=h)},m(o,s){r(o,e,s)},p:be,d(o){o&&a(e)}}}function Se(F){let e,h="Examples:",o,s,d;return s=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGQ3Z0TW9kZWwlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEFtb2RlbCUyMCUzRCUyMFRGQ3Z0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFCvtModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){e=p("p"),e.textContent=h,o=l(),$(s.$$.fragment)},l(n){e=f(n,"P",{"data-svelte-h":!0}),C(e)!=="svelte-kvfsh7"&&(e.textContent=h),o=i(n),T(s.$$.fragment,n)},m(n,m){r(n,e,m),r(n,o,m),y(s,n,m),d=!0},p:be,i(n){d||(w(s.$$.fragment,n),d=!0)},o(n){j(s.$$.fragment,n),d=!1},d(n){n&&(a(e),a(o)),x(s,n)}}}function Ae(F){let e,h="TF 2.0 models accepts two formats as inputs:",o,s,d="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional arguments.</li>",n,m,G=`This second option is useful when using <code>keras.Model.fit</code> method which currently requires having all the
tensors in the first argument of the model call function: <code>model(inputs)</code>.`;return{c(){e=p("p"),e.textContent=h,o=l(),s=p("ul"),s.innerHTML=d,n=l(),m=p("p"),m.innerHTML=G},l(v){e=f(v,"P",{"data-svelte-h":!0}),C(e)!=="svelte-ha0dwg"&&(e.textContent=h),o=i(v),s=f(v,"UL",{"data-svelte-h":!0}),C(s)!=="svelte-1ar3osv"&&(s.innerHTML=d),n=i(v),m=f(v,"P",{"data-svelte-h":!0}),C(m)!=="svelte-14kkttf"&&(m.innerHTML=G)},m(v,k){r(v,e,k),r(v,o,k),r(v,s,k),r(v,n,k),r(v,m,k)},p:be,d(v){v&&(a(e),a(o),a(s),a(n),a(m))}}}function De(F){let e,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=h},l(o){e=f(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=h)},m(o,s){r(o,e,s)},p:be,d(o){o&&a(e)}}}function Oe(F){let e,h="Examples:",o,s,d;return s=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGQ3Z0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZjdnQtMTMlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfY2xhc3NfaWR4JTIwJTNEJTIwdGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQlMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QmludChwcmVkaWN0ZWRfY2xhc3NfaWR4KSU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFCvtForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[<span class="hljs-built_in">int</span>(predicted_class_idx)])`,wrap:!1}}),{c(){e=p("p"),e.textContent=h,o=l(),$(s.$$.fragment)},l(n){e=f(n,"P",{"data-svelte-h":!0}),C(e)!=="svelte-kvfsh7"&&(e.textContent=h),o=i(n),T(s.$$.fragment,n)},m(n,m){r(n,e,m),r(n,o,m),y(s,n,m),d=!0},p:be,i(n){d||(w(s.$$.fragment,n),d=!0)},o(n){j(s.$$.fragment,n),d=!1},d(n){n&&(a(e),a(o)),x(s,n)}}}function Ke(F){let e,h="## TFCvtModel[[transformers.TFCvtModel]]",o,s,d,n,m,G="The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.",v,k,A=`This model inherits from <a href="/docs/transformers/pr_30021/ja/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,D,Q,Me=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,O,R,de,U,K,X,q,ce='The <a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.TFCvtModel">TFCvtModel</a> forward method, overrides the <code>__call__</code> special method.',J,B,me,N,pe,E,fe="## TFCvtForImageClassification[[transformers.TFCvtForImageClassification]]",he,I,W,P,ne,te=`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.`,se,ae,Y=`This model inherits from <a href="/docs/transformers/pr_30021/ja/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ee,V,H=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,g,M,L,Z,z,re,$e,ye='The <a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.TFCvtForImageClassification">TFCvtForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',ge,le,ue,ie,_e;return d=new Te({props:{name:"class transformers.TFCvtModel",anchor:"transformers.TFCvtModel",parameters:[{name:"config",val:": CvtConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCvtModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30021/ja/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_30021/ja/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/vr_30021/src/transformers/models/cvt/modeling_tf_cvt.py#L916"}}),R=new we({props:{$$slots:{default:[Xe]},$$scope:{ctx:F}}}),K=new Te({props:{name:"call",anchor:"transformers.TFCvtModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCvtModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30021/ja/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.TFCvtModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCvtModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_30021/ja/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/vr_30021/src/transformers/models/cvt/modeling_tf_cvt.py#L926",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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/pr_30021/ja/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</li>
<li><strong>cls_token_value</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 1, hidden_size)</code>) — Classification token at the output of the last layer of the model.</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.cvt.modeling_tf_cvt.TFBaseModelOutputWithCLSToken</code> or <code>tuple(tf.Tensor)</code></p>
`}}),B=new we({props:{$$slots:{default:[Ye]},$$scope:{ctx:F}}}),N=new ke({props:{anchor:"transformers.TFCvtModel.call.example",$$slots:{default:[Se]},$$scope:{ctx:F}}}),W=new Te({props:{name:"class transformers.TFCvtForImageClassification",anchor:"transformers.TFCvtForImageClassification",parameters:[{name:"config",val:": CvtConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCvtForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30021/ja/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_30021/ja/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/vr_30021/src/transformers/models/cvt/modeling_tf_cvt.py#L985"}}),M=new we({props:{$$slots:{default:[Ae]},$$scope:{ctx:F}}}),z=new Te({props:{name:"call",anchor:"transformers.TFCvtForImageClassification.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCvtForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30021/ja/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>CvtImageProcessor.__call__</code>
for details.`,name:"pixel_values"},{anchor:"transformers.TFCvtForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCvtForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_30021/ja/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/vr_30021/src/transformers/models/cvt/modeling_tf_cvt.py#L1011",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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/pr_30021/ja/model_doc/cvt#transformers.CvtConfig"
>CvtConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),le=new we({props:{$$slots:{default:[De]},$$scope:{ctx:F}}}),ie=new ke({props:{anchor:"transformers.TFCvtForImageClassification.call.example",$$slots:{default:[Oe]},$$scope:{ctx:F}}}),{c(){e=p("p"),e.textContent=h,o=l(),s=p("div"),$(d.$$.fragment),n=l(),m=p("p"),m.textContent=G,v=l(),k=p("p"),k.innerHTML=A,D=l(),Q=p("p"),Q.innerHTML=Me,O=l(),$(R.$$.fragment),de=l(),U=p("div"),$(K.$$.fragment),X=l(),q=p("p"),q.innerHTML=ce,J=l(),$(B.$$.fragment),me=l(),$(N.$$.fragment),pe=l(),E=p("p"),E.textContent=fe,he=l(),I=p("div"),$(W.$$.fragment),P=l(),ne=p("p"),ne.textContent=te,se=l(),ae=p("p"),ae.innerHTML=Y,ee=l(),V=p("p"),V.innerHTML=H,g=l(),$(M.$$.fragment),L=l(),Z=p("div"),$(z.$$.fragment),re=l(),$e=p("p"),$e.innerHTML=ye,ge=l(),$(le.$$.fragment),ue=l(),$(ie.$$.fragment),this.h()},l(u){e=f(u,"P",{"data-svelte-h":!0}),C(e)!=="svelte-o7h1u4"&&(e.textContent=h),o=i(u),s=f(u,"DIV",{class:!0});var b=ve(s);T(d.$$.fragment,b),n=i(b),m=f(b,"P",{"data-svelte-h":!0}),C(m)!=="svelte-5yjryq"&&(m.textContent=G),v=i(b),k=f(b,"P",{"data-svelte-h":!0}),C(k)!=="svelte-mr1llk"&&(k.innerHTML=A),D=i(b),Q=f(b,"P",{"data-svelte-h":!0}),C(Q)!=="svelte-1be7e3c"&&(Q.innerHTML=Me),O=i(b),T(R.$$.fragment,b),de=i(b),U=f(b,"DIV",{class:!0});var S=ve(U);T(K.$$.fragment,S),X=i(S),q=f(S,"P",{"data-svelte-h":!0}),C(q)!=="svelte-qatqho"&&(q.innerHTML=ce),J=i(S),T(B.$$.fragment,S),me=i(S),T(N.$$.fragment,S),S.forEach(a),b.forEach(a),pe=i(u),E=f(u,"P",{"data-svelte-h":!0}),C(E)!=="svelte-1h18bfg"&&(E.textContent=fe),he=i(u),I=f(u,"DIV",{class:!0});var t=ve(I);T(W.$$.fragment,t),P=i(t),ne=f(t,"P",{"data-svelte-h":!0}),C(ne)!=="svelte-ztj7cy"&&(ne.textContent=te),se=i(t),ae=f(t,"P",{"data-svelte-h":!0}),C(ae)!=="svelte-mr1llk"&&(ae.innerHTML=Y),ee=i(t),V=f(t,"P",{"data-svelte-h":!0}),C(V)!=="svelte-1be7e3c"&&(V.innerHTML=H),g=i(t),T(M.$$.fragment,t),L=i(t),Z=f(t,"DIV",{class:!0});var c=ve(Z);T(z.$$.fragment,c),re=i(c),$e=f(c,"P",{"data-svelte-h":!0}),C($e)!=="svelte-3bchr8"&&($e.innerHTML=ye),ge=i(c),T(le.$$.fragment,c),ue=i(c),T(ie.$$.fragment,c),c.forEach(a),t.forEach(a),this.h()},h(){Ce(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Ce(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Ce(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Ce(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(u,b){r(u,e,b),r(u,o,b),r(u,s,b),y(d,s,null),_(s,n),_(s,m),_(s,v),_(s,k),_(s,D),_(s,Q),_(s,O),y(R,s,null),_(s,de),_(s,U),y(K,U,null),_(U,X),_(U,q),_(U,J),y(B,U,null),_(U,me),y(N,U,null),r(u,pe,b),r(u,E,b),r(u,he,b),r(u,I,b),y(W,I,null),_(I,P),_(I,ne),_(I,se),_(I,ae),_(I,ee),_(I,V),_(I,g),y(M,I,null),_(I,L),_(I,Z),y(z,Z,null),_(Z,re),_(Z,$e),_(Z,ge),y(le,Z,null),_(Z,ue),y(ie,Z,null),_e=!0},p(u,b){const S={};b&2&&(S.$$scope={dirty:b,ctx:u}),R.$set(S);const t={};b&2&&(t.$$scope={dirty:b,ctx:u}),B.$set(t);const c={};b&2&&(c.$$scope={dirty:b,ctx:u}),N.$set(c);const oe={};b&2&&(oe.$$scope={dirty:b,ctx:u}),M.$set(oe);const je={};b&2&&(je.$$scope={dirty:b,ctx:u}),le.$set(je);const Ue={};b&2&&(Ue.$$scope={dirty:b,ctx:u}),ie.$set(Ue)},i(u){_e||(w(d.$$.fragment,u),w(R.$$.fragment,u),w(K.$$.fragment,u),w(B.$$.fragment,u),w(N.$$.fragment,u),w(W.$$.fragment,u),w(M.$$.fragment,u),w(z.$$.fragment,u),w(le.$$.fragment,u),w(ie.$$.fragment,u),_e=!0)},o(u){j(d.$$.fragment,u),j(R.$$.fragment,u),j(K.$$.fragment,u),j(B.$$.fragment,u),j(N.$$.fragment,u),j(W.$$.fragment,u),j(M.$$.fragment,u),j(z.$$.fragment,u),j(le.$$.fragment,u),j(ie.$$.fragment,u),_e=!1},d(u){u&&(a(e),a(o),a(s),a(pe),a(E),a(he),a(I)),x(d),x(R),x(K),x(B),x(N),x(W),x(M),x(z),x(le),x(ie)}}}function et(F){let e,h;return e=new Ie({props:{$$slots:{default:[Ke]},$$scope:{ctx:F}}}),{c(){$(e.$$.fragment)},l(o){T(e.$$.fragment,o)},m(o,s){y(e,o,s),h=!0},p(o,s){const d={};s&2&&(d.$$scope={dirty:s,ctx:o}),e.$set(d)},i(o){h||(w(e.$$.fragment,o),h=!0)},o(o){j(e.$$.fragment,o),h=!1},d(o){x(e,o)}}}function tt(F){let e,h,o,s,d,n,m,G,v,k='CvT モデルは、Haping Wu、Bin Xiao、Noel Codella、Mengchen Liu、Xiyang Dai、Lu Yuan、Lei Zhang によって <a href="https://arxiv.org/abs/2103.15808" rel="nofollow">CvT: Introduction Convolutions to Vision Transformers</a> で提案されました。畳み込みビジョン トランスフォーマー (CvT) は、ViT に畳み込みを導入して両方の設計の長所を引き出すことにより、<a href="vit">ビジョン トランスフォーマー (ViT)</a> のパフォーマンスと効率を向上させます。',A,D,Q="論文の要約は次のとおりです。",Me,O,R=`<em>この論文では、ビジョン トランスフォーマー (ViT) を改善する、畳み込みビジョン トランスフォーマー (CvT) と呼ばれる新しいアーキテクチャを紹介します。
ViT に畳み込みを導入して両方の設計の長所を引き出すことで、パフォーマンスと効率を向上させます。これは次のようにして実現されます。
2 つの主要な変更: 新しい畳み込みトークンの埋め込みを含むトランスフォーマーの階層と、畳み込みトランスフォーマー
畳み込み射影を利用したブロック。これらの変更により、畳み込みニューラル ネットワーク (CNN) の望ましい特性が導入されます。
トランスフォーマーの利点 (動的な注意力、
グローバルなコンテキストとより良い一般化)。私たちは広範な実験を実施することで CvT を検証し、このアプローチが達成できることを示しています。
ImageNet-1k 上の他のビジョン トランスフォーマーや ResNet よりも、パラメータが少なく、FLOP が低い、最先端のパフォーマンスを実現します。加えて、
より大きなデータセット (例: ImageNet-22k) で事前トレーニングし、下流のタスクに合わせて微調整すると、パフォーマンスの向上が維持されます。事前トレーニング済み
ImageNet-22k、当社の CvT-W24 は、ImageNet-1k val set で 87.7\\% というトップ 1 の精度を獲得しています。最後に、私たちの結果は、位置エンコーディングが、
既存のビジョン トランスフォーマーの重要なコンポーネントであるこのコンポーネントは、モデルでは安全に削除できるため、高解像度のビジョン タスクの設計が簡素化されます。</em>`,de,U,K='このモデルは <a href="https://huggingface.co/anugunj" rel="nofollow">anugunj</a> によって提供されました。元のコードは <a href="https://github.com/microsoft/CvT" rel="nofollow">ここ</a> にあります。',X,q,ce,J,B=`<li>CvT モデルは通常の Vision Transformer ですが、畳み込みでトレーニングされています。 ImageNet-1K および CIFAR-100 で微調整すると、<a href="vit">オリジナル モデル (ViT)</a> よりも優れたパフォーマンスを発揮します。</li> <li>カスタム データの微調整だけでなく推論に関するデモ ノートブックも <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer" rel="nofollow">ここ</a> で確認できます (<code>ViTFeatureExtractor を置き換えるだけで済みます)</code> による <a href="/docs/transformers/pr_30021/ja/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> および <code>ViTForImageClassification</code> による <a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a>)。</li> <li>利用可能なチェックポイントは、(1) <a href="http://www.image-net.org/" rel="nofollow">ImageNet-22k</a> (1,400 万の画像と 22,000 のクラスのコレクション) でのみ事前トレーニングされている、(2) も問題ありません。 ImageNet-22k で調整、または (3) <a href="http://www.image-net.org/challenges/LSVRC/2012/" rel="nofollow">ImageNet-1k</a> (ILSVRC 2012 とも呼ばれるコレクション) でも微調整130万の
画像と 1,000 クラス)。</li>`,me,N,pe,E,fe="CvT を始めるのに役立つ公式 Hugging Face およびコミュニティ (🌎 で示される) リソースのリスト。",he,I,W,P,ne='<li><a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a> は、この <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">サンプル スクリプト</a> および <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">ノートブック</a>。</li> <li>参照: <a href="../tasks/image_classification">画像分類タスク ガイド</a></li>',te,se,ae="ここに含めるリソースの送信に興味がある場合は、お気軽にプル リクエストを開いてください。審査させていただきます。リソースは、既存のリソースを複製するのではなく、何か新しいものを示すことが理想的です。",Y,ee,V,H,g,M,L,Z=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30021/ja/model_doc/cvt#transformers.CvtModel">CvtModel</a>. It is used to instantiate a CvT model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the CvT
<a href="https://huggingface.co/microsoft/cvt-13" rel="nofollow">microsoft/cvt-13</a> architecture.`,z,re,$e=`Configuration objects inherit from <a href="/docs/transformers/pr_30021/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_30021/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ye,ge,le,ue,ie,_e,u,b,S;return d=new xe({props:{title:"Convolutional Vision Transformer (CvT)",local:"convolutional-vision-transformer-cvt",headingTag:"h1"}}),m=new xe({props:{title:"Overview",local:"overview",headingTag:"h2"}}),q=new xe({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),N=new xe({props:{title:"Resources",local:"resources",headingTag:"h2"}}),I=new He({props:{pipeline:"image-classification"}}),ee=new xe({props:{title:"CvtConfig",local:"transformers.CvtConfig",headingTag:"h2"}}),g=new Te({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_30021/src/transformers/models/cvt/configuration_cvt.py#L24"}}),ge=new ke({props:{anchor:"transformers.CvtConfig.example",$$slots:{default:[Ve]},$$scope:{ctx:F}}}),ue=new Le({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[et],pytorch:[Qe]},$$scope:{ctx:F}}}),_e=new Re({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/model_doc/cvt.md"}}),{c(){e=p("meta"),h=l(),o=p("p"),s=l(),$(d.$$.fragment),n=l(),$(m.$$.fragment),G=l(),v=p("p"),v.innerHTML=k,A=l(),D=p("p"),D.textContent=Q,Me=l(),O=p("p"),O.innerHTML=R,de=l(),U=p("p"),U.innerHTML=K,X=l(),$(q.$$.fragment),ce=l(),J=p("ul"),J.innerHTML=B,me=l(),$(N.$$.fragment),pe=l(),E=p("p"),E.textContent=fe,he=l(),$(I.$$.fragment),W=l(),P=p("ul"),P.innerHTML=ne,te=l(),se=p("p"),se.textContent=ae,Y=l(),$(ee.$$.fragment),V=l(),H=p("div"),$(g.$$.fragment),M=l(),L=p("p"),L.innerHTML=Z,z=l(),re=p("p"),re.innerHTML=$e,ye=l(),$(ge.$$.fragment),le=l(),$(ue.$$.fragment),ie=l(),$(_e.$$.fragment),u=l(),b=p("p"),this.h()},l(t){const c=ze("svelte-u9bgzb",document.head);e=f(c,"META",{name:!0,content:!0}),c.forEach(a),h=i(t),o=f(t,"P",{}),ve(o).forEach(a),s=i(t),T(d.$$.fragment,t),n=i(t),T(m.$$.fragment,t),G=i(t),v=f(t,"P",{"data-svelte-h":!0}),C(v)!=="svelte-f3bmm3"&&(v.innerHTML=k),A=i(t),D=f(t,"P",{"data-svelte-h":!0}),C(D)!=="svelte-1cv3nri"&&(D.textContent=Q),Me=i(t),O=f(t,"P",{"data-svelte-h":!0}),C(O)!=="svelte-vfb256"&&(O.innerHTML=R),de=i(t),U=f(t,"P",{"data-svelte-h":!0}),C(U)!=="svelte-1nuuuh6"&&(U.innerHTML=K),X=i(t),T(q.$$.fragment,t),ce=i(t),J=f(t,"UL",{"data-svelte-h":!0}),C(J)!=="svelte-96mu9p"&&(J.innerHTML=B),me=i(t),T(N.$$.fragment,t),pe=i(t),E=f(t,"P",{"data-svelte-h":!0}),C(E)!=="svelte-1dr0h45"&&(E.textContent=fe),he=i(t),T(I.$$.fragment,t),W=i(t),P=f(t,"UL",{"data-svelte-h":!0}),C(P)!=="svelte-7dalc0"&&(P.innerHTML=ne),te=i(t),se=f(t,"P",{"data-svelte-h":!0}),C(se)!=="svelte-17ytafw"&&(se.textContent=ae),Y=i(t),T(ee.$$.fragment,t),V=i(t),H=f(t,"DIV",{class:!0});var oe=ve(H);T(g.$$.fragment,oe),M=i(oe),L=f(oe,"P",{"data-svelte-h":!0}),C(L)!=="svelte-b6tmfq"&&(L.innerHTML=Z),z=i(oe),re=f(oe,"P",{"data-svelte-h":!0}),C(re)!=="svelte-1nci8uj"&&(re.innerHTML=$e),ye=i(oe),T(ge.$$.fragment,oe),oe.forEach(a),le=i(t),T(ue.$$.fragment,t),ie=i(t),T(_e.$$.fragment,t),u=i(t),b=f(t,"P",{}),ve(b).forEach(a),this.h()},h(){Ce(e,"name","hf:doc:metadata"),Ce(e,"content",st),Ce(H,"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,c){_(document.head,e),r(t,h,c),r(t,o,c),r(t,s,c),y(d,t,c),r(t,n,c),y(m,t,c),r(t,G,c),r(t,v,c),r(t,A,c),r(t,D,c),r(t,Me,c),r(t,O,c),r(t,de,c),r(t,U,c),r(t,X,c),y(q,t,c),r(t,ce,c),r(t,J,c),r(t,me,c),y(N,t,c),r(t,pe,c),r(t,E,c),r(t,he,c),y(I,t,c),r(t,W,c),r(t,P,c),r(t,te,c),r(t,se,c),r(t,Y,c),y(ee,t,c),r(t,V,c),r(t,H,c),y(g,H,null),_(H,M),_(H,L),_(H,z),_(H,re),_(H,ye),y(ge,H,null),r(t,le,c),y(ue,t,c),r(t,ie,c),y(_e,t,c),r(t,u,c),r(t,b,c),S=!0},p(t,[c]){const oe={};c&2&&(oe.$$scope={dirty:c,ctx:t}),ge.$set(oe);const je={};c&2&&(je.$$scope={dirty:c,ctx:t}),ue.$set(je)},i(t){S||(w(d.$$.fragment,t),w(m.$$.fragment,t),w(q.$$.fragment,t),w(N.$$.fragment,t),w(I.$$.fragment,t),w(ee.$$.fragment,t),w(g.$$.fragment,t),w(ge.$$.fragment,t),w(ue.$$.fragment,t),w(_e.$$.fragment,t),S=!0)},o(t){j(d.$$.fragment,t),j(m.$$.fragment,t),j(q.$$.fragment,t),j(N.$$.fragment,t),j(I.$$.fragment,t),j(ee.$$.fragment,t),j(g.$$.fragment,t),j(ge.$$.fragment,t),j(ue.$$.fragment,t),j(_e.$$.fragment,t),S=!1},d(t){t&&(a(h),a(o),a(s),a(n),a(G),a(v),a(A),a(D),a(Me),a(O),a(de),a(U),a(X),a(ce),a(J),a(me),a(pe),a(E),a(he),a(W),a(P),a(te),a(se),a(Y),a(V),a(H),a(le),a(ie),a(u),a(b)),a(e),x(d,t),x(m,t),x(q,t),x(N,t),x(I,t),x(ee,t),x(g),x(ge),x(ue,t),x(_e,t)}}}const st='{"title":"Convolutional Vision Transformer (CvT)","local":"convolutional-vision-transformer-cvt","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"CvtConfig","local":"transformers.CvtConfig","sections":[],"depth":2}],"depth":1}';function ot(F){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ft extends We{constructor(e){super(),Ne(this,e,ot,tt,Ze,{})}}export{ft as component};
