import{s as Mo,f as wo,o as xo,n as be}from"../chunks/scheduler.bdbef820.js";import{S as Vo,i as Fo,g as c,s as r,r as T,A as Co,h as m,f as n,c as i,j as ae,u as b,x as h,k as O,y as d,a as l,v as y,d as v,t as $,w as M}from"../chunks/index.33f81d56.js";import{T as Xe}from"../chunks/Tip.34194030.js";import{D as _e}from"../chunks/Docstring.b9574034.js";import{C as tt}from"../chunks/CodeBlock.3bad7fc9.js";import{F as Io,M as po}from"../chunks/Markdown.03194dea.js";import{E as lt}from"../chunks/ExampleCodeBlock.633185da.js";import{P as ko}from"../chunks/PipelineTag.d2f354cd.js";import{H as Le,E as jo}from"../chunks/index.9edc4842.js";function Uo(F){let t,p="Example:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVENvbmZpZyUyQyUyMFZpVE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFZpVCUyMHZpdC1iYXNlLXBhdGNoMTYtMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFZpVENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjB2aXQtYmFzZS1wYXRjaDE2LTIyNCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwVmlUTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTConfig, ViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ViT vit-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ViTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the vit-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTModel(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(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function zo(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function No(F){let t,p="Example:",o,a,_;return a=new tt({props:{code:"",highlighted:"",wrap:!1}}),{c(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function Jo(F){let t,p=`Note that we provide a script to pre-train this model on custom data in our <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining" rel="nofollow">examples
directory</a>.`;return{c(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-7i3y9o"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Wo(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Po(F){let t,p="Examples:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVEZvck1hc2tlZEltYWdlTW9kZWxpbmclMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWJhc2UtcGF0Y2gxNi0yMjQtaW4yMWslMjIpJTBBbW9kZWwlMjAlM0QlMjBWaVRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEElMEFudW1fcGF0Y2hlcyUyMCUzRCUyMChtb2RlbC5jb25maWcuaW1hZ2Vfc2l6ZSUyMCUyRiUyRiUyMG1vZGVsLmNvbmZpZy5wYXRjaF9zaXplKSUyMCoqJTIwMiUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQSUyMyUyMGNyZWF0ZSUyMHJhbmRvbSUyMGJvb2xlYW4lMjBtYXNrJTIwb2YlMjBzaGFwZSUyMChiYXRjaF9zaXplJTJDJTIwbnVtX3BhdGNoZXMpJTBBYm9vbF9tYXNrZWRfcG9zJTIwJTNEJTIwdG9yY2gucmFuZGludChsb3clM0QwJTJDJTIwaGlnaCUzRDIlMkMlMjBzaXplJTNEKDElMkMlMjBudW1fcGF0Y2hlcykpLmJvb2woKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChwaXhlbF92YWx1ZXMlMkMlMjBib29sX21hc2tlZF9wb3MlM0Rib29sX21hc2tlZF9wb3MpJTBBbG9zcyUyQyUyMHJlY29uc3RydWN0ZWRfcGl4ZWxfdmFsdWVzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTJDJTIwb3V0cHV0cy5yZWNvbnN0cnVjdGlvbiUwQWxpc3QocmVjb25zdHJ1Y3RlZF9waXhlbF92YWx1ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTForMaskedImageModeling
<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> 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;google/vit-base-patch16-224-in21k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224-in21k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create random boolean mask of shape (batch_size, num_patches)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = torch.randint(low=<span class="hljs-number">0</span>, high=<span class="hljs-number">2</span>, size=(<span class="hljs-number">1</span>, num_patches)).<span class="hljs-built_in">bool</span>()

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss, reconstructed_pixel_values = outputs.loss, outputs.reconstruction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(reconstructed_pixel_values.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>]`,wrap:!1}}),{c(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-kvfsh7"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function Zo(F){let t,p=`Note that it’s possible to fine-tune ViT on higher resolution images than the ones it has been trained on, by
setting <code>interpolate_pos_encoding</code> to <code>True</code> in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`;return{c(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-111lhr1"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Lo(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Ro(F){let t,p="Example:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTForImageClassification
<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;google/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224&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])
...`,wrap:!1}}),{c(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function Ho(F){let t,p,o,a,_,s,x="The bare Vit Model outputting raw hidden-states without any specific head on top.",re,z,E=`This model inherits from <a href="/docs/transformers/main/ko/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,ie,N,S=`This model is also 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.`,le,g,J,K,B,Se='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTModel">ViTModel</a> forward method, overrides the <code>__call__</code> special method.',ye,R,Ve,Q,te,de,Fe,j,ve,W,D,Ue='ViT Model with a decoder on top for masked image modeling, as proposed in <a href="https://arxiv.org/abs/2111.09886" rel="nofollow">SimMIM</a>.',Te,U,Ce,ee,he=`This model inherits from <a href="/docs/transformers/main/ko/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,Ie,ge,We=`This model is also 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.`,ke,X,oe,ne,ze,Y='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTForMaskedImageModeling">ViTForMaskedImageModeling</a> forward method, overrides the <code>__call__</code> special method.',ce,$e,me,pe,Ne,P,Me,Z,A,w,C,H=`ViT 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.`,G,L,we,V,I=`This model inherits from <a href="/docs/transformers/main/ko/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,ue,q,fe=`This model is also 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.`,Ke,Je,Re,ot,Be,Jt='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',nt,Pe,wt,Ge,De;return t=new Le({props:{title:"ViTModel",local:"transformers.ViTModel ][ transformers.ViTModel",headingTag:"h2"}}),a=new _e({props:{name:"class transformers.ViTModel",anchor:"transformers.ViTModel",parameters:[{name:"config",val:": ViTConfig"},{name:"add_pooling_layer",val:": bool = True"},{name:"use_mask_token",val:": bool = False"}],parametersDescription:[{anchor:"transformers.ViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.ViTModel.add_pooling_layer",description:`<strong>add_pooling_layer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a pooling layer`,name:"add_pooling_layer"},{anchor:"transformers.ViTModel.use_mask_token",description:`<strong>use_mask_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a mask token for masked image modeling.`,name:"use_mask_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_vit.py#L482"}}),J=new _e({props:{name:"forward",anchor:"transformers.ViTModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.ViTModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.ViTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTModel.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.ViTModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.ViTModel.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/ko/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/vit/modeling_vit.py#L514",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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/ko/model_doc/vit#transformers.ViTConfig"
>ViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><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.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><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 layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),R=new Xe({props:{$$slots:{default:[zo]},$$scope:{ctx:F}}}),Q=new lt({props:{anchor:"transformers.ViTModel.forward.example",$$slots:{default:[No]},$$scope:{ctx:F}}}),de=new Le({props:{title:"ViTForMaskedImageModeling",local:"transformers.ViTForMaskedImageModeling ][ transformers.ViTForMaskedImageModeling",headingTag:"h2"}}),ve=new _e({props:{name:"class transformers.ViTForMaskedImageModeling",anchor:"transformers.ViTForMaskedImageModeling",parameters:[{name:"config",val:": ViTConfig"}],parametersDescription:[{anchor:"transformers.ViTForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/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/vit/modeling_vit.py#L592"}}),U=new Xe({props:{$$slots:{default:[Jo]},$$scope:{ctx:F}}}),oe=new _e({props:{name:"forward",anchor:"transformers.ViTForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTForMaskedImageModeling.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.ViTForMaskedImageModeling.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.ViTForMaskedImageModeling.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTForMaskedImageModeling.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTForMaskedImageModeling.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.ViTForMaskedImageModeling.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.ViTForMaskedImageModeling.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/ko/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/vit/modeling_vit.py#L622",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.MaskedImageModelingOutput</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/ko/model_doc/vit#transformers.ViTConfig"
>ViTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>bool_masked_pos</code> is provided) — Reconstruction loss.</li>
<li><strong>reconstruction</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — Reconstructed / completed images.</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</li>
<li><strong>when</strong> <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, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when</li>
<li><strong><code>config.output_attentions=True</code>):</strong>
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.MaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Xe({props:{$$slots:{default:[Wo]},$$scope:{ctx:F}}}),pe=new lt({props:{anchor:"transformers.ViTForMaskedImageModeling.forward.example",$$slots:{default:[Po]},$$scope:{ctx:F}}}),P=new Le({props:{title:"ViTForImageClassification",local:"transformers.ViTForImageClassification ][ transformers.ViTForImageClassification",headingTag:"h2"}}),A=new _e({props:{name:"class transformers.ViTForImageClassification",anchor:"transformers.ViTForImageClassification",parameters:[{name:"config",val:": ViTConfig"}],parametersDescription:[{anchor:"transformers.ViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/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/vit/modeling_vit.py#L715"}}),L=new Xe({props:{$$slots:{default:[Zo]},$$scope:{ctx:F}}}),Re=new _e({props:{name:"forward",anchor:"transformers.ViTForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.ViTForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</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"},{anchor:"transformers.ViTForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTForImageClassification.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.ViTForImageClassification.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.ViTForImageClassification.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/ko/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/vit/modeling_vit.py#L742",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</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/ko/model_doc/vit#transformers.ViTConfig"
>ViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><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.</p>
</li>
<li>
<p><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).</p>
</li>
<li>
<p><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, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new Xe({props:{$$slots:{default:[Lo]},$$scope:{ctx:F}}}),Ge=new lt({props:{anchor:"transformers.ViTForImageClassification.forward.example",$$slots:{default:[Ro]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment),p=r(),o=c("div"),T(a.$$.fragment),_=r(),s=c("p"),s.textContent=x,re=r(),z=c("p"),z.innerHTML=E,ie=r(),N=c("p"),N.innerHTML=S,le=r(),g=c("div"),T(J.$$.fragment),K=r(),B=c("p"),B.innerHTML=Se,ye=r(),T(R.$$.fragment),Ve=r(),T(Q.$$.fragment),te=r(),T(de.$$.fragment),Fe=r(),j=c("div"),T(ve.$$.fragment),W=r(),D=c("p"),D.innerHTML=Ue,Te=r(),T(U.$$.fragment),Ce=r(),ee=c("p"),ee.innerHTML=he,Ie=r(),ge=c("p"),ge.innerHTML=We,ke=r(),X=c("div"),T(oe.$$.fragment),ne=r(),ze=c("p"),ze.innerHTML=Y,ce=r(),T($e.$$.fragment),me=r(),T(pe.$$.fragment),Ne=r(),T(P.$$.fragment),Me=r(),Z=c("div"),T(A.$$.fragment),w=r(),C=c("p"),C.textContent=H,G=r(),T(L.$$.fragment),we=r(),V=c("p"),V.innerHTML=I,ue=r(),q=c("p"),q.innerHTML=fe,Ke=r(),Je=c("div"),T(Re.$$.fragment),ot=r(),Be=c("p"),Be.innerHTML=Jt,nt=r(),T(Pe.$$.fragment),wt=r(),T(Ge.$$.fragment),this.h()},l(u){b(t.$$.fragment,u),p=i(u),o=m(u,"DIV",{class:!0});var k=ae(o);b(a.$$.fragment,k),_=i(k),s=m(k,"P",{"data-svelte-h":!0}),h(s)!=="svelte-532gzv"&&(s.textContent=x),re=i(k),z=m(k,"P",{"data-svelte-h":!0}),h(z)!=="svelte-u3dlub"&&(z.innerHTML=E),ie=i(k),N=m(k,"P",{"data-svelte-h":!0}),h(N)!=="svelte-hswkmf"&&(N.innerHTML=S),le=i(k),g=m(k,"DIV",{class:!0});var xe=ae(g);b(J.$$.fragment,xe),K=i(xe),B=m(xe,"P",{"data-svelte-h":!0}),h(B)!=="svelte-mg45f1"&&(B.innerHTML=Se),ye=i(xe),b(R.$$.fragment,xe),Ve=i(xe),b(Q.$$.fragment,xe),xe.forEach(n),k.forEach(n),te=i(u),b(de.$$.fragment,u),Fe=i(u),j=m(u,"DIV",{class:!0});var je=ae(j);b(ve.$$.fragment,je),W=i(je),D=m(je,"P",{"data-svelte-h":!0}),h(D)!=="svelte-hwvz1m"&&(D.innerHTML=Ue),Te=i(je),b(U.$$.fragment,je),Ce=i(je),ee=m(je,"P",{"data-svelte-h":!0}),h(ee)!=="svelte-u3dlub"&&(ee.innerHTML=he),Ie=i(je),ge=m(je,"P",{"data-svelte-h":!0}),h(ge)!=="svelte-hswkmf"&&(ge.innerHTML=We),ke=i(je),X=m(je,"DIV",{class:!0});var Ze=ae(X);b(oe.$$.fragment,Ze),ne=i(Ze),ze=m(Ze,"P",{"data-svelte-h":!0}),h(ze)!=="svelte-oemc7t"&&(ze.innerHTML=Y),ce=i(Ze),b($e.$$.fragment,Ze),me=i(Ze),b(pe.$$.fragment,Ze),Ze.forEach(n),je.forEach(n),Ne=i(u),b(P.$$.fragment,u),Me=i(u),Z=m(u,"DIV",{class:!0});var se=ae(Z);b(A.$$.fragment,se),w=i(se),C=m(se,"P",{"data-svelte-h":!0}),h(C)!=="svelte-ju5wm2"&&(C.textContent=H),G=i(se),b(L.$$.fragment,se),we=i(se),V=m(se,"P",{"data-svelte-h":!0}),h(V)!=="svelte-u3dlub"&&(V.innerHTML=I),ue=i(se),q=m(se,"P",{"data-svelte-h":!0}),h(q)!=="svelte-hswkmf"&&(q.innerHTML=fe),Ke=i(se),Je=m(se,"DIV",{class:!0});var qe=ae(Je);b(Re.$$.fragment,qe),ot=i(qe),Be=m(qe,"P",{"data-svelte-h":!0}),h(Be)!=="svelte-so4qlh"&&(Be.innerHTML=Jt),nt=i(qe),b(Pe.$$.fragment,qe),wt=i(qe),b(Ge.$$.fragment,qe),qe.forEach(n),se.forEach(n),this.h()},h(){O(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(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(u,k){y(t,u,k),l(u,p,k),l(u,o,k),y(a,o,null),d(o,_),d(o,s),d(o,re),d(o,z),d(o,ie),d(o,N),d(o,le),d(o,g),y(J,g,null),d(g,K),d(g,B),d(g,ye),y(R,g,null),d(g,Ve),y(Q,g,null),l(u,te,k),y(de,u,k),l(u,Fe,k),l(u,j,k),y(ve,j,null),d(j,W),d(j,D),d(j,Te),y(U,j,null),d(j,Ce),d(j,ee),d(j,Ie),d(j,ge),d(j,ke),d(j,X),y(oe,X,null),d(X,ne),d(X,ze),d(X,ce),y($e,X,null),d(X,me),y(pe,X,null),l(u,Ne,k),y(P,u,k),l(u,Me,k),l(u,Z,k),y(A,Z,null),d(Z,w),d(Z,C),d(Z,G),y(L,Z,null),d(Z,we),d(Z,V),d(Z,ue),d(Z,q),d(Z,Ke),d(Z,Je),y(Re,Je,null),d(Je,ot),d(Je,Be),d(Je,nt),y(Pe,Je,null),d(Je,wt),y(Ge,Je,null),De=!0},p(u,k){const xe={};k&2&&(xe.$$scope={dirty:k,ctx:u}),R.$set(xe);const je={};k&2&&(je.$$scope={dirty:k,ctx:u}),Q.$set(je);const Ze={};k&2&&(Ze.$$scope={dirty:k,ctx:u}),U.$set(Ze);const se={};k&2&&(se.$$scope={dirty:k,ctx:u}),$e.$set(se);const qe={};k&2&&(qe.$$scope={dirty:k,ctx:u}),pe.$set(qe);const dt={};k&2&&(dt.$$scope={dirty:k,ctx:u}),L.$set(dt);const Qe={};k&2&&(Qe.$$scope={dirty:k,ctx:u}),Pe.$set(Qe);const Wt={};k&2&&(Wt.$$scope={dirty:k,ctx:u}),Ge.$set(Wt)},i(u){De||(v(t.$$.fragment,u),v(a.$$.fragment,u),v(J.$$.fragment,u),v(R.$$.fragment,u),v(Q.$$.fragment,u),v(de.$$.fragment,u),v(ve.$$.fragment,u),v(U.$$.fragment,u),v(oe.$$.fragment,u),v($e.$$.fragment,u),v(pe.$$.fragment,u),v(P.$$.fragment,u),v(A.$$.fragment,u),v(L.$$.fragment,u),v(Re.$$.fragment,u),v(Pe.$$.fragment,u),v(Ge.$$.fragment,u),De=!0)},o(u){$(t.$$.fragment,u),$(a.$$.fragment,u),$(J.$$.fragment,u),$(R.$$.fragment,u),$(Q.$$.fragment,u),$(de.$$.fragment,u),$(ve.$$.fragment,u),$(U.$$.fragment,u),$(oe.$$.fragment,u),$($e.$$.fragment,u),$(pe.$$.fragment,u),$(P.$$.fragment,u),$(A.$$.fragment,u),$(L.$$.fragment,u),$(Re.$$.fragment,u),$(Pe.$$.fragment,u),$(Ge.$$.fragment,u),De=!1},d(u){u&&(n(p),n(o),n(te),n(Fe),n(j),n(Ne),n(Me),n(Z)),M(t,u),M(a),M(J),M(R),M(Q),M(de,u),M(ve),M(U),M(oe),M($e),M(pe),M(P,u),M(A),M(L),M(Re),M(Pe),M(Ge)}}}function Bo(F){let t,p;return t=new po({props:{$$slots:{default:[Ho]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment)},l(o){b(t.$$.fragment,o)},m(o,a){y(t,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),t.$set(_)},i(o){p||(v(t.$$.fragment,o),p=!0)},o(o){$(t.$$.fragment,o),p=!1},d(o){M(t,o)}}}function qo(F){let t,p="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,a,_="<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 argument.</li>",s,x,re=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,z,E,ie=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,N,S,le=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){t=c("p"),t.innerHTML=p,o=r(),a=c("ul"),a.innerHTML=_,s=r(),x=c("p"),x.innerHTML=re,z=r(),E=c("ul"),E.innerHTML=ie,N=r(),S=c("p"),S.innerHTML=le},l(g){t=m(g,"P",{"data-svelte-h":!0}),h(t)!=="svelte-1ajbfxg"&&(t.innerHTML=p),o=i(g),a=m(g,"UL",{"data-svelte-h":!0}),h(a)!=="svelte-qm1t26"&&(a.innerHTML=_),s=i(g),x=m(g,"P",{"data-svelte-h":!0}),h(x)!=="svelte-1v9qsc5"&&(x.innerHTML=re),z=i(g),E=m(g,"UL",{"data-svelte-h":!0}),h(E)!=="svelte-99h8aq"&&(E.innerHTML=ie),N=i(g),S=m(g,"P",{"data-svelte-h":!0}),h(S)!=="svelte-1an3odd"&&(S.innerHTML=le)},m(g,J){l(g,t,J),l(g,o,J),l(g,a,J),l(g,s,J),l(g,x,J),l(g,z,J),l(g,E,J),l(g,N,J),l(g,S,J)},p:be,d(g){g&&(n(t),n(o),n(a),n(s),n(x),n(z),n(E),n(N),n(S))}}}function Go(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Eo(F){let t,p="Example:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGVmlUTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEFtb2RlbCUyMCUzRCUyMFRGVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0LWluMjFrJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFViTModel
<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;google/vit-base-patch16-224-in21k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFViTModel.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224-in21k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(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
<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">197</span>, <span class="hljs-number">768</span>]`,wrap:!1}}),{c(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function So(F){let t,p=`Note that it’s possible to fine-tune ViT on higher resolution images than the ones it has been trained on, by
setting <code>interpolate_pos_encoding</code> to <code>True</code> in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`;return{c(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-111lhr1"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Do(F){let t,p="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,a,_="<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 argument.</li>",s,x,re=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,z,E,ie=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,N,S,le=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){t=c("p"),t.innerHTML=p,o=r(),a=c("ul"),a.innerHTML=_,s=r(),x=c("p"),x.innerHTML=re,z=r(),E=c("ul"),E.innerHTML=ie,N=r(),S=c("p"),S.innerHTML=le},l(g){t=m(g,"P",{"data-svelte-h":!0}),h(t)!=="svelte-1ajbfxg"&&(t.innerHTML=p),o=i(g),a=m(g,"UL",{"data-svelte-h":!0}),h(a)!=="svelte-qm1t26"&&(a.innerHTML=_),s=i(g),x=m(g,"P",{"data-svelte-h":!0}),h(x)!=="svelte-1v9qsc5"&&(x.innerHTML=re),z=i(g),E=m(g,"UL",{"data-svelte-h":!0}),h(E)!=="svelte-99h8aq"&&(E.innerHTML=ie),N=i(g),S=m(g,"P",{"data-svelte-h":!0}),h(S)!=="svelte-1an3odd"&&(S.innerHTML=le)},m(g,J){l(g,t,J),l(g,o,J),l(g,a,J),l(g,s,J),l(g,x,J),l(g,z,J),l(g,E,J),l(g,N,J),l(g,S,J)},p:be,d(g){g&&(n(t),n(o),n(a),n(s),n(x),n(z),n(E),n(N),n(S))}}}function Xo(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Yo(F){let t,p="Example:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFViTForImageClassification
<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> 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;google/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFViTForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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 = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
Egyptian cat`,wrap:!1}}),{c(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function Ao(F){let t,p,o,a,_,s,x="The bare ViT Model transformer outputting raw hidden-states without any specific head on top.",re,z,E=`This model inherits from <a href="/docs/transformers/main/ko/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.)`,ie,N,S=`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.`,le,g,J,K,B,Se,ye,R='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.TFViTModel">TFViTModel</a> forward method, overrides the <code>__call__</code> special method.',Ve,Q,te,de,Fe,j,ve,W,D,Ue,Te,U=`ViT 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,ee,he,Ie,ge=`This model inherits from <a href="/docs/transformers/main/ko/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.)`,We,ke,X=`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.`,oe,ne,ze,Y,ce,$e,me,pe='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.TFViTForImageClassification">TFViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Ne,P,Me,Z,A;return t=new Le({props:{title:"TFViTModel",local:"transformers.TFViTModel ][ transformers.TFViTModel",headingTag:"h2"}}),a=new _e({props:{name:"class transformers.TFViTModel",anchor:"transformers.TFViTModel",parameters:[{name:"config",val:": ViTConfig"},{name:"*inputs",val:""},{name:"add_pooling_layer",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/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/vit/modeling_tf_vit.py#L736"}}),g=new Xe({props:{$$slots:{default:[qo]},$$scope:{ctx:F}}}),B=new _e({props:{name:"call",anchor:"transformers.TFViTModel.call",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFViTModel.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/ko/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.TFViTModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFViTModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</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_attentions"},{anchor:"transformers.TFViTModel.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.TFViTModel.call.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.TFViTModel.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/ko/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.TFViTModel.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/vit/modeling_tf_vit.py#L746",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> 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/ko/model_doc/vit#transformers.ViTConfig"
>ViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><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.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you’re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Q=new Xe({props:{$$slots:{default:[Go]},$$scope:{ctx:F}}}),de=new lt({props:{anchor:"transformers.TFViTModel.call.example",$$slots:{default:[Eo]},$$scope:{ctx:F}}}),j=new Le({props:{title:"TFViTForImageClassification",local:"transformers.TFViTForImageClassification ][ transformers.TFViTForImageClassification",headingTag:"h2"}}),D=new _e({props:{name:"class transformers.TFViTForImageClassification",anchor:"transformers.TFViTForImageClassification",parameters:[{name:"config",val:": ViTConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/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/vit/modeling_tf_vit.py#L815"}}),ee=new Xe({props:{$$slots:{default:[So]},$$scope:{ctx:F}}}),ne=new Xe({props:{$$slots:{default:[Do]},$$scope:{ctx:F}}}),ce=new _e({props:{name:"call",anchor:"transformers.TFViTForImageClassification.call",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFViTForImageClassification.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/ko/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.TFViTForImageClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFViTForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</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_attentions"},{anchor:"transformers.TFViTForImageClassification.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.TFViTForImageClassification.call.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.TFViTForImageClassification.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/ko/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.TFViTForImageClassification.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.TFViTForImageClassification.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/vit/modeling_tf_vit.py#L845",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> 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/ko/model_doc/vit#transformers.ViTConfig"
>ViTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><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).</p>
</li>
<li>
<p><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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),P=new Xe({props:{$$slots:{default:[Xo]},$$scope:{ctx:F}}}),Z=new lt({props:{anchor:"transformers.TFViTForImageClassification.call.example",$$slots:{default:[Yo]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment),p=r(),o=c("div"),T(a.$$.fragment),_=r(),s=c("p"),s.textContent=x,re=r(),z=c("p"),z.innerHTML=E,ie=r(),N=c("p"),N.innerHTML=S,le=r(),T(g.$$.fragment),J=r(),K=c("div"),T(B.$$.fragment),Se=r(),ye=c("p"),ye.innerHTML=R,Ve=r(),T(Q.$$.fragment),te=r(),T(de.$$.fragment),Fe=r(),T(j.$$.fragment),ve=r(),W=c("div"),T(D.$$.fragment),Ue=r(),Te=c("p"),Te.textContent=U,Ce=r(),T(ee.$$.fragment),he=r(),Ie=c("p"),Ie.innerHTML=ge,We=r(),ke=c("p"),ke.innerHTML=X,oe=r(),T(ne.$$.fragment),ze=r(),Y=c("div"),T(ce.$$.fragment),$e=r(),me=c("p"),me.innerHTML=pe,Ne=r(),T(P.$$.fragment),Me=r(),T(Z.$$.fragment),this.h()},l(w){b(t.$$.fragment,w),p=i(w),o=m(w,"DIV",{class:!0});var C=ae(o);b(a.$$.fragment,C),_=i(C),s=m(C,"P",{"data-svelte-h":!0}),h(s)!=="svelte-1vbye9a"&&(s.textContent=x),re=i(C),z=m(C,"P",{"data-svelte-h":!0}),h(z)!=="svelte-3ge3jn"&&(z.innerHTML=E),ie=i(C),N=m(C,"P",{"data-svelte-h":!0}),h(N)!=="svelte-1be7e3c"&&(N.innerHTML=S),le=i(C),b(g.$$.fragment,C),J=i(C),K=m(C,"DIV",{class:!0});var H=ae(K);b(B.$$.fragment,H),Se=i(H),ye=m(H,"P",{"data-svelte-h":!0}),h(ye)!=="svelte-hguzl9"&&(ye.innerHTML=R),Ve=i(H),b(Q.$$.fragment,H),te=i(H),b(de.$$.fragment,H),H.forEach(n),C.forEach(n),Fe=i(w),b(j.$$.fragment,w),ve=i(w),W=m(w,"DIV",{class:!0});var G=ae(W);b(D.$$.fragment,G),Ue=i(G),Te=m(G,"P",{"data-svelte-h":!0}),h(Te)!=="svelte-ju5wm2"&&(Te.textContent=U),Ce=i(G),b(ee.$$.fragment,G),he=i(G),Ie=m(G,"P",{"data-svelte-h":!0}),h(Ie)!=="svelte-3ge3jn"&&(Ie.innerHTML=ge),We=i(G),ke=m(G,"P",{"data-svelte-h":!0}),h(ke)!=="svelte-1be7e3c"&&(ke.innerHTML=X),oe=i(G),b(ne.$$.fragment,G),ze=i(G),Y=m(G,"DIV",{class:!0});var L=ae(Y);b(ce.$$.fragment,L),$e=i(L),me=m(L,"P",{"data-svelte-h":!0}),h(me)!=="svelte-1yb0woh"&&(me.innerHTML=pe),Ne=i(L),b(P.$$.fragment,L),Me=i(L),b(Z.$$.fragment,L),L.forEach(n),G.forEach(n),this.h()},h(){O(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(w,C){y(t,w,C),l(w,p,C),l(w,o,C),y(a,o,null),d(o,_),d(o,s),d(o,re),d(o,z),d(o,ie),d(o,N),d(o,le),y(g,o,null),d(o,J),d(o,K),y(B,K,null),d(K,Se),d(K,ye),d(K,Ve),y(Q,K,null),d(K,te),y(de,K,null),l(w,Fe,C),y(j,w,C),l(w,ve,C),l(w,W,C),y(D,W,null),d(W,Ue),d(W,Te),d(W,Ce),y(ee,W,null),d(W,he),d(W,Ie),d(W,We),d(W,ke),d(W,oe),y(ne,W,null),d(W,ze),d(W,Y),y(ce,Y,null),d(Y,$e),d(Y,me),d(Y,Ne),y(P,Y,null),d(Y,Me),y(Z,Y,null),A=!0},p(w,C){const H={};C&2&&(H.$$scope={dirty:C,ctx:w}),g.$set(H);const G={};C&2&&(G.$$scope={dirty:C,ctx:w}),Q.$set(G);const L={};C&2&&(L.$$scope={dirty:C,ctx:w}),de.$set(L);const we={};C&2&&(we.$$scope={dirty:C,ctx:w}),ee.$set(we);const V={};C&2&&(V.$$scope={dirty:C,ctx:w}),ne.$set(V);const I={};C&2&&(I.$$scope={dirty:C,ctx:w}),P.$set(I);const ue={};C&2&&(ue.$$scope={dirty:C,ctx:w}),Z.$set(ue)},i(w){A||(v(t.$$.fragment,w),v(a.$$.fragment,w),v(g.$$.fragment,w),v(B.$$.fragment,w),v(Q.$$.fragment,w),v(de.$$.fragment,w),v(j.$$.fragment,w),v(D.$$.fragment,w),v(ee.$$.fragment,w),v(ne.$$.fragment,w),v(ce.$$.fragment,w),v(P.$$.fragment,w),v(Z.$$.fragment,w),A=!0)},o(w){$(t.$$.fragment,w),$(a.$$.fragment,w),$(g.$$.fragment,w),$(B.$$.fragment,w),$(Q.$$.fragment,w),$(de.$$.fragment,w),$(j.$$.fragment,w),$(D.$$.fragment,w),$(ee.$$.fragment,w),$(ne.$$.fragment,w),$(ce.$$.fragment,w),$(P.$$.fragment,w),$(Z.$$.fragment,w),A=!1},d(w){w&&(n(p),n(o),n(Fe),n(ve),n(W)),M(t,w),M(a),M(g),M(B),M(Q),M(de),M(j,w),M(D),M(ee),M(ne),M(ce),M(P),M(Z)}}}function Qo(F){let t,p;return t=new po({props:{$$slots:{default:[Ao]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment)},l(o){b(t.$$.fragment,o)},m(o,a){y(t,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),t.$set(_)},i(o){p||(v(t.$$.fragment,o),p=!0)},o(o){$(t.$$.fragment,o),p=!1},d(o){M(t,o)}}}function Oo(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function Ko(F){let t,p="Examples:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhWaVRNb2RlbCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWJhc2UtcGF0Y2gxNi0yMjQtaW4yMWslMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4VmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0LWluMjFrJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxViTModel
<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;google/vit-base-patch16-224-in21k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxViTModel.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224-in21k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&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(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-kvfsh7"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function en(F){let t,p=`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(){t=c("p"),t.innerHTML=p},l(o){t=m(o,"P",{"data-svelte-h":!0}),h(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){l(o,t,a)},p:be,d(o){o&&n(t)}}}function tn(F){let t,p="Example:",o,a,_;return a=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhWaVRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhWaVRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfY2xhc3NfaWR4JTIwJTNEJTIwamF4Lm51bXB5LmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpJTBBcHJpbnQoJTIyUHJlZGljdGVkJTIwY2xhc3MlM0ElMjIlMkMlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfY2xhc3NfaWR4Lml0ZW0oKSU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxViTForImageClassification
<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> jax
<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;google/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxViTForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&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 = jax.numpy.argmax(logits, axis=-<span class="hljs-number">1</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[predicted_class_idx.item()])`,wrap:!1}}),{c(){t=c("p"),t.textContent=p,o=r(),T(a.$$.fragment)},l(s){t=m(s,"P",{"data-svelte-h":!0}),h(t)!=="svelte-11lpom8"&&(t.textContent=p),o=i(s),b(a.$$.fragment,s)},m(s,x){l(s,t,x),l(s,o,x),y(a,s,x),_=!0},p:be,i(s){_||(v(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),M(a,s)}}}function on(F){let t,p,o,a,_,s,x="The bare ViT Model transformer outputting raw hidden-states without any specific head on top.",re,z,E=`This model inherits from <a href="/docs/transformers/main/ko/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`,ie,N,S=`This model is also a
<a href="https://flax.readthedocs.io/en/latest/api_reference/flax.linen/module.html" rel="nofollow">flax.linen.Module</a> subclass. Use it as
a regular Flax linen Module and refer to the Flax documentation for all matter related to general usage and
behavior.`,le,g,J="Finally, this model supports inherent JAX features such as:",K,B,Se='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',ye,R,Ve,Q,te,de="The <code>FlaxViTPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Fe,j,ve,W,D,Ue,Te,U,Ce,ee,he,Ie=`ViT 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.`,ge,We,ke=`This model inherits from <a href="/docs/transformers/main/ko/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`,X,oe,ne=`This model is also a
<a href="https://flax.readthedocs.io/en/latest/api_reference/flax.linen/module.html" rel="nofollow">flax.linen.Module</a> subclass. Use it as
a regular Flax linen Module and refer to the Flax documentation for all matter related to general usage and
behavior.`,ze,Y,ce="Finally, this model supports inherent JAX features such as:",$e,me,pe='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',Ne,P,Me,Z,A,w="The <code>FlaxViTPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",C,H,G,L,we;return t=new Le({props:{title:"FlaxVitModel",local:"transformers.FlaxViTModel ][ transformers.FlaxViTModel",headingTag:"h2"}}),a=new _e({props:{name:"class transformers.FlaxViTModel",anchor:"transformers.FlaxViTModel",parameters:[{name:"config",val:": ViTConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxViTModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/ko/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/ko/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_flax_vit.py#L553"}}),Ve=new _e({props:{name:"__call__",anchor:"transformers.FlaxViTModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": typing.Optional[dict] = None"},{name:"dropout_rng",val:": <function PRNGKey at 0x7fd5621ded40> = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_flax_vit.py#L473",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</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 (<code>&lt;class 'transformers.models.vit.configuration_vit.ViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),j=new Xe({props:{$$slots:{default:[Oo]},$$scope:{ctx:F}}}),W=new lt({props:{anchor:"transformers.FlaxViTModel.__call__.example",$$slots:{default:[Ko]},$$scope:{ctx:F}}}),Ue=new Le({props:{title:"FlaxViTForImageClassification",local:"transformers.FlaxViTForImageClassification ][ transformers.FlaxViTForImageClassification",headingTag:"h2"}}),Ce=new _e({props:{name:"class transformers.FlaxViTForImageClassification",anchor:"transformers.FlaxViTForImageClassification",parameters:[{name:"config",val:": ViTConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTConfig">ViTConfig</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/ko/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxViTForImageClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/ko/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/ko/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_flax_vit.py#L633"}}),Me=new _e({props:{name:"__call__",anchor:"transformers.FlaxViTForImageClassification.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": typing.Optional[dict] = None"},{name:"dropout_rng",val:": <function PRNGKey at 0x7fd5621ded40> = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_flax_vit.py#L473",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</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 (<code>&lt;class 'transformers.models.vit.configuration_vit.ViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/ko/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),H=new Xe({props:{$$slots:{default:[en]},$$scope:{ctx:F}}}),L=new lt({props:{anchor:"transformers.FlaxViTForImageClassification.__call__.example",$$slots:{default:[tn]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment),p=r(),o=c("div"),T(a.$$.fragment),_=r(),s=c("p"),s.textContent=x,re=r(),z=c("p"),z.innerHTML=E,ie=r(),N=c("p"),N.innerHTML=S,le=r(),g=c("p"),g.textContent=J,K=r(),B=c("ul"),B.innerHTML=Se,ye=r(),R=c("div"),T(Ve.$$.fragment),Q=r(),te=c("p"),te.innerHTML=de,Fe=r(),T(j.$$.fragment),ve=r(),T(W.$$.fragment),D=r(),T(Ue.$$.fragment),Te=r(),U=c("div"),T(Ce.$$.fragment),ee=r(),he=c("p"),he.textContent=Ie,ge=r(),We=c("p"),We.innerHTML=ke,X=r(),oe=c("p"),oe.innerHTML=ne,ze=r(),Y=c("p"),Y.textContent=ce,$e=r(),me=c("ul"),me.innerHTML=pe,Ne=r(),P=c("div"),T(Me.$$.fragment),Z=r(),A=c("p"),A.innerHTML=w,C=r(),T(H.$$.fragment),G=r(),T(L.$$.fragment),this.h()},l(V){b(t.$$.fragment,V),p=i(V),o=m(V,"DIV",{class:!0});var I=ae(o);b(a.$$.fragment,I),_=i(I),s=m(I,"P",{"data-svelte-h":!0}),h(s)!=="svelte-1vbye9a"&&(s.textContent=x),re=i(I),z=m(I,"P",{"data-svelte-h":!0}),h(z)!=="svelte-qqhrqm"&&(z.innerHTML=E),ie=i(I),N=m(I,"P",{"data-svelte-h":!0}),h(N)!=="svelte-10nfsf3"&&(N.innerHTML=S),le=i(I),g=m(I,"P",{"data-svelte-h":!0}),h(g)!=="svelte-1pplc4a"&&(g.textContent=J),K=i(I),B=m(I,"UL",{"data-svelte-h":!0}),h(B)!=="svelte-1w7z84m"&&(B.innerHTML=Se),ye=i(I),R=m(I,"DIV",{class:!0});var ue=ae(R);b(Ve.$$.fragment,ue),Q=i(ue),te=m(ue,"P",{"data-svelte-h":!0}),h(te)!=="svelte-8rbifc"&&(te.innerHTML=de),Fe=i(ue),b(j.$$.fragment,ue),ve=i(ue),b(W.$$.fragment,ue),ue.forEach(n),I.forEach(n),D=i(V),b(Ue.$$.fragment,V),Te=i(V),U=m(V,"DIV",{class:!0});var q=ae(U);b(Ce.$$.fragment,q),ee=i(q),he=m(q,"P",{"data-svelte-h":!0}),h(he)!=="svelte-ju5wm2"&&(he.textContent=Ie),ge=i(q),We=m(q,"P",{"data-svelte-h":!0}),h(We)!=="svelte-qqhrqm"&&(We.innerHTML=ke),X=i(q),oe=m(q,"P",{"data-svelte-h":!0}),h(oe)!=="svelte-10nfsf3"&&(oe.innerHTML=ne),ze=i(q),Y=m(q,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1pplc4a"&&(Y.textContent=ce),$e=i(q),me=m(q,"UL",{"data-svelte-h":!0}),h(me)!=="svelte-1w7z84m"&&(me.innerHTML=pe),Ne=i(q),P=m(q,"DIV",{class:!0});var fe=ae(P);b(Me.$$.fragment,fe),Z=i(fe),A=m(fe,"P",{"data-svelte-h":!0}),h(A)!=="svelte-8rbifc"&&(A.innerHTML=w),C=i(fe),b(H.$$.fragment,fe),G=i(fe),b(L.$$.fragment,fe),fe.forEach(n),q.forEach(n),this.h()},h(){O(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(V,I){y(t,V,I),l(V,p,I),l(V,o,I),y(a,o,null),d(o,_),d(o,s),d(o,re),d(o,z),d(o,ie),d(o,N),d(o,le),d(o,g),d(o,K),d(o,B),d(o,ye),d(o,R),y(Ve,R,null),d(R,Q),d(R,te),d(R,Fe),y(j,R,null),d(R,ve),y(W,R,null),l(V,D,I),y(Ue,V,I),l(V,Te,I),l(V,U,I),y(Ce,U,null),d(U,ee),d(U,he),d(U,ge),d(U,We),d(U,X),d(U,oe),d(U,ze),d(U,Y),d(U,$e),d(U,me),d(U,Ne),d(U,P),y(Me,P,null),d(P,Z),d(P,A),d(P,C),y(H,P,null),d(P,G),y(L,P,null),we=!0},p(V,I){const ue={};I&2&&(ue.$$scope={dirty:I,ctx:V}),j.$set(ue);const q={};I&2&&(q.$$scope={dirty:I,ctx:V}),W.$set(q);const fe={};I&2&&(fe.$$scope={dirty:I,ctx:V}),H.$set(fe);const Ke={};I&2&&(Ke.$$scope={dirty:I,ctx:V}),L.$set(Ke)},i(V){we||(v(t.$$.fragment,V),v(a.$$.fragment,V),v(Ve.$$.fragment,V),v(j.$$.fragment,V),v(W.$$.fragment,V),v(Ue.$$.fragment,V),v(Ce.$$.fragment,V),v(Me.$$.fragment,V),v(H.$$.fragment,V),v(L.$$.fragment,V),we=!0)},o(V){$(t.$$.fragment,V),$(a.$$.fragment,V),$(Ve.$$.fragment,V),$(j.$$.fragment,V),$(W.$$.fragment,V),$(Ue.$$.fragment,V),$(Ce.$$.fragment,V),$(Me.$$.fragment,V),$(H.$$.fragment,V),$(L.$$.fragment,V),we=!1},d(V){V&&(n(p),n(o),n(D),n(Te),n(U)),M(t,V),M(a),M(Ve),M(j),M(W),M(Ue,V),M(Ce),M(Me),M(H),M(L)}}}function nn(F){let t,p;return t=new po({props:{$$slots:{default:[on]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment)},l(o){b(t.$$.fragment,o)},m(o,a){y(t,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),t.$set(_)},i(o){p||(v(t.$$.fragment,o),p=!0)},o(o){$(t.$$.fragment,o),p=!1},d(o){M(t,o)}}}function sn(F){let t,p,o,a,_,s,x,re,z,E='Vision Transformer (ViT) 모델은 Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby가 제안한 논문 <a href="https://arxiv.org/abs/2010.11929" rel="nofollow">An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale</a>에서 소개되었습니다. 이는 Transformer 인코더를 ImageNet에서 성공적으로 훈련시킨 첫 번째 논문으로, 기존의 잘 알려진 합성곱 신경망(CNN) 구조와 비교해 매우 우수한 결과를 달성했습니다.',ie,N,S="논문의 초록은 다음과 같습니다:",le,g,J="<em>Transformer 아키텍처는 자연어 처리 작업에서 사실상 표준으로 자리 잡았으나, 컴퓨터 비전 분야에서의 적용은 여전히 제한적입니다. 비전에서 어텐션 메커니즘은 종종 합성곱 신경망(CNN)과 결합하여 사용되거나, 전체 구조를 유지하면서 합성곱 신경망의 특정 구성 요소를 대체하는 데 사용됩니다. 우리는 이러한 CNN 의존성이 필요하지 않으며, 이미지 패치를 순차적으로 입력받는 순수한 Transformer가 이미지 분류 작업에서 매우 우수한 성능을 발휘할 수 있음을 보여줍니다. 대규모 데이터로 사전 학습된 후, ImageNet, CIFAR-100, VTAB 등 다양한 중소형 이미지 인식 벤치마크에 적용하면 Vision Transformer(ViT)는 최신 합성곱 신경망과 비교해 매우 우수한 성능을 발휘하면서도 훈련에 필요한 계산 자원을 상당히 줄일 수 있습니다.</em>",K,B,Se,ye,R,Ve='ViT 아키텍처. <a href="https://arxiv.org/abs/2010.11929">원본 논문</a>에서 발췌.',Q,te,de="원래의 Vision Transformer에 이어, 여러 후속 연구들이 진행되었습니다:",Fe,j,ve=`<li><p><a href="deit">DeiT</a> (Data-efficient Image Transformers) (Facebook AI 개발). DeiT 모델은 distilled vision transformers입니다.
DeiT의 저자들은 더 효율적으로 훈련된 ViT 모델도 공개했으며, 이는 <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTModel">ViTModel</a> 또는 <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a>에 바로 사용할 수 있습니다. 여기에는 3가지 크기로 4개의 변형이 제공됩니다: <em>facebook/deit-tiny-patch16-224</em>, <em>facebook/deit-small-patch16-224</em>, <em>facebook/deit-base-patch16-224</em> and <em>facebook/deit-base-patch16-384</em>. 그리고 모델에 이미지를 준비하려면 <code>DeiTImageProcessor</code>를 사용해야 한다는 점에 유의하십시오.</p></li> <li><p><a href="beit">BEiT</a> (BERT pre-training of Image Transformers) (Microsoft Research 개발). BEiT 모델은 BERT (masked image modeling)에 영감을  받고 VQ-VAE에 기반한 self-supervised 방법을 이용하여 supervised pre-trained vision transformers보다 더 우수한 성능을 보입니다.</p></li> <li><p>DINO (Vision Transformers의 self-supervised 훈련을 위한 방법) (Facebook AI 개발). DINO 방법으로 훈련된 Vision Transformer는 학습되지 않은 상태에서도 객체를 분할할 수 있는 합성곱 신경망에서는 볼 수 없는 매우 흥미로운 능력을 보여줍니다. DINO 체크포인트는 <a href="https://huggingface.co/models?other=dino" rel="nofollow">hub</a>에서 찾을 수 있습니다.</p></li> <li><p><a href="vit_mae">MAE</a> (Masked Autoencoders) (Facebook AI 개발). Vision Transformer를 비대칭 인코더-디코더 아키텍처를 사용하여 마스크된 패치의 높은 비율(75%)에서 픽셀 값을 재구성하도록 사전 학습함으로써, 저자들은 이 간단한 방법이 미세 조정 후 supervised 방식의 사전 학습을 능가한다는 것을 보여주었습니다.</p></li>`,W,D,Ue='이 모델은 <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>에 의해 기여되었습니다. 원본 코드(JAX로 작성됨)은 <a href="https://github.com/google-research/vision_transformer" rel="nofollow">여기</a>에서 확인할 수 있습니다.',Te,U,Ce='참고로, 우리는 Ross Wightman의 <a href="https://github.com/rwightman/pytorch-image-models" rel="nofollow">timm 라이브러리</a>에서 JAX에서 PyTorch로 변환된 가중치를 다시 변환했습니다. 모든 공로는 그에게 돌립니다!',ee,he,Ie,ge,We='<li>Transformer 인코더에 이미지를 입력하기 위해, 각 이미지는 고정 크기의 겹치지 않는 패치들로 분할된 후 선형 임베딩됩니다. 전체 이미지를 대표하는 [CLS] 토큰이 추가되어, 분류에 사용할 수 있습니다. 저자들은 또한 절대 위치 임베딩을 추가하여, 결과적으로 생성된 벡터 시퀀스를 표준 Transformer 인코더에 입력합니다.</li> <li>Vision Transformer는 모든 이미지가 동일한 크기(해상도)여야 하므로, [ViTImageProcessor]를 사용하여 이미지를 모델에 맞게 리사이즈(또는 리스케일)하고 정규화할 수 있습니다.</li> <li>사전 학습이나 미세 조정 시 사용된 패치 해상도와 이미지 해상도는 각 체크포인트의 이름에 반영됩니다. 예를 들어, <code>google/vit-base-patch16-224</code>는 패치 해상도가 16x16이고 미세 조정 해상도가 224x224인 기본 크기 아키텍처를 나타냅니다. 모든 체크포인트는 <a href="https://huggingface.co/models?search=vit" rel="nofollow">hub</a>에서 확인할 수 있습니다.</li> <li>사용할 수 있는 체크포인트는 (1) <a href="http://www.image-net.org/" rel="nofollow">ImageNet-21k</a> (1,400만 개의 이미지와 21,000개의 클래스)에서만 사전 학습되었거나, 또는 (2) <a href="http://www.image-net.org/challenges/LSVRC/2012/" rel="nofollow">ImageNet</a> (ILSVRC 2012, 130만 개의 이미지와 1,000개의 클래스)에서 추가로 미세 조정된 경우입니다.</li> <li>Vision Transformer는 224x224 해상도로 사전 학습되었습니다. 미세 조정 시, 사전 학습보다 더 높은 해상도를 사용하는 것이 유리한 경우가 많습니다 (<a href="https://arxiv.org/abs/1906.06423" rel="nofollow">(Touvron et al., 2019)</a>, <a href="https://arxiv.org/abs/1912.11370" rel="nofollow">(Kolesnikovet al., 2020)</a>. 더 높은 해상도로 미세 조정하기 위해, 저자들은 원본 이미지에서의 위치에 따라 사전 학습된 위치 임베딩의 2D 보간(interpolation)을 수행합니다.</li> <li>최고의 결과는 supervised 방식의 사전 학습에서 얻어졌으며, 이는 NLP에서는 해당되지 않는 경우가 많습니다. 저자들은 마스크된 패치 예측(마스크된 언어 모델링에서 영감을 받은 self-supervised 사전 학습 목표)을 사용한 실험도 수행했습니다. 이 접근 방식으로 더 작은 ViT-B/16 모델은 ImageNet에서 79.9%의 정확도를 달성하였으며, 이는 처음부터 학습한 것보다 2% 개선된 결과이지만, 여전히 supervised 사전 학습보다 4% 낮습니다.</li>',ke,X,oe,ne,ze='PyTorch는 <code>torch.nn.functional</code>의 일부로서 native scaled dot-product attention (SDPA) 연산자를 포함하고 있습니다. 이 함수는 입력 및 사용 중인 하드웨어에 따라 여러 구현 방식을 적용할 수 있습니다.자세한 내용은 <a href="https://pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow">공식 문서</a>나 <a href="https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#pytorch-scaled-dot-product-attention" rel="nofollow">GPU 추론</a> 페이지를 참조하십시오.',Y,ce,$e="SDPA는 <code>torch&gt;=2.1.1</code>에서 구현이 가능한 경우 기본적으로 사용되지만, <code>from_pretrained()</code>에서 <code>attn_implementation=&quot;sdpa&quot;</code>로 설정하여 SDPA를 명시적으로 요청할 수도 있습니다.",me,pe,Ne,P,Me="최적의 속도 향상을 위해 모델을 반정밀도(예: <code>torch.float16</code> 또는 <code>torch.bfloat16</code>)로 로드하는 것을 권장합니다.",Z,A,w="로컬 벤치마크(A100-40GB, PyTorch 2.3.0, OS Ubuntu 22.04)에서 <code>float32</code>와 <code>google/vit-base-patch16-224</code> 모델을 사용한 추론 시, 다음과 같은 속도 향상을 확인했습니다.",C,H,G="<thead><tr><th>Batch size</th> <th>Average inference time (ms), eager mode</th> <th>Average inference time (ms), sdpa model</th> <th>Speed up, Sdpa / Eager (x)</th></tr></thead> <tbody><tr><td>1</td> <td>7</td> <td>6</td> <td>1.17</td></tr> <tr><td>2</td> <td>8</td> <td>6</td> <td>1.33</td></tr> <tr><td>4</td> <td>8</td> <td>6</td> <td>1.33</td></tr> <tr><td>8</td> <td>8</td> <td>6</td> <td>1.33</td></tr></tbody>",L,we,V,I,ue='ViT의 추론 및 커스텀 데이터에 대한 미세 조정과 관련된 데모 노트북은 <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer" rel="nofollow">여기</a>에서 확인할 수 있습니다. Hugging Face에서 공식적으로 제공하는 자료와 커뮤니티(🌎로 표시된) 자료 목록은 ViT를 시작하는 데 도움이 될 것입니다. 이 목록에 포함될 자료를 제출하고 싶다면 Pull Request를 열어 주시면 검토하겠습니다. 새로운 내용을 설명하는 자료가 가장 이상적이며, 기존 자료를 중복하지 않도록 해주십시오.',q,fe,Ke="<code>ViTForImageClassification</code> 은 다음에서 지원됩니다:",Je,Re,ot,Be,Jt='<li><a href="https://huggingface.co/blog/fine-tune-vit" rel="nofollow">Hugging Face Transformers로 ViT를 이미지 분류에 맞게 미세 조정하는 방법</a>에 대한 블로그 포스트</li> <li><a href="https://www.philschmid.de/image-classification-huggingface-transformers-keras" rel="nofollow">Hugging Face Transformers와 <code>Keras</code>를 사용한 이미지 분류</a>에 대한 블로그 포스트</li> <li><a href="https://github.com/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">Hugging Face Transformers를 사용한 이미지 분류 미세 조정</a>에 대한 노트북</li> <li><a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Fine_tuning_the_Vision_Transformer_on_CIFAR_10_with_the_%F0%9F%A4%97_Trainer.ipynb" rel="nofollow">Hugging Face Trainer로 CIFAR-10에서 Vision Transformer 미세 조정</a>에 대한 노트북</li> <li><a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Fine_tuning_the_Vision_Transformer_on_CIFAR_10_with_PyTorch_Lightning.ipynb" rel="nofollow">PyTorch Lightning으로 CIFAR-10에서 Vision Transformer 미세 조정</a>에 대한 노트북</li>',nt,Pe,wt="⚗️ 최적화",Ge,De,u='<li><a href="https://www.philschmid.de/optimizing-vision-transformer" rel="nofollow">Optimum을 사용한 양자화를 통해 Vision Transformer(ViT) 가속</a>에 대한 블로그 포스트</li>',k,xe,je="⚡️ 추론",Ze,se,qe='<li><a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Quick_demo_of_HuggingFace_version_of_Vision_Transformer_inference.ipynb" rel="nofollow">Google Brain의 Vision Transformer(ViT) 빠른 데모</a>에 대한 노트북</li>',dt,Qe,Wt="🚀 배포",Zt,ct,fo='<li><a href="https://huggingface.co/blog/tf-serving-vision" rel="nofollow">TF Serving으로 Hugging Face에서 Tensorflow Vision 모델 배포</a>에 대한 블로그 포스트</li> <li><a href="https://huggingface.co/blog/deploy-vertex-ai" rel="nofollow">Vertex AI에서 Hugging Face ViT 배포</a>에 대한 블로그 포스트</li> <li><a href="https://huggingface.co/blog/deploy-tfserving-kubernetes" rel="nofollow">TF Serving을 사용하여 Kubernetes에서 Hugging Face ViT 배포</a>에 대한 블로그 포스트</li>',Lt,mt,Rt,Ee,pt,Kt,xt,ho=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTModel">ViTModel</a>. It is used to instantiate an ViT
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 ViT
<a href="https://huggingface.co/google/vit-base-patch16-224" rel="nofollow">google/vit-base-patch16-224</a> architecture.`,eo,Vt,go=`Configuration objects inherit from <a href="/docs/transformers/main/ko/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/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,to,st,Ht,ft,Bt,et,ht,oo,at,gt,no,Ft,uo="Preprocess an image or a batch of images.",qt,ut,Gt,Ye,_t,so,Ct,_o="Constructs a ViT image processor.",ao,rt,Tt,ro,It,To="Preprocess an image or batch of images.",Et,bt,St,He,yt,io,kt,bo="Constructs a fast Vit image processor.",lo,jt,yo=`data_format (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>):
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.
input_data_format (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>):
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:`,co,Ut,vo=`<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> <li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> <li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.
device (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>):
The device to process the images on. If unset, the device is inferred from the input images.</li>`,mo,zt,vt,Dt,it,Xt,$t,Yt,Pt,At;return _=new Le({props:{title:"Vision Transformer (ViT)",local:"vision-transformer-vit",headingTag:"h1"}}),x=new Le({props:{title:"개요",local:"overview",headingTag:"h2"}}),he=new Le({props:{title:"사용 팁",local:"usage-tips",headingTag:"h2"}}),X=new Le({props:{title:"Scaled Dot Product Attention (SDPA) 사용하기",local:"using-scaled-dot-product-attention-sdpa",headingTag:"h3"}}),pe=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFtb2RlbCUyMCUzRCUyMFZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0JTIyJTJDJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMnNkcGElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBLi4u",highlighted:`from transformers import ViTForImageClassification
model = <span class="hljs-module-access"><span class="hljs-module"><span class="hljs-identifier">ViTForImageClassification</span>.</span></span>from<span class="hljs-constructor">_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>, <span class="hljs-params">attn_implementation</span>=<span class="hljs-string">&quot;sdpa&quot;</span>, <span class="hljs-params">torch_dtype</span>=<span class="hljs-params">torch</span>.<span class="hljs-params">float16</span>)</span>
...`,wrap:!1}}),we=new Le({props:{title:"리소스",local:"resources",headingTag:"h2"}}),Re=new ko({props:{pipeline:"image-classification"}}),mt=new Le({props:{title:"ViTConfig",local:"transformers.ViTConfig ][ transformers.ViTConfig",headingTag:"h2"}}),pt=new _e({props:{name:"class transformers.ViTConfig",anchor:"transformers.ViTConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"encoder_stride",val:" = 16"},{name:"pooler_output_size",val:" = None"},{name:"pooler_act",val:" = 'tanh'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ViTConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.ViTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ViTConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ViTConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ViTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ViTConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ViTConfig.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.ViTConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ViTConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.ViTConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.ViTConfig.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.ViTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.ViTConfig.encoder_stride",description:`<strong>encoder_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Factor to increase the spatial resolution by in the decoder head for masked image modeling.`,name:"encoder_stride"},{anchor:"transformers.ViTConfig.pooler_output_size",description:`<strong>pooler_output_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of the pooler layer. If None, defaults to <code>hidden_size</code>.`,name:"pooler_output_size"},{anchor:"transformers.ViTConfig.pooler_act",description:`<strong>pooler_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;tanh&quot;</code>) &#x2014;
The activation function to be used by the pooler. Keys of ACT2FN are supported for Flax and
Pytorch, and elements of <a href="https://www.tensorflow.org/api_docs/python/tf/keras/activations" rel="nofollow">https://www.tensorflow.org/api_docs/python/tf/keras/activations</a> are
supported for Tensorflow.`,name:"pooler_act"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/configuration_vit.py#L30"}}),st=new lt({props:{anchor:"transformers.ViTConfig.example",$$slots:{default:[Uo]},$$scope:{ctx:F}}}),ft=new Le({props:{title:"ViTFeatureExtractor",local:"transformers.ViTFeatureExtractor ][ transformers.ViTFeatureExtractor",headingTag:"h2"}}),ht=new _e({props:{name:"class transformers.ViTFeatureExtractor",anchor:"transformers.ViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/feature_extraction_vit.py#L27"}}),gt=new _e({props:{name:"__call__",anchor:"transformers.ViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L42"}}),ut=new Le({props:{title:"ViTImageProcessor",local:"transformers.ViTImageProcessor ][ transformers.ViTImageProcessor",headingTag:"h2"}}),_t=new _e({props:{name:"class transformers.ViTImageProcessor",anchor:"transformers.ViTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code>. Can be overridden by the <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ViTImageProcessor.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.ViTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ViTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ViTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ViTImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.ViTImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ViTImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ViTImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/image_processing_vit.py#L43"}}),Tt=new _e({props:{name:"preprocess",anchor:"transformers.ViTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"do_convert_rgb",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ViTImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ViTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Dictionary in the format <code>{&quot;height&quot;: h, &quot;width&quot;: w}</code> specifying the size of the output image after
resizing.`,name:"size"},{anchor:"transformers.ViTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
<code>PILImageResampling</code> filter to use if resizing the image e.g. <code>PILImageResampling.BILINEAR</code>. Only has
an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ViTImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.ViTImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ViTImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ViTImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ViTImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.ViTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.ViTImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.ViTImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.ViTImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/image_processing_vit.py#L153"}}),bt=new Le({props:{title:"ViTImageProcessorFast",local:"transformers.ViTImageProcessorFast ][ transformers.ViTImageProcessorFast",headingTag:"h2"}}),yt=new _e({props:{name:"class transformers.ViTImageProcessorFast",anchor:"transformers.ViTImageProcessorFast",parameters:[{name:"**kwargs",val:": typing_extensions.Unpack[transformers.image_processing_utils_fast.DefaultFastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.ViTImageProcessorFast.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ViTImageProcessorFast.size",description:`<strong>size</strong> (<code>dict[str, int]</code>, <em>optional</em>, defaults to <code>{&apos;height&apos; -- 224, &apos;width&apos;: 224}</code>):
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.ViTImageProcessorFast.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.ViTImageProcessorFast.resample",description:`<strong>resample</strong> (<code>Union[PILImageResampling, F.InterpolationMode, NoneType]</code>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ViTImageProcessorFast.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ViTImageProcessorFast.crop_size",description:`<strong>crop_size</strong> (<code>dict[str, int]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.ViTImageProcessorFast.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ViTImageProcessorFast.rescale_factor",description:`<strong>rescale_factor</strong> (<code>Union[int, float, NoneType]</code>, defaults to <code>0.00392156862745098</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ViTImageProcessorFast.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ViTImageProcessorFast.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, list[float], NoneType]</code>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ViTImageProcessorFast.image_std",description:`<strong>image_std</strong> (<code>Union[float, list[float], NoneType]</code>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ViTImageProcessorFast.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ViTImageProcessorFast.return_tensors",description:"<strong>return_tensors</strong> (<code>Union[str, ~utils.generic.TensorType, NoneType]</code>, defaults to <code>None</code>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.ViTImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ViTImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.ViTImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"},{anchor:"transformers.ViTImageProcessorFast.Returns",description:"<strong>Returns</strong> stacked tensors if set to `pt, otherwise returns a list of tensors. &#x2014;",name:"Returns"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/image_processing_vit_fast.py#L30"}}),vt=new _e({props:{name:"preprocess",anchor:"transformers.ViTImageProcessorFast.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"*args",val:""},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.image_processing_utils_fast.DefaultFastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.ViTImageProcessorFast.preprocess.images",description:`<strong>images</strong> (<code>Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[&apos;PIL.Image.Image&apos;], list[numpy.ndarray], list[&apos;torch.Tensor&apos;]]</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ViTImageProcessorFast.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ViTImageProcessorFast.preprocess.size",description:`<strong>size</strong> (<code>dict[str, int]</code>, <em>optional</em>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.ViTImageProcessorFast.preprocess.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.ViTImageProcessorFast.preprocess.resample",description:`<strong>resample</strong> (<code>Union[PILImageResampling, F.InterpolationMode, NoneType]</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ViTImageProcessorFast.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ViTImageProcessorFast.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>dict[str, int]</code>, <em>optional</em>) &#x2014;
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.ViTImageProcessorFast.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ViTImageProcessorFast.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>Union[int, float, NoneType]</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ViTImageProcessorFast.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ViTImageProcessorFast.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, list[float], NoneType]</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ViTImageProcessorFast.preprocess.image_std",description:`<strong>image_std</strong> (<code>Union[float, list[float], NoneType]</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ViTImageProcessorFast.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ViTImageProcessorFast.preprocess.return_tensors",description:"<strong>return_tensors</strong> (<code>Union[str, ~utils.generic.TensorType, NoneType]</code>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.ViTImageProcessorFast.preprocess.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ViTImageProcessorFast.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.ViTImageProcessorFast.preprocess.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils_fast.py#L571",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><strong>data</strong> (<code>dict</code>) — Dictionary of lists/arrays/tensors returned by the <strong>call</strong> method (‘pixel_values’, etc.).</li>
<li><strong>tensor_type</strong> (<code>Union[None, str, TensorType]</code>, <em>optional</em>) — You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>&lt;class 'transformers.image_processing_base.BatchFeature'&gt;</code></p>
`}}),it=new Io({props:{pytorch:!0,tensorflow:!0,jax:!0,$$slots:{jax:[nn],tensorflow:[Qo],pytorch:[Bo]},$$scope:{ctx:F}}}),$t=new jo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/model_doc/vit.md"}}),{c(){t=c("meta"),p=r(),o=c("p"),a=r(),T(_.$$.fragment),s=r(),T(x.$$.fragment),re=r(),z=c("p"),z.innerHTML=E,ie=r(),N=c("p"),N.textContent=S,le=r(),g=c("p"),g.innerHTML=J,K=r(),B=c("img"),ye=r(),R=c("small"),R.innerHTML=Ve,Q=r(),te=c("p"),te.textContent=de,Fe=r(),j=c("ul"),j.innerHTML=ve,W=r(),D=c("p"),D.innerHTML=Ue,Te=r(),U=c("p"),U.innerHTML=Ce,ee=r(),T(he.$$.fragment),Ie=r(),ge=c("ul"),ge.innerHTML=We,ke=r(),T(X.$$.fragment),oe=r(),ne=c("p"),ne.innerHTML=ze,Y=r(),ce=c("p"),ce.innerHTML=$e,me=r(),T(pe.$$.fragment),Ne=r(),P=c("p"),P.innerHTML=Me,Z=r(),A=c("p"),A.innerHTML=w,C=r(),H=c("table"),H.innerHTML=G,L=r(),T(we.$$.fragment),V=r(),I=c("p"),I.innerHTML=ue,q=r(),fe=c("p"),fe.innerHTML=Ke,Je=r(),T(Re.$$.fragment),ot=r(),Be=c("ul"),Be.innerHTML=Jt,nt=r(),Pe=c("p"),Pe.textContent=wt,Ge=r(),De=c("ul"),De.innerHTML=u,k=r(),xe=c("p"),xe.textContent=je,Ze=r(),se=c("ul"),se.innerHTML=qe,dt=r(),Qe=c("p"),Qe.textContent=Wt,Zt=r(),ct=c("ul"),ct.innerHTML=fo,Lt=r(),T(mt.$$.fragment),Rt=r(),Ee=c("div"),T(pt.$$.fragment),Kt=r(),xt=c("p"),xt.innerHTML=ho,eo=r(),Vt=c("p"),Vt.innerHTML=go,to=r(),T(st.$$.fragment),Ht=r(),T(ft.$$.fragment),Bt=r(),et=c("div"),T(ht.$$.fragment),oo=r(),at=c("div"),T(gt.$$.fragment),no=r(),Ft=c("p"),Ft.textContent=uo,qt=r(),T(ut.$$.fragment),Gt=r(),Ye=c("div"),T(_t.$$.fragment),so=r(),Ct=c("p"),Ct.textContent=_o,ao=r(),rt=c("div"),T(Tt.$$.fragment),ro=r(),It=c("p"),It.textContent=To,Et=r(),T(bt.$$.fragment),St=r(),He=c("div"),T(yt.$$.fragment),io=r(),kt=c("p"),kt.textContent=bo,lo=r(),jt=c("p"),jt.innerHTML=yo,co=r(),Ut=c("ul"),Ut.innerHTML=vo,mo=r(),zt=c("div"),T(vt.$$.fragment),Dt=r(),T(it.$$.fragment),Xt=r(),T($t.$$.fragment),Yt=r(),Pt=c("p"),this.h()},l(e){const f=Co("svelte-u9bgzb",document.head);t=m(f,"META",{name:!0,content:!0}),f.forEach(n),p=i(e),o=m(e,"P",{}),ae(o).forEach(n),a=i(e),b(_.$$.fragment,e),s=i(e),b(x.$$.fragment,e),re=i(e),z=m(e,"P",{"data-svelte-h":!0}),h(z)!=="svelte-m3xvsu"&&(z.innerHTML=E),ie=i(e),N=m(e,"P",{"data-svelte-h":!0}),h(N)!=="svelte-e5r8wp"&&(N.textContent=S),le=i(e),g=m(e,"P",{"data-svelte-h":!0}),h(g)!=="svelte-5cj3dm"&&(g.innerHTML=J),K=i(e),B=m(e,"IMG",{src:!0,alt:!0,width:!0}),ye=i(e),R=m(e,"SMALL",{"data-svelte-h":!0}),h(R)!=="svelte-97j547"&&(R.innerHTML=Ve),Q=i(e),te=m(e,"P",{"data-svelte-h":!0}),h(te)!=="svelte-uj830e"&&(te.textContent=de),Fe=i(e),j=m(e,"UL",{"data-svelte-h":!0}),h(j)!=="svelte-1lx5elv"&&(j.innerHTML=ve),W=i(e),D=m(e,"P",{"data-svelte-h":!0}),h(D)!=="svelte-1pp61sl"&&(D.innerHTML=Ue),Te=i(e),U=m(e,"P",{"data-svelte-h":!0}),h(U)!=="svelte-1u70d3z"&&(U.innerHTML=Ce),ee=i(e),b(he.$$.fragment,e),Ie=i(e),ge=m(e,"UL",{"data-svelte-h":!0}),h(ge)!=="svelte-108u5ut"&&(ge.innerHTML=We),ke=i(e),b(X.$$.fragment,e),oe=i(e),ne=m(e,"P",{"data-svelte-h":!0}),h(ne)!=="svelte-18ipb9m"&&(ne.innerHTML=ze),Y=i(e),ce=m(e,"P",{"data-svelte-h":!0}),h(ce)!=="svelte-gstdxu"&&(ce.innerHTML=$e),me=i(e),b(pe.$$.fragment,e),Ne=i(e),P=m(e,"P",{"data-svelte-h":!0}),h(P)!=="svelte-10fxkod"&&(P.innerHTML=Me),Z=i(e),A=m(e,"P",{"data-svelte-h":!0}),h(A)!=="svelte-gaf3vw"&&(A.innerHTML=w),C=i(e),H=m(e,"TABLE",{"data-svelte-h":!0}),h(H)!=="svelte-vyu660"&&(H.innerHTML=G),L=i(e),b(we.$$.fragment,e),V=i(e),I=m(e,"P",{"data-svelte-h":!0}),h(I)!=="svelte-o730q4"&&(I.innerHTML=ue),q=i(e),fe=m(e,"P",{"data-svelte-h":!0}),h(fe)!=="svelte-ne2b97"&&(fe.innerHTML=Ke),Je=i(e),b(Re.$$.fragment,e),ot=i(e),Be=m(e,"UL",{"data-svelte-h":!0}),h(Be)!=="svelte-13xw2c3"&&(Be.innerHTML=Jt),nt=i(e),Pe=m(e,"P",{"data-svelte-h":!0}),h(Pe)!=="svelte-14a1znp"&&(Pe.textContent=wt),Ge=i(e),De=m(e,"UL",{"data-svelte-h":!0}),h(De)!=="svelte-188r12y"&&(De.innerHTML=u),k=i(e),xe=m(e,"P",{"data-svelte-h":!0}),h(xe)!=="svelte-1x58uo"&&(xe.textContent=je),Ze=i(e),se=m(e,"UL",{"data-svelte-h":!0}),h(se)!=="svelte-1jbj357"&&(se.innerHTML=qe),dt=i(e),Qe=m(e,"P",{"data-svelte-h":!0}),h(Qe)!=="svelte-3z2x4b"&&(Qe.textContent=Wt),Zt=i(e),ct=m(e,"UL",{"data-svelte-h":!0}),h(ct)!=="svelte-mjj64f"&&(ct.innerHTML=fo),Lt=i(e),b(mt.$$.fragment,e),Rt=i(e),Ee=m(e,"DIV",{class:!0});var Ae=ae(Ee);b(pt.$$.fragment,Ae),Kt=i(Ae),xt=m(Ae,"P",{"data-svelte-h":!0}),h(xt)!=="svelte-1od0z89"&&(xt.innerHTML=ho),eo=i(Ae),Vt=m(Ae,"P",{"data-svelte-h":!0}),h(Vt)!=="svelte-qr3t5r"&&(Vt.innerHTML=go),to=i(Ae),b(st.$$.fragment,Ae),Ae.forEach(n),Ht=i(e),b(ft.$$.fragment,e),Bt=i(e),et=m(e,"DIV",{class:!0});var Mt=ae(et);b(ht.$$.fragment,Mt),oo=i(Mt),at=m(Mt,"DIV",{class:!0});var Qt=ae(at);b(gt.$$.fragment,Qt),no=i(Qt),Ft=m(Qt,"P",{"data-svelte-h":!0}),h(Ft)!=="svelte-khengj"&&(Ft.textContent=uo),Qt.forEach(n),Mt.forEach(n),qt=i(e),b(ut.$$.fragment,e),Gt=i(e),Ye=m(e,"DIV",{class:!0});var Nt=ae(Ye);b(_t.$$.fragment,Nt),so=i(Nt),Ct=m(Nt,"P",{"data-svelte-h":!0}),h(Ct)!=="svelte-1ebexfn"&&(Ct.textContent=_o),ao=i(Nt),rt=m(Nt,"DIV",{class:!0});var Ot=ae(rt);b(Tt.$$.fragment,Ot),ro=i(Ot),It=m(Ot,"P",{"data-svelte-h":!0}),h(It)!=="svelte-1x3yxsa"&&(It.textContent=To),Ot.forEach(n),Nt.forEach(n),Et=i(e),b(bt.$$.fragment,e),St=i(e),He=m(e,"DIV",{class:!0});var Oe=ae(He);b(yt.$$.fragment,Oe),io=i(Oe),kt=m(Oe,"P",{"data-svelte-h":!0}),h(kt)!=="svelte-ncu0x1"&&(kt.textContent=bo),lo=i(Oe),jt=m(Oe,"P",{"data-svelte-h":!0}),h(jt)!=="svelte-7883m0"&&(jt.innerHTML=yo),co=i(Oe),Ut=m(Oe,"UL",{"data-svelte-h":!0}),h(Ut)!=="svelte-1qslv4f"&&(Ut.innerHTML=vo),mo=i(Oe),zt=m(Oe,"DIV",{class:!0});var $o=ae(zt);b(vt.$$.fragment,$o),$o.forEach(n),Oe.forEach(n),Dt=i(e),b(it.$$.fragment,e),Xt=i(e),b($t.$$.fragment,e),Yt=i(e),Pt=m(e,"P",{}),ae(Pt).forEach(n),this.h()},h(){O(t,"name","hf:doc:metadata"),O(t,"content",an),wo(B.src,Se="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/vit_architecture.jpg")||O(B,"src",Se),O(B,"alt","drawing"),O(B,"width","600"),O(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,f){d(document.head,t),l(e,p,f),l(e,o,f),l(e,a,f),y(_,e,f),l(e,s,f),y(x,e,f),l(e,re,f),l(e,z,f),l(e,ie,f),l(e,N,f),l(e,le,f),l(e,g,f),l(e,K,f),l(e,B,f),l(e,ye,f),l(e,R,f),l(e,Q,f),l(e,te,f),l(e,Fe,f),l(e,j,f),l(e,W,f),l(e,D,f),l(e,Te,f),l(e,U,f),l(e,ee,f),y(he,e,f),l(e,Ie,f),l(e,ge,f),l(e,ke,f),y(X,e,f),l(e,oe,f),l(e,ne,f),l(e,Y,f),l(e,ce,f),l(e,me,f),y(pe,e,f),l(e,Ne,f),l(e,P,f),l(e,Z,f),l(e,A,f),l(e,C,f),l(e,H,f),l(e,L,f),y(we,e,f),l(e,V,f),l(e,I,f),l(e,q,f),l(e,fe,f),l(e,Je,f),y(Re,e,f),l(e,ot,f),l(e,Be,f),l(e,nt,f),l(e,Pe,f),l(e,Ge,f),l(e,De,f),l(e,k,f),l(e,xe,f),l(e,Ze,f),l(e,se,f),l(e,dt,f),l(e,Qe,f),l(e,Zt,f),l(e,ct,f),l(e,Lt,f),y(mt,e,f),l(e,Rt,f),l(e,Ee,f),y(pt,Ee,null),d(Ee,Kt),d(Ee,xt),d(Ee,eo),d(Ee,Vt),d(Ee,to),y(st,Ee,null),l(e,Ht,f),y(ft,e,f),l(e,Bt,f),l(e,et,f),y(ht,et,null),d(et,oo),d(et,at),y(gt,at,null),d(at,no),d(at,Ft),l(e,qt,f),y(ut,e,f),l(e,Gt,f),l(e,Ye,f),y(_t,Ye,null),d(Ye,so),d(Ye,Ct),d(Ye,ao),d(Ye,rt),y(Tt,rt,null),d(rt,ro),d(rt,It),l(e,Et,f),y(bt,e,f),l(e,St,f),l(e,He,f),y(yt,He,null),d(He,io),d(He,kt),d(He,lo),d(He,jt),d(He,co),d(He,Ut),d(He,mo),d(He,zt),y(vt,zt,null),l(e,Dt,f),y(it,e,f),l(e,Xt,f),y($t,e,f),l(e,Yt,f),l(e,Pt,f),At=!0},p(e,[f]){const Ae={};f&2&&(Ae.$$scope={dirty:f,ctx:e}),st.$set(Ae);const Mt={};f&2&&(Mt.$$scope={dirty:f,ctx:e}),it.$set(Mt)},i(e){At||(v(_.$$.fragment,e),v(x.$$.fragment,e),v(he.$$.fragment,e),v(X.$$.fragment,e),v(pe.$$.fragment,e),v(we.$$.fragment,e),v(Re.$$.fragment,e),v(mt.$$.fragment,e),v(pt.$$.fragment,e),v(st.$$.fragment,e),v(ft.$$.fragment,e),v(ht.$$.fragment,e),v(gt.$$.fragment,e),v(ut.$$.fragment,e),v(_t.$$.fragment,e),v(Tt.$$.fragment,e),v(bt.$$.fragment,e),v(yt.$$.fragment,e),v(vt.$$.fragment,e),v(it.$$.fragment,e),v($t.$$.fragment,e),At=!0)},o(e){$(_.$$.fragment,e),$(x.$$.fragment,e),$(he.$$.fragment,e),$(X.$$.fragment,e),$(pe.$$.fragment,e),$(we.$$.fragment,e),$(Re.$$.fragment,e),$(mt.$$.fragment,e),$(pt.$$.fragment,e),$(st.$$.fragment,e),$(ft.$$.fragment,e),$(ht.$$.fragment,e),$(gt.$$.fragment,e),$(ut.$$.fragment,e),$(_t.$$.fragment,e),$(Tt.$$.fragment,e),$(bt.$$.fragment,e),$(yt.$$.fragment,e),$(vt.$$.fragment,e),$(it.$$.fragment,e),$($t.$$.fragment,e),At=!1},d(e){e&&(n(p),n(o),n(a),n(s),n(re),n(z),n(ie),n(N),n(le),n(g),n(K),n(B),n(ye),n(R),n(Q),n(te),n(Fe),n(j),n(W),n(D),n(Te),n(U),n(ee),n(Ie),n(ge),n(ke),n(oe),n(ne),n(Y),n(ce),n(me),n(Ne),n(P),n(Z),n(A),n(C),n(H),n(L),n(V),n(I),n(q),n(fe),n(Je),n(ot),n(Be),n(nt),n(Pe),n(Ge),n(De),n(k),n(xe),n(Ze),n(se),n(dt),n(Qe),n(Zt),n(ct),n(Lt),n(Rt),n(Ee),n(Ht),n(Bt),n(et),n(qt),n(Gt),n(Ye),n(Et),n(St),n(He),n(Dt),n(Xt),n(Yt),n(Pt)),n(t),M(_,e),M(x,e),M(he,e),M(X,e),M(pe,e),M(we,e),M(Re,e),M(mt,e),M(pt),M(st),M(ft,e),M(ht),M(gt),M(ut,e),M(_t),M(Tt),M(bt,e),M(yt),M(vt),M(it,e),M($t,e)}}}const an='{"title":"Vision Transformer (ViT)","local":"vision-transformer-vit","sections":[{"title":"개요","local":"overview","sections":[],"depth":2},{"title":"사용 팁","local":"usage-tips","sections":[{"title":"Scaled Dot Product Attention (SDPA) 사용하기","local":"using-scaled-dot-product-attention-sdpa","sections":[],"depth":3}],"depth":2},{"title":"리소스","local":"resources","sections":[],"depth":2},{"title":"ViTConfig","local":"transformers.ViTConfig ][ transformers.ViTConfig","sections":[],"depth":2},{"title":"ViTFeatureExtractor","local":"transformers.ViTFeatureExtractor ][ transformers.ViTFeatureExtractor","sections":[],"depth":2},{"title":"ViTImageProcessor","local":"transformers.ViTImageProcessor ][ transformers.ViTImageProcessor","sections":[],"depth":2},{"title":"ViTImageProcessorFast","local":"transformers.ViTImageProcessorFast ][ transformers.ViTImageProcessorFast","sections":[],"depth":2},{"title":"ViTModel","local":"transformers.ViTModel ][ transformers.ViTModel","sections":[],"depth":2},{"title":"ViTForMaskedImageModeling","local":"transformers.ViTForMaskedImageModeling ][ transformers.ViTForMaskedImageModeling","sections":[],"depth":2},{"title":"ViTForImageClassification","local":"transformers.ViTForImageClassification ][ transformers.ViTForImageClassification","sections":[],"depth":2},{"title":"TFViTModel","local":"transformers.TFViTModel ][ transformers.TFViTModel","sections":[],"depth":2},{"title":"TFViTForImageClassification","local":"transformers.TFViTForImageClassification ][ transformers.TFViTForImageClassification","sections":[],"depth":2},{"title":"FlaxVitModel","local":"transformers.FlaxViTModel ][ transformers.FlaxViTModel","sections":[],"depth":2},{"title":"FlaxViTForImageClassification","local":"transformers.FlaxViTForImageClassification ][ transformers.FlaxViTForImageClassification","sections":[],"depth":2}],"depth":1}';function rn(F){return xo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _n extends Vo{constructor(t){super(),Fo(this,t,rn,sn,Mo,{})}}export{_n as component};
