import{s as Ie,o as Ze,n as he}from"../chunks/scheduler.9bc65507.js";import{S as Je,i as We,g as h,s as l,r as M,A as Ne,h as u,f as a,c as i,j as fe,u as $,x,k as ge,y as g,a as r,v as T,d as y,t as w,w as j}from"../chunks/index.707bf1b6.js";import{T as je}from"../chunks/Tip.c2ecdbf4.js";import{D as Te}from"../chunks/Docstring.570ddb64.js";import{C as Fe}from"../chunks/CodeBlock.54a9f38d.js";import{F as ze,M as Ue}from"../chunks/Markdown.8ab98a13.js";import{E as xe}from"../chunks/ExampleCodeBlock.bc2be6bc.js";import{P as Le}from"../chunks/PipelineTag.44585822.js";import{H as $e,E as Re}from"../chunks/EditOnGithub.922df6ba.js";function He(F){let e,d="Example:",t,n,f;return n=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=h("p"),e.textContent=d,t=l(),M(n.$$.fragment)},l(o){e=u(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-11lpom8"&&(e.textContent=d),t=i(o),$(n.$$.fragment,o)},m(o,v){r(o,e,v),r(o,t,v),T(n,o,v),f=!0},p:he,i(o){f||(y(n.$$.fragment,o),f=!0)},o(o){w(n.$$.fragment,o),f=!1},d(o){o&&(a(e),a(t)),j(n,o)}}}function Ve(F){let e,d=`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=h("p"),e.innerHTML=d},l(t){e=u(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=d)},m(t,n){r(t,e,n)},p:he,d(t){t&&a(e)}}}function Be(F){let e,d="Example:",t,n,f;return n=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEN2dE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZjdnQtMTMlMjIpJTBBbW9kZWwlMjAlM0QlMjBDdnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGY3Z0LTEzJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",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>, trust_remote_code=<span class="hljs-literal">True</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=h("p"),e.textContent=d,t=l(),M(n.$$.fragment)},l(o){e=u(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-11lpom8"&&(e.textContent=d),t=i(o),$(n.$$.fragment,o)},m(o,v){r(o,e,v),r(o,t,v),T(n,o,v),f=!0},p:he,i(o){f||(y(n.$$.fragment,o),f=!0)},o(o){w(n.$$.fragment,o),f=!1},d(o){o&&(a(e),a(t)),j(n,o)}}}function Ee(F){let e,d=`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=h("p"),e.innerHTML=d},l(t){e=u(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=d)},m(t,n){r(t,e,n)},p:he,d(t){t&&a(e)}}}function Pe(F){let e,d="Example:",t,n,f;return n=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEFtb2RlbCUyMCUzRCUyMEN2dEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmN2dC0xMyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",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>, trust_remote_code=<span class="hljs-literal">True</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=h("p"),e.textContent=d,t=l(),M(n.$$.fragment)},l(o){e=u(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-11lpom8"&&(e.textContent=d),t=i(o),$(n.$$.fragment,o)},m(o,v){r(o,e,v),r(o,t,v),T(n,o,v),f=!0},p:he,i(o){f||(y(n.$$.fragment,o),f=!0)},o(o){w(n.$$.fragment,o),f=!1},d(o){o&&(a(e),a(t)),j(n,o)}}}function Ge(F){let e,d,t,n,f,o,v=`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.`,Q,m,Z,de,R,ye='The <a href="/docs/transformers/main/ja/model_doc/cvt#transformers.CvtModel">CvtModel</a> forward method, overrides the <code>__call__</code> special method.',ce,J,ue,U,V,ne,Y,N,S,B,re,A=`Cvt Model transformer with an image classification head on top (a linear layer on top of the final hidden state of
the [CLS] token) e.g. for ImageNet.`,D,P,ee=`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.`,z,W,G,te,X,Ce='The <a href="/docs/transformers/main/ja/model_doc/cvt#transformers.CvtForImageClassification">CvtForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',se,q,ve,E,oe;return e=new $e({props:{title:"CvtModel",local:"transformers.CvtModel",headingTag:"h2"}}),n=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/main/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/main/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/main/src/transformers/models/cvt/modeling_cvt.py#L575"}}),Z=new Te({props:{name:"forward",anchor:"transformers.CvtModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CvtModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/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/main/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/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/main/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>
`}}),J=new je({props:{$$slots:{default:[Ve]},$$scope:{ctx:F}}}),U=new xe({props:{anchor:"transformers.CvtModel.forward.example",$$slots:{default:[Be]},$$scope:{ctx:F}}}),ne=new $e({props:{title:"CvtForImageClassification",local:"transformers.CvtForImageClassification",headingTag:"h2"}}),S=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/main/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/main/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/main/src/transformers/models/cvt/modeling_cvt.py#L633"}}),G=new Te({props:{name:"forward",anchor:"transformers.CvtForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CvtForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/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/main/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/main/src/transformers/models/cvt/modeling_cvt.py#L655",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/ja/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),q=new je({props:{$$slots:{default:[Ee]},$$scope:{ctx:F}}}),E=new xe({props:{anchor:"transformers.CvtForImageClassification.forward.example",$$slots:{default:[Pe]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment),d=l(),t=h("div"),M(n.$$.fragment),f=l(),o=h("p"),o.innerHTML=v,Q=l(),m=h("div"),M(Z.$$.fragment),de=l(),R=h("p"),R.innerHTML=ye,ce=l(),M(J.$$.fragment),ue=l(),M(U.$$.fragment),V=l(),M(ne.$$.fragment),Y=l(),N=h("div"),M(S.$$.fragment),B=l(),re=h("p"),re.textContent=A,D=l(),P=h("p"),P.innerHTML=ee,z=l(),W=h("div"),M(G.$$.fragment),te=l(),X=h("p"),X.innerHTML=Ce,se=l(),M(q.$$.fragment),ve=l(),M(E.$$.fragment),this.h()},l(p){$(e.$$.fragment,p),d=i(p),t=u(p,"DIV",{class:!0});var C=fe(t);$(n.$$.fragment,C),f=i(C),o=u(C,"P",{"data-svelte-h":!0}),x(o)!=="svelte-1qa4t0c"&&(o.innerHTML=v),Q=i(C),m=u(C,"DIV",{class:!0});var L=fe(m);$(Z.$$.fragment,L),de=i(L),R=u(L,"P",{"data-svelte-h":!0}),x(R)!=="svelte-11royay"&&(R.innerHTML=ye),ce=i(L),$(J.$$.fragment,L),ue=i(L),$(U.$$.fragment,L),L.forEach(a),C.forEach(a),V=i(p),$(ne.$$.fragment,p),Y=i(p),N=u(p,"DIV",{class:!0});var k=fe(N);$(S.$$.fragment,k),B=i(k),re=u(k,"P",{"data-svelte-h":!0}),x(re)!=="svelte-ztj7cy"&&(re.textContent=A),D=i(k),P=u(k,"P",{"data-svelte-h":!0}),x(P)!=="svelte-1gjh92c"&&(P.innerHTML=ee),z=i(k),W=u(k,"DIV",{class:!0});var I=fe(W);$(G.$$.fragment,I),te=i(I),X=u(I,"P",{"data-svelte-h":!0}),x(X)!=="svelte-kgo2b2"&&(X.innerHTML=Ce),se=i(I),$(q.$$.fragment,I),ve=i(I),$(E.$$.fragment,I),I.forEach(a),k.forEach(a),this.h()},h(){ge(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ge(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ge(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ge(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(p,C){T(e,p,C),r(p,d,C),r(p,t,C),T(n,t,null),g(t,f),g(t,o),g(t,Q),g(t,m),T(Z,m,null),g(m,de),g(m,R),g(m,ce),T(J,m,null),g(m,ue),T(U,m,null),r(p,V,C),T(ne,p,C),r(p,Y,C),r(p,N,C),T(S,N,null),g(N,B),g(N,re),g(N,D),g(N,P),g(N,z),g(N,W),T(G,W,null),g(W,te),g(W,X),g(W,se),T(q,W,null),g(W,ve),T(E,W,null),oe=!0},p(p,C){const L={};C&2&&(L.$$scope={dirty:C,ctx:p}),J.$set(L);const k={};C&2&&(k.$$scope={dirty:C,ctx:p}),U.$set(k);const I={};C&2&&(I.$$scope={dirty:C,ctx:p}),q.$set(I);const be={};C&2&&(be.$$scope={dirty:C,ctx:p}),E.$set(be)},i(p){oe||(y(e.$$.fragment,p),y(n.$$.fragment,p),y(Z.$$.fragment,p),y(J.$$.fragment,p),y(U.$$.fragment,p),y(ne.$$.fragment,p),y(S.$$.fragment,p),y(G.$$.fragment,p),y(q.$$.fragment,p),y(E.$$.fragment,p),oe=!0)},o(p){w(e.$$.fragment,p),w(n.$$.fragment,p),w(Z.$$.fragment,p),w(J.$$.fragment,p),w(U.$$.fragment,p),w(ne.$$.fragment,p),w(S.$$.fragment,p),w(G.$$.fragment,p),w(q.$$.fragment,p),w(E.$$.fragment,p),oe=!1},d(p){p&&(a(d),a(t),a(V),a(Y),a(N)),j(e,p),j(n),j(Z),j(J),j(U),j(ne,p),j(S),j(G),j(q),j(E)}}}function qe(F){let e,d;return e=new Ue({props:{$$slots:{default:[Ge]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment)},l(t){$(e.$$.fragment,t)},m(t,n){T(e,t,n),d=!0},p(t,n){const f={};n&2&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){d||(y(e.$$.fragment,t),d=!0)},o(t){w(e.$$.fragment,t),d=!1},d(t){j(e,t)}}}function Qe(F){let e,d="TF 2.0 models accepts two formats as inputs:",t,n,f="<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>",o,v,Q=`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=h("p"),e.textContent=d,t=l(),n=h("ul"),n.innerHTML=f,o=l(),v=h("p"),v.innerHTML=Q},l(m){e=u(m,"P",{"data-svelte-h":!0}),x(e)!=="svelte-ha0dwg"&&(e.textContent=d),t=i(m),n=u(m,"UL",{"data-svelte-h":!0}),x(n)!=="svelte-1ar3osv"&&(n.innerHTML=f),o=i(m),v=u(m,"P",{"data-svelte-h":!0}),x(v)!=="svelte-14kkttf"&&(v.innerHTML=Q)},m(m,Z){r(m,e,Z),r(m,t,Z),r(m,n,Z),r(m,o,Z),r(m,v,Z)},p:he,d(m){m&&(a(e),a(t),a(n),a(o),a(v))}}}function Xe(F){let e,d=`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=h("p"),e.innerHTML=d},l(t){e=u(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=d)},m(t,n){r(t,e,n)},p:he,d(t){t&&a(e)}}}function Ye(F){let e,d="Examples:",t,n,f;return n=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=h("p"),e.textContent=d,t=l(),M(n.$$.fragment)},l(o){e=u(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=d),t=i(o),$(n.$$.fragment,o)},m(o,v){r(o,e,v),r(o,t,v),T(n,o,v),f=!0},p:he,i(o){f||(y(n.$$.fragment,o),f=!0)},o(o){w(n.$$.fragment,o),f=!1},d(o){o&&(a(e),a(t)),j(n,o)}}}function Se(F){let e,d="TF 2.0 models accepts two formats as inputs:",t,n,f="<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>",o,v,Q=`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=h("p"),e.textContent=d,t=l(),n=h("ul"),n.innerHTML=f,o=l(),v=h("p"),v.innerHTML=Q},l(m){e=u(m,"P",{"data-svelte-h":!0}),x(e)!=="svelte-ha0dwg"&&(e.textContent=d),t=i(m),n=u(m,"UL",{"data-svelte-h":!0}),x(n)!=="svelte-1ar3osv"&&(n.innerHTML=f),o=i(m),v=u(m,"P",{"data-svelte-h":!0}),x(v)!=="svelte-14kkttf"&&(v.innerHTML=Q)},m(m,Z){r(m,e,Z),r(m,t,Z),r(m,n,Z),r(m,o,Z),r(m,v,Z)},p:he,d(m){m&&(a(e),a(t),a(n),a(o),a(v))}}}function Ae(F){let e,d=`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=h("p"),e.innerHTML=d},l(t){e=u(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=d)},m(t,n){r(t,e,n)},p:he,d(t){t&&a(e)}}}function De(F){let e,d="Examples:",t,n,f;return n=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=h("p"),e.textContent=d,t=l(),M(n.$$.fragment)},l(o){e=u(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=d),t=i(o),$(n.$$.fragment,o)},m(o,v){r(o,e,v),r(o,t,v),T(n,o,v),f=!0},p:he,i(o){f||(y(n.$$.fragment,o),f=!0)},o(o){w(n.$$.fragment,o),f=!1},d(o){o&&(a(e),a(t)),j(n,o)}}}function Oe(F){let e,d,t,n,f,o,v="The bare Cvt Model transformer outputting raw hidden-states without any specific head on top.",Q,m,Z=`This model inherits from <a href="/docs/transformers/main/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.)`,de,R,ye=`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.`,ce,J,ue,U,V,ne,Y,N='The <a href="/docs/transformers/main/ja/model_doc/cvt#transformers.TFCvtModel">TFCvtModel</a> forward method, overrides the <code>__call__</code> special method.',S,B,re,A,D,P,ee,z,W,G,te,X=`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.`,Ce,se,q=`This model inherits from <a href="/docs/transformers/main/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.)`,ve,E,oe=`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.`,p,C,L,k,I,be,_e,Me='The <a href="/docs/transformers/main/ja/model_doc/cvt#transformers.TFCvtForImageClassification">TFCvtForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',we,me,pe,le,ie;return e=new $e({props:{title:"TFCvtModel",local:"transformers.TFCvtModel",headingTag:"h2"}}),n=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/main/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/main/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/main/src/transformers/models/cvt/modeling_tf_cvt.py#L916"}}),J=new je({props:{$$slots:{default:[Qe]},$$scope:{ctx:F}}}),V=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/main/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/main/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/main/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/main/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 je({props:{$$slots:{default:[Xe]},$$scope:{ctx:F}}}),A=new xe({props:{anchor:"transformers.TFCvtModel.call.example",$$slots:{default:[Ye]},$$scope:{ctx:F}}}),P=new $e({props:{title:"TFCvtForImageClassification",local:"transformers.TFCvtForImageClassification",headingTag:"h2"}}),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/main/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/main/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/main/src/transformers/models/cvt/modeling_tf_cvt.py#L985"}}),C=new je({props:{$$slots:{default:[Se]},$$scope:{ctx:F}}}),I=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/main/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/main/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/main/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/main/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>
`}}),me=new je({props:{$$slots:{default:[Ae]},$$scope:{ctx:F}}}),le=new xe({props:{anchor:"transformers.TFCvtForImageClassification.call.example",$$slots:{default:[De]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment),d=l(),t=h("div"),M(n.$$.fragment),f=l(),o=h("p"),o.textContent=v,Q=l(),m=h("p"),m.innerHTML=Z,de=l(),R=h("p"),R.innerHTML=ye,ce=l(),M(J.$$.fragment),ue=l(),U=h("div"),M(V.$$.fragment),ne=l(),Y=h("p"),Y.innerHTML=N,S=l(),M(B.$$.fragment),re=l(),M(A.$$.fragment),D=l(),M(P.$$.fragment),ee=l(),z=h("div"),M(W.$$.fragment),G=l(),te=h("p"),te.textContent=X,Ce=l(),se=h("p"),se.innerHTML=q,ve=l(),E=h("p"),E.innerHTML=oe,p=l(),M(C.$$.fragment),L=l(),k=h("div"),M(I.$$.fragment),be=l(),_e=h("p"),_e.innerHTML=Me,we=l(),M(me.$$.fragment),pe=l(),M(le.$$.fragment),this.h()},l(c){$(e.$$.fragment,c),d=i(c),t=u(c,"DIV",{class:!0});var b=fe(t);$(n.$$.fragment,b),f=i(b),o=u(b,"P",{"data-svelte-h":!0}),x(o)!=="svelte-5yjryq"&&(o.textContent=v),Q=i(b),m=u(b,"P",{"data-svelte-h":!0}),x(m)!=="svelte-x53t1u"&&(m.innerHTML=Z),de=i(b),R=u(b,"P",{"data-svelte-h":!0}),x(R)!=="svelte-1be7e3c"&&(R.innerHTML=ye),ce=i(b),$(J.$$.fragment,b),ue=i(b),U=u(b,"DIV",{class:!0});var O=fe(U);$(V.$$.fragment,O),ne=i(O),Y=u(O,"P",{"data-svelte-h":!0}),x(Y)!=="svelte-175v0m6"&&(Y.innerHTML=N),S=i(O),$(B.$$.fragment,O),re=i(O),$(A.$$.fragment,O),O.forEach(a),b.forEach(a),D=i(c),$(P.$$.fragment,c),ee=i(c),z=u(c,"DIV",{class:!0});var H=fe(z);$(W.$$.fragment,H),G=i(H),te=u(H,"P",{"data-svelte-h":!0}),x(te)!=="svelte-ztj7cy"&&(te.textContent=X),Ce=i(H),se=u(H,"P",{"data-svelte-h":!0}),x(se)!=="svelte-x53t1u"&&(se.innerHTML=q),ve=i(H),E=u(H,"P",{"data-svelte-h":!0}),x(E)!=="svelte-1be7e3c"&&(E.innerHTML=oe),p=i(H),$(C.$$.fragment,H),L=i(H),k=u(H,"DIV",{class:!0});var K=fe(k);$(I.$$.fragment,K),be=i(K),_e=u(K,"P",{"data-svelte-h":!0}),x(_e)!=="svelte-1ii6nkm"&&(_e.innerHTML=Me),we=i(K),$(me.$$.fragment,K),pe=i(K),$(le.$$.fragment,K),K.forEach(a),H.forEach(a),this.h()},h(){ge(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ge(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ge(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ge(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(c,b){T(e,c,b),r(c,d,b),r(c,t,b),T(n,t,null),g(t,f),g(t,o),g(t,Q),g(t,m),g(t,de),g(t,R),g(t,ce),T(J,t,null),g(t,ue),g(t,U),T(V,U,null),g(U,ne),g(U,Y),g(U,S),T(B,U,null),g(U,re),T(A,U,null),r(c,D,b),T(P,c,b),r(c,ee,b),r(c,z,b),T(W,z,null),g(z,G),g(z,te),g(z,Ce),g(z,se),g(z,ve),g(z,E),g(z,p),T(C,z,null),g(z,L),g(z,k),T(I,k,null),g(k,be),g(k,_e),g(k,we),T(me,k,null),g(k,pe),T(le,k,null),ie=!0},p(c,b){const O={};b&2&&(O.$$scope={dirty:b,ctx:c}),J.$set(O);const H={};b&2&&(H.$$scope={dirty:b,ctx:c}),B.$set(H);const K={};b&2&&(K.$$scope={dirty:b,ctx:c}),A.$set(K);const s={};b&2&&(s.$$scope={dirty:b,ctx:c}),C.$set(s);const _={};b&2&&(_.$$scope={dirty:b,ctx:c}),me.$set(_);const ae={};b&2&&(ae.$$scope={dirty:b,ctx:c}),le.$set(ae)},i(c){ie||(y(e.$$.fragment,c),y(n.$$.fragment,c),y(J.$$.fragment,c),y(V.$$.fragment,c),y(B.$$.fragment,c),y(A.$$.fragment,c),y(P.$$.fragment,c),y(W.$$.fragment,c),y(C.$$.fragment,c),y(I.$$.fragment,c),y(me.$$.fragment,c),y(le.$$.fragment,c),ie=!0)},o(c){w(e.$$.fragment,c),w(n.$$.fragment,c),w(J.$$.fragment,c),w(V.$$.fragment,c),w(B.$$.fragment,c),w(A.$$.fragment,c),w(P.$$.fragment,c),w(W.$$.fragment,c),w(C.$$.fragment,c),w(I.$$.fragment,c),w(me.$$.fragment,c),w(le.$$.fragment,c),ie=!1},d(c){c&&(a(d),a(t),a(D),a(ee),a(z)),j(e,c),j(n),j(J),j(V),j(B),j(A),j(P,c),j(W),j(C),j(I),j(me),j(le)}}}function Ke(F){let e,d;return e=new Ue({props:{$$slots:{default:[Oe]},$$scope:{ctx:F}}}),{c(){M(e.$$.fragment)},l(t){$(e.$$.fragment,t)},m(t,n){T(e,t,n),d=!0},p(t,n){const f={};n&2&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){d||(y(e.$$.fragment,t),d=!0)},o(t){w(e.$$.fragment,t),d=!1},d(t){j(e,t)}}}function et(F){let e,d,t,n,f,o,v,Q,m,Z='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> のパフォーマンスと効率を向上させます。',de,R,ye="論文の要約は次のとおりです。",ce,J,ue=`<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>`,U,V,ne='このモデルは <a href="https://huggingface.co/anugunj" rel="nofollow">anugunj</a> によって提供されました。元のコードは <a href="https://github.com/microsoft/CvT" rel="nofollow">ここ</a> にあります。',Y,N,S,B,re=`<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/main/ja/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> および <code>ViTForImageClassification</code> による <a href="/docs/transformers/main/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>`,A,D,P,ee,z="CvT を始めるのに役立つ公式 Hugging Face およびコミュニティ (🌎 で示される) リソースのリスト。",W,G,te,X,Ce='<li><a href="/docs/transformers/main/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>',se,q,ve="ここに含めるリソースの送信に興味がある場合は、お気軽にプル リクエストを開いてください。審査させていただきます。リソースは、既存のリソースを複製するのではなく、何か新しいものを示すことが理想的です。",E,oe,p,C,L,k,I,be=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/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.`,_e,Me,we=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,me,pe,le,ie,c,b,O,H,K;return f=new $e({props:{title:"Convolutional Vision Transformer (CvT)",local:"convolutional-vision-transformer-cvt",headingTag:"h1"}}),v=new $e({props:{title:"Overview",local:"overview",headingTag:"h2"}}),N=new $e({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),D=new $e({props:{title:"Resources",local:"resources",headingTag:"h2"}}),G=new Le({props:{pipeline:"image-classification"}}),oe=new $e({props:{title:"CvtConfig",local:"transformers.CvtConfig",headingTag:"h2"}}),L=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/main/src/transformers/models/cvt/configuration_cvt.py#L24"}}),pe=new xe({props:{anchor:"transformers.CvtConfig.example",$$slots:{default:[He]},$$scope:{ctx:F}}}),ie=new ze({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ke],pytorch:[qe]},$$scope:{ctx:F}}}),b=new Re({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/model_doc/cvt.md"}}),{c(){e=h("meta"),d=l(),t=h("p"),n=l(),M(f.$$.fragment),o=l(),M(v.$$.fragment),Q=l(),m=h("p"),m.innerHTML=Z,de=l(),R=h("p"),R.textContent=ye,ce=l(),J=h("p"),J.innerHTML=ue,U=l(),V=h("p"),V.innerHTML=ne,Y=l(),M(N.$$.fragment),S=l(),B=h("ul"),B.innerHTML=re,A=l(),M(D.$$.fragment),P=l(),ee=h("p"),ee.textContent=z,W=l(),M(G.$$.fragment),te=l(),X=h("ul"),X.innerHTML=Ce,se=l(),q=h("p"),q.textContent=ve,E=l(),M(oe.$$.fragment),p=l(),C=h("div"),M(L.$$.fragment),k=l(),I=h("p"),I.innerHTML=be,_e=l(),Me=h("p"),Me.innerHTML=we,me=l(),M(pe.$$.fragment),le=l(),M(ie.$$.fragment),c=l(),M(b.$$.fragment),O=l(),H=h("p"),this.h()},l(s){const _=Ne("svelte-u9bgzb",document.head);e=u(_,"META",{name:!0,content:!0}),_.forEach(a),d=i(s),t=u(s,"P",{}),fe(t).forEach(a),n=i(s),$(f.$$.fragment,s),o=i(s),$(v.$$.fragment,s),Q=i(s),m=u(s,"P",{"data-svelte-h":!0}),x(m)!=="svelte-f3bmm3"&&(m.innerHTML=Z),de=i(s),R=u(s,"P",{"data-svelte-h":!0}),x(R)!=="svelte-1cv3nri"&&(R.textContent=ye),ce=i(s),J=u(s,"P",{"data-svelte-h":!0}),x(J)!=="svelte-vfb256"&&(J.innerHTML=ue),U=i(s),V=u(s,"P",{"data-svelte-h":!0}),x(V)!=="svelte-1nuuuh6"&&(V.innerHTML=ne),Y=i(s),$(N.$$.fragment,s),S=i(s),B=u(s,"UL",{"data-svelte-h":!0}),x(B)!=="svelte-13r5qdx"&&(B.innerHTML=re),A=i(s),$(D.$$.fragment,s),P=i(s),ee=u(s,"P",{"data-svelte-h":!0}),x(ee)!=="svelte-1dr0h45"&&(ee.textContent=z),W=i(s),$(G.$$.fragment,s),te=i(s),X=u(s,"UL",{"data-svelte-h":!0}),x(X)!=="svelte-1ggdqyk"&&(X.innerHTML=Ce),se=i(s),q=u(s,"P",{"data-svelte-h":!0}),x(q)!=="svelte-17ytafw"&&(q.textContent=ve),E=i(s),$(oe.$$.fragment,s),p=i(s),C=u(s,"DIV",{class:!0});var ae=fe(C);$(L.$$.fragment,ae),k=i(ae),I=u(ae,"P",{"data-svelte-h":!0}),x(I)!=="svelte-dzr2y8"&&(I.innerHTML=be),_e=i(ae),Me=u(ae,"P",{"data-svelte-h":!0}),x(Me)!=="svelte-1s6wgpv"&&(Me.innerHTML=we),me=i(ae),$(pe.$$.fragment,ae),ae.forEach(a),le=i(s),$(ie.$$.fragment,s),c=i(s),$(b.$$.fragment,s),O=i(s),H=u(s,"P",{}),fe(H).forEach(a),this.h()},h(){ge(e,"name","hf:doc:metadata"),ge(e,"content",tt),ge(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,_){g(document.head,e),r(s,d,_),r(s,t,_),r(s,n,_),T(f,s,_),r(s,o,_),T(v,s,_),r(s,Q,_),r(s,m,_),r(s,de,_),r(s,R,_),r(s,ce,_),r(s,J,_),r(s,U,_),r(s,V,_),r(s,Y,_),T(N,s,_),r(s,S,_),r(s,B,_),r(s,A,_),T(D,s,_),r(s,P,_),r(s,ee,_),r(s,W,_),T(G,s,_),r(s,te,_),r(s,X,_),r(s,se,_),r(s,q,_),r(s,E,_),T(oe,s,_),r(s,p,_),r(s,C,_),T(L,C,null),g(C,k),g(C,I),g(C,_e),g(C,Me),g(C,me),T(pe,C,null),r(s,le,_),T(ie,s,_),r(s,c,_),T(b,s,_),r(s,O,_),r(s,H,_),K=!0},p(s,[_]){const ae={};_&2&&(ae.$$scope={dirty:_,ctx:s}),pe.$set(ae);const ke={};_&2&&(ke.$$scope={dirty:_,ctx:s}),ie.$set(ke)},i(s){K||(y(f.$$.fragment,s),y(v.$$.fragment,s),y(N.$$.fragment,s),y(D.$$.fragment,s),y(G.$$.fragment,s),y(oe.$$.fragment,s),y(L.$$.fragment,s),y(pe.$$.fragment,s),y(ie.$$.fragment,s),y(b.$$.fragment,s),K=!0)},o(s){w(f.$$.fragment,s),w(v.$$.fragment,s),w(N.$$.fragment,s),w(D.$$.fragment,s),w(G.$$.fragment,s),w(oe.$$.fragment,s),w(L.$$.fragment,s),w(pe.$$.fragment,s),w(ie.$$.fragment,s),w(b.$$.fragment,s),K=!1},d(s){s&&(a(d),a(t),a(n),a(o),a(Q),a(m),a(de),a(R),a(ce),a(J),a(U),a(V),a(Y),a(S),a(B),a(A),a(P),a(ee),a(W),a(te),a(X),a(se),a(q),a(E),a(p),a(C),a(le),a(c),a(O),a(H)),a(e),j(f,s),j(v,s),j(N,s),j(D,s),j(G,s),j(oe,s),j(L),j(pe),j(ie,s),j(b,s)}}}const tt='{"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},{"title":"CvtModel","local":"transformers.CvtModel","sections":[],"depth":2},{"title":"CvtForImageClassification","local":"transformers.CvtForImageClassification","sections":[],"depth":2},{"title":"TFCvtModel","local":"transformers.TFCvtModel","sections":[],"depth":2},{"title":"TFCvtForImageClassification","local":"transformers.TFCvtForImageClassification","sections":[],"depth":2}],"depth":1}';function st(F){return Ze(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pt extends Je{constructor(e){super(),We(this,e,st,et,Ie,{})}}export{pt as component};
