import{s as yo,f as vo,o as Mo,n as Me}from"../chunks/scheduler.bdbef820.js";import{S as $o,i as wo,g as d,s as i,r as b,A as xo,h as c,f as n,c as l,j as re,u as y,x as g,k as A,y as m,a as r,v,d as M,t as $,w}from"../chunks/index.33f81d56.js";import{T as Le}from"../chunks/Tip.34194030.js";import{D as be}from"../chunks/Docstring.b3df4217.js";import{C as Xe}from"../chunks/CodeBlock.3bad7fc9.js";import{F as Vo,M as ro}from"../chunks/Markdown.03194dea.js";import{E as Oe}from"../chunks/ExampleCodeBlock.d705c5b9.js";import{P as Fo}from"../chunks/PipelineTag.d2f354cd.js";import{H as Ze,E as Co}from"../chunks/index.474b463a.js";function Io(F){let t,p="Example:",o,a,_;return a=new Xe({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=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-11lpom8"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function jo(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function ko(F){let t,p="Example:",o,a,_;return a=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEFtb2RlbCUyMCUzRCUyMFZpVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTModel
<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-in21k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTModel.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;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">197</span>, <span class="hljs-number">768</span>]`,wrap:!1}}),{c(){t=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-11lpom8"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function Uo(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-7i3y9o"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function Jo(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function zo(F){let t,p="Examples:",o,a,_;return a=new Xe({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=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-kvfsh7"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function Wo(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-111lhr1"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function No(F){let t,p="Example:",o,a,_;return a=new Xe({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])
Egyptian cat`,wrap:!1}}),{c(){t=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-11lpom8"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function Po(F){let t,p,o,a,_,s,x=`The bare ViT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,ie,j,R,le,z,S='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTModel">ViTModel</a> forward method, overrides the <code>__call__</code> special method.',de,u,Z,G,E,Ce,ye,J,ce,pe,O,Ie='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>.',je,N,Ne,U,te=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,xe,q,W,Ve,K,fe='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTForMaskedImageModeling">ViTForMaskedImageModeling</a> forward method, overrides the <code>__call__</code> special method.',Fe,oe,ke,ne,$e,se,ee,D,L,me,Ue,he=`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.`,Je,ge,P,ue,ve=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,ae,T,C,H,B,X='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',we,V,I,Q,Y;return t=new Ze({props:{title:"ViTModel",local:"transformers.ViTModel ][ transformers.ViTModel",headingTag:"h2"}}),a=new be({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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_vit.py#L540"}}),R=new be({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.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/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.ViTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</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"},{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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_vit.py#L569",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>
`}}),u=new Le({props:{$$slots:{default:[jo]},$$scope:{ctx:F}}}),G=new Oe({props:{anchor:"transformers.ViTModel.forward.example",$$slots:{default:[ko]},$$scope:{ctx:F}}}),Ce=new Ze({props:{title:"ViTForMaskedImageModeling",local:"transformers.ViTForMaskedImageModeling ][ transformers.ViTForMaskedImageModeling",headingTag:"h2"}}),ce=new be({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#L654"}}),N=new Le({props:{$$slots:{default:[Uo]},$$scope:{ctx:F}}}),W=new be({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.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/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.ViTForMaskedImageModeling.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</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"},{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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_vit.py#L684",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>
`}}),oe=new Le({props:{$$slots:{default:[Jo]},$$scope:{ctx:F}}}),ne=new Oe({props:{anchor:"transformers.ViTForMaskedImageModeling.forward.example",$$slots:{default:[zo]},$$scope:{ctx:F}}}),se=new Ze({props:{title:"ViTForImageClassification",local:"transformers.ViTForImageClassification ][ transformers.ViTForImageClassification",headingTag:"h2"}}),L=new be({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#L780"}}),ge=new Le({props:{$$slots:{default:[Wo]},$$scope:{ctx:F}}}),C=new be({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.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/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.ViTForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</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.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"},{anchor:"transformers.ViTForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_vit.py#L808",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>
`}}),V=new Le({props:{$$slots:{default:[Zo]},$$scope:{ctx:F}}}),Q=new Oe({props:{anchor:"transformers.ViTForImageClassification.forward.example",$$slots:{default:[No]},$$scope:{ctx:F}}}),{c(){b(t.$$.fragment),p=i(),o=d("div"),b(a.$$.fragment),_=i(),s=d("p"),s.innerHTML=x,ie=i(),j=d("div"),b(R.$$.fragment),le=i(),z=d("p"),z.innerHTML=S,de=i(),b(u.$$.fragment),Z=i(),b(G.$$.fragment),E=i(),b(Ce.$$.fragment),ye=i(),J=d("div"),b(ce.$$.fragment),pe=i(),O=d("p"),O.innerHTML=Ie,je=i(),b(N.$$.fragment),Ne=i(),U=d("p"),U.innerHTML=te,xe=i(),q=d("div"),b(W.$$.fragment),Ve=i(),K=d("p"),K.innerHTML=fe,Fe=i(),b(oe.$$.fragment),ke=i(),b(ne.$$.fragment),$e=i(),b(se.$$.fragment),ee=i(),D=d("div"),b(L.$$.fragment),me=i(),Ue=d("p"),Ue.textContent=he,Je=i(),b(ge.$$.fragment),P=i(),ue=d("p"),ue.innerHTML=ve,ae=i(),T=d("div"),b(C.$$.fragment),H=i(),B=d("p"),B.innerHTML=X,we=i(),b(V.$$.fragment),I=i(),b(Q.$$.fragment),this.h()},l(h){y(t.$$.fragment,h),p=l(h),o=c(h,"DIV",{class:!0});var k=re(o);y(a.$$.fragment,k),_=l(k),s=c(k,"P",{"data-svelte-h":!0}),g(s)!=="svelte-ulamh0"&&(s.innerHTML=x),ie=l(k),j=c(k,"DIV",{class:!0});var ze=re(j);y(R.$$.fragment,ze),le=l(ze),z=c(ze,"P",{"data-svelte-h":!0}),g(z)!=="svelte-mg45f1"&&(z.innerHTML=S),de=l(ze),y(u.$$.fragment,ze),Z=l(ze),y(G.$$.fragment,ze),ze.forEach(n),k.forEach(n),E=l(h),y(Ce.$$.fragment,h),ye=l(h),J=c(h,"DIV",{class:!0});var _e=re(J);y(ce.$$.fragment,_e),pe=l(_e),O=c(_e,"P",{"data-svelte-h":!0}),g(O)!=="svelte-hwvz1m"&&(O.innerHTML=Ie),je=l(_e),y(N.$$.fragment,_e),Ne=l(_e),U=c(_e,"P",{"data-svelte-h":!0}),g(U)!=="svelte-1gjh92c"&&(U.innerHTML=te),xe=l(_e),q=c(_e,"DIV",{class:!0});var We=re(q);y(W.$$.fragment,We),Ve=l(We),K=c(We,"P",{"data-svelte-h":!0}),g(K)!=="svelte-oemc7t"&&(K.innerHTML=fe),Fe=l(We),y(oe.$$.fragment,We),ke=l(We),y(ne.$$.fragment,We),We.forEach(n),_e.forEach(n),$e=l(h),y(se.$$.fragment,h),ee=l(h),D=c(h,"DIV",{class:!0});var Te=re(D);y(L.$$.fragment,Te),me=l(Te),Ue=c(Te,"P",{"data-svelte-h":!0}),g(Ue)!=="svelte-ju5wm2"&&(Ue.textContent=he),Je=l(Te),y(ge.$$.fragment,Te),P=l(Te),ue=c(Te,"P",{"data-svelte-h":!0}),g(ue)!=="svelte-1gjh92c"&&(ue.innerHTML=ve),ae=l(Te),T=c(Te,"DIV",{class:!0});var Pe=re(T);y(C.$$.fragment,Pe),H=l(Pe),B=c(Pe,"P",{"data-svelte-h":!0}),g(B)!=="svelte-so4qlh"&&(B.innerHTML=X),we=l(Pe),y(V.$$.fragment,Pe),I=l(Pe),y(Q.$$.fragment,Pe),Pe.forEach(n),Te.forEach(n),this.h()},h(){A(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(h,k){v(t,h,k),r(h,p,k),r(h,o,k),v(a,o,null),m(o,_),m(o,s),m(o,ie),m(o,j),v(R,j,null),m(j,le),m(j,z),m(j,de),v(u,j,null),m(j,Z),v(G,j,null),r(h,E,k),v(Ce,h,k),r(h,ye,k),r(h,J,k),v(ce,J,null),m(J,pe),m(J,O),m(J,je),v(N,J,null),m(J,Ne),m(J,U),m(J,xe),m(J,q),v(W,q,null),m(q,Ve),m(q,K),m(q,Fe),v(oe,q,null),m(q,ke),v(ne,q,null),r(h,$e,k),v(se,h,k),r(h,ee,k),r(h,D,k),v(L,D,null),m(D,me),m(D,Ue),m(D,Je),v(ge,D,null),m(D,P),m(D,ue),m(D,ae),m(D,T),v(C,T,null),m(T,H),m(T,B),m(T,we),v(V,T,null),m(T,I),v(Q,T,null),Y=!0},p(h,k){const ze={};k&2&&(ze.$$scope={dirty:k,ctx:h}),u.$set(ze);const _e={};k&2&&(_e.$$scope={dirty:k,ctx:h}),G.$set(_e);const We={};k&2&&(We.$$scope={dirty:k,ctx:h}),N.$set(We);const Te={};k&2&&(Te.$$scope={dirty:k,ctx:h}),oe.$set(Te);const Pe={};k&2&&(Pe.$$scope={dirty:k,ctx:h}),ne.$set(Pe);const Ke={};k&2&&(Ke.$$scope={dirty:k,ctx:h}),ge.$set(Ke);const qe={};k&2&&(qe.$$scope={dirty:k,ctx:h}),V.$set(qe);const Ft={};k&2&&(Ft.$$scope={dirty:k,ctx:h}),Q.$set(Ft)},i(h){Y||(M(t.$$.fragment,h),M(a.$$.fragment,h),M(R.$$.fragment,h),M(u.$$.fragment,h),M(G.$$.fragment,h),M(Ce.$$.fragment,h),M(ce.$$.fragment,h),M(N.$$.fragment,h),M(W.$$.fragment,h),M(oe.$$.fragment,h),M(ne.$$.fragment,h),M(se.$$.fragment,h),M(L.$$.fragment,h),M(ge.$$.fragment,h),M(C.$$.fragment,h),M(V.$$.fragment,h),M(Q.$$.fragment,h),Y=!0)},o(h){$(t.$$.fragment,h),$(a.$$.fragment,h),$(R.$$.fragment,h),$(u.$$.fragment,h),$(G.$$.fragment,h),$(Ce.$$.fragment,h),$(ce.$$.fragment,h),$(N.$$.fragment,h),$(W.$$.fragment,h),$(oe.$$.fragment,h),$(ne.$$.fragment,h),$(se.$$.fragment,h),$(L.$$.fragment,h),$(ge.$$.fragment,h),$(C.$$.fragment,h),$(V.$$.fragment,h),$(Q.$$.fragment,h),Y=!1},d(h){h&&(n(p),n(o),n(E),n(ye),n(J),n($e),n(ee),n(D)),w(t,h),w(a),w(R),w(u),w(G),w(Ce,h),w(ce),w(N),w(W),w(oe),w(ne),w(se,h),w(L),w(ge),w(C),w(V),w(Q)}}}function Ro(F){let t,p;return t=new ro({props:{$$slots:{default:[Po]},$$scope:{ctx:F}}}),{c(){b(t.$$.fragment)},l(o){y(t.$$.fragment,o)},m(o,a){v(t,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),t.$set(_)},i(o){p||(M(t.$$.fragment,o),p=!0)},o(o){$(t.$$.fragment,o),p=!1},d(o){w(t,o)}}}function Lo(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,ie=`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:`,j,R,le=`<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>`,z,S,de=`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=d("p"),t.innerHTML=p,o=i(),a=d("ul"),a.innerHTML=_,s=i(),x=d("p"),x.innerHTML=ie,j=i(),R=d("ul"),R.innerHTML=le,z=i(),S=d("p"),S.innerHTML=de},l(u){t=c(u,"P",{"data-svelte-h":!0}),g(t)!=="svelte-1ajbfxg"&&(t.innerHTML=p),o=l(u),a=c(u,"UL",{"data-svelte-h":!0}),g(a)!=="svelte-qm1t26"&&(a.innerHTML=_),s=l(u),x=c(u,"P",{"data-svelte-h":!0}),g(x)!=="svelte-1v9qsc5"&&(x.innerHTML=ie),j=l(u),R=c(u,"UL",{"data-svelte-h":!0}),g(R)!=="svelte-99h8aq"&&(R.innerHTML=le),z=l(u),S=c(u,"P",{"data-svelte-h":!0}),g(S)!=="svelte-1an3odd"&&(S.innerHTML=de)},m(u,Z){r(u,t,Z),r(u,o,Z),r(u,a,Z),r(u,s,Z),r(u,x,Z),r(u,j,Z),r(u,R,Z),r(u,z,Z),r(u,S,Z)},p:Me,d(u){u&&(n(t),n(o),n(a),n(s),n(x),n(j),n(R),n(z),n(S))}}}function Ho(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function Bo(F){let t,p="Example:",o,a,_;return a=new Xe({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=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-11lpom8"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function Go(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-111lhr1"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}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,ie=`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:`,j,R,le=`<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>`,z,S,de=`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=d("p"),t.innerHTML=p,o=i(),a=d("ul"),a.innerHTML=_,s=i(),x=d("p"),x.innerHTML=ie,j=i(),R=d("ul"),R.innerHTML=le,z=i(),S=d("p"),S.innerHTML=de},l(u){t=c(u,"P",{"data-svelte-h":!0}),g(t)!=="svelte-1ajbfxg"&&(t.innerHTML=p),o=l(u),a=c(u,"UL",{"data-svelte-h":!0}),g(a)!=="svelte-qm1t26"&&(a.innerHTML=_),s=l(u),x=c(u,"P",{"data-svelte-h":!0}),g(x)!=="svelte-1v9qsc5"&&(x.innerHTML=ie),j=l(u),R=c(u,"UL",{"data-svelte-h":!0}),g(R)!=="svelte-99h8aq"&&(R.innerHTML=le),z=l(u),S=c(u,"P",{"data-svelte-h":!0}),g(S)!=="svelte-1an3odd"&&(S.innerHTML=de)},m(u,Z){r(u,t,Z),r(u,o,Z),r(u,a,Z),r(u,s,Z),r(u,x,Z),r(u,j,Z),r(u,R,Z),r(u,z,Z),r(u,S,Z)},p:Me,d(u){u&&(n(t),n(o),n(a),n(s),n(x),n(j),n(R),n(z),n(S))}}}function Eo(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function Xo(F){let t,p="Example:",o,a,_;return a=new Xe({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=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-11lpom8"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function So(F){let t,p,o,a,_,s,x="The bare ViT Model transformer outputting raw hidden-states without any specific head on top.",ie,j,R=`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.)`,le,z,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.`,de,u,Z,G,E,Ce,ye,J='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.TFViTModel">TFViTModel</a> forward method, overrides the <code>__call__</code> special method.',ce,pe,O,Ie,je,N,Ne,U,te,xe,q,W=`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.`,Ve,K,fe,Fe,oe=`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.)`,ke,ne,$e=`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.`,se,ee,D,L,me,Ue,he,Je='The <a href="/docs/transformers/main/ko/model_doc/vit#transformers.TFViTForImageClassification">TFViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',ge,P,ue,ve,ae;return t=new Ze({props:{title:"TFViTModel",local:"transformers.TFViTModel ][ transformers.TFViTModel",headingTag:"h2"}}),a=new be({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"}}),u=new Le({props:{$$slots:{default:[Lo]},$$scope:{ctx:F}}}),E=new be({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>
`}}),pe=new Le({props:{$$slots:{default:[Ho]},$$scope:{ctx:F}}}),Ie=new Oe({props:{anchor:"transformers.TFViTModel.call.example",$$slots:{default:[Bo]},$$scope:{ctx:F}}}),N=new Ze({props:{title:"TFViTForImageClassification",local:"transformers.TFViTForImageClassification ][ transformers.TFViTForImageClassification",headingTag:"h2"}}),te=new be({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"}}),K=new Le({props:{$$slots:{default:[Go]},$$scope:{ctx:F}}}),ee=new Le({props:{$$slots:{default:[qo]},$$scope:{ctx:F}}}),me=new be({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 Le({props:{$$slots:{default:[Eo]},$$scope:{ctx:F}}}),ve=new Oe({props:{anchor:"transformers.TFViTForImageClassification.call.example",$$slots:{default:[Xo]},$$scope:{ctx:F}}}),{c(){b(t.$$.fragment),p=i(),o=d("div"),b(a.$$.fragment),_=i(),s=d("p"),s.textContent=x,ie=i(),j=d("p"),j.innerHTML=R,le=i(),z=d("p"),z.innerHTML=S,de=i(),b(u.$$.fragment),Z=i(),G=d("div"),b(E.$$.fragment),Ce=i(),ye=d("p"),ye.innerHTML=J,ce=i(),b(pe.$$.fragment),O=i(),b(Ie.$$.fragment),je=i(),b(N.$$.fragment),Ne=i(),U=d("div"),b(te.$$.fragment),xe=i(),q=d("p"),q.textContent=W,Ve=i(),b(K.$$.fragment),fe=i(),Fe=d("p"),Fe.innerHTML=oe,ke=i(),ne=d("p"),ne.innerHTML=$e,se=i(),b(ee.$$.fragment),D=i(),L=d("div"),b(me.$$.fragment),Ue=i(),he=d("p"),he.innerHTML=Je,ge=i(),b(P.$$.fragment),ue=i(),b(ve.$$.fragment),this.h()},l(T){y(t.$$.fragment,T),p=l(T),o=c(T,"DIV",{class:!0});var C=re(o);y(a.$$.fragment,C),_=l(C),s=c(C,"P",{"data-svelte-h":!0}),g(s)!=="svelte-1vbye9a"&&(s.textContent=x),ie=l(C),j=c(C,"P",{"data-svelte-h":!0}),g(j)!=="svelte-3ge3jn"&&(j.innerHTML=R),le=l(C),z=c(C,"P",{"data-svelte-h":!0}),g(z)!=="svelte-1be7e3c"&&(z.innerHTML=S),de=l(C),y(u.$$.fragment,C),Z=l(C),G=c(C,"DIV",{class:!0});var H=re(G);y(E.$$.fragment,H),Ce=l(H),ye=c(H,"P",{"data-svelte-h":!0}),g(ye)!=="svelte-hguzl9"&&(ye.innerHTML=J),ce=l(H),y(pe.$$.fragment,H),O=l(H),y(Ie.$$.fragment,H),H.forEach(n),C.forEach(n),je=l(T),y(N.$$.fragment,T),Ne=l(T),U=c(T,"DIV",{class:!0});var B=re(U);y(te.$$.fragment,B),xe=l(B),q=c(B,"P",{"data-svelte-h":!0}),g(q)!=="svelte-ju5wm2"&&(q.textContent=W),Ve=l(B),y(K.$$.fragment,B),fe=l(B),Fe=c(B,"P",{"data-svelte-h":!0}),g(Fe)!=="svelte-3ge3jn"&&(Fe.innerHTML=oe),ke=l(B),ne=c(B,"P",{"data-svelte-h":!0}),g(ne)!=="svelte-1be7e3c"&&(ne.innerHTML=$e),se=l(B),y(ee.$$.fragment,B),D=l(B),L=c(B,"DIV",{class:!0});var X=re(L);y(me.$$.fragment,X),Ue=l(X),he=c(X,"P",{"data-svelte-h":!0}),g(he)!=="svelte-1yb0woh"&&(he.innerHTML=Je),ge=l(X),y(P.$$.fragment,X),ue=l(X),y(ve.$$.fragment,X),X.forEach(n),B.forEach(n),this.h()},h(){A(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(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(T,C){v(t,T,C),r(T,p,C),r(T,o,C),v(a,o,null),m(o,_),m(o,s),m(o,ie),m(o,j),m(o,le),m(o,z),m(o,de),v(u,o,null),m(o,Z),m(o,G),v(E,G,null),m(G,Ce),m(G,ye),m(G,ce),v(pe,G,null),m(G,O),v(Ie,G,null),r(T,je,C),v(N,T,C),r(T,Ne,C),r(T,U,C),v(te,U,null),m(U,xe),m(U,q),m(U,Ve),v(K,U,null),m(U,fe),m(U,Fe),m(U,ke),m(U,ne),m(U,se),v(ee,U,null),m(U,D),m(U,L),v(me,L,null),m(L,Ue),m(L,he),m(L,ge),v(P,L,null),m(L,ue),v(ve,L,null),ae=!0},p(T,C){const H={};C&2&&(H.$$scope={dirty:C,ctx:T}),u.$set(H);const B={};C&2&&(B.$$scope={dirty:C,ctx:T}),pe.$set(B);const X={};C&2&&(X.$$scope={dirty:C,ctx:T}),Ie.$set(X);const we={};C&2&&(we.$$scope={dirty:C,ctx:T}),K.$set(we);const V={};C&2&&(V.$$scope={dirty:C,ctx:T}),ee.$set(V);const I={};C&2&&(I.$$scope={dirty:C,ctx:T}),P.$set(I);const Q={};C&2&&(Q.$$scope={dirty:C,ctx:T}),ve.$set(Q)},i(T){ae||(M(t.$$.fragment,T),M(a.$$.fragment,T),M(u.$$.fragment,T),M(E.$$.fragment,T),M(pe.$$.fragment,T),M(Ie.$$.fragment,T),M(N.$$.fragment,T),M(te.$$.fragment,T),M(K.$$.fragment,T),M(ee.$$.fragment,T),M(me.$$.fragment,T),M(P.$$.fragment,T),M(ve.$$.fragment,T),ae=!0)},o(T){$(t.$$.fragment,T),$(a.$$.fragment,T),$(u.$$.fragment,T),$(E.$$.fragment,T),$(pe.$$.fragment,T),$(Ie.$$.fragment,T),$(N.$$.fragment,T),$(te.$$.fragment,T),$(K.$$.fragment,T),$(ee.$$.fragment,T),$(me.$$.fragment,T),$(P.$$.fragment,T),$(ve.$$.fragment,T),ae=!1},d(T){T&&(n(p),n(o),n(je),n(Ne),n(U)),w(t,T),w(a),w(u),w(E),w(pe),w(Ie),w(N,T),w(te),w(K),w(ee),w(me),w(P),w(ve)}}}function Yo(F){let t,p;return t=new ro({props:{$$slots:{default:[So]},$$scope:{ctx:F}}}),{c(){b(t.$$.fragment)},l(o){y(t.$$.fragment,o)},m(o,a){v(t,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),t.$set(_)},i(o){p||(M(t.$$.fragment,o),p=!0)},o(o){$(t.$$.fragment,o),p=!1},d(o){w(t,o)}}}function Do(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function Qo(F){let t,p="Examples:",o,a,_;return a=new Xe({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=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-kvfsh7"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function Ao(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=d("p"),t.innerHTML=p},l(o){t=c(o,"P",{"data-svelte-h":!0}),g(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(o,a){r(o,t,a)},p:Me,d(o){o&&n(t)}}}function Oo(F){let t,p="Example:",o,a,_;return a=new Xe({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=d("p"),t.textContent=p,o=i(),b(a.$$.fragment)},l(s){t=c(s,"P",{"data-svelte-h":!0}),g(t)!=="svelte-11lpom8"&&(t.textContent=p),o=l(s),y(a.$$.fragment,s)},m(s,x){r(s,t,x),r(s,o,x),v(a,s,x),_=!0},p:Me,i(s){_||(M(a.$$.fragment,s),_=!0)},o(s){$(a.$$.fragment,s),_=!1},d(s){s&&(n(t),n(o)),w(a,s)}}}function Ko(F){let t,p,o,a,_,s,x="The bare ViT Model transformer outputting raw hidden-states without any specific head on top.",ie,j,R=`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)`,le,z,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.`,de,u,Z="Finally, this model supports inherent JAX features such as:",G,E,Ce='<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,J,ce,pe,O,Ie="The <code>FlaxViTPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",je,N,Ne,U,te,xe,q,W,Ve,K,fe,Fe=`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.`,oe,ke,ne=`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)`,$e,se,ee=`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.`,D,L,me="Finally, this model supports inherent JAX features such as:",Ue,he,Je='<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>',ge,P,ue,ve,ae,T="The <code>FlaxViTPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",C,H,B,X,we;return t=new Ze({props:{title:"FlaxVitModel",local:"transformers.FlaxViTModel ][ transformers.FlaxViTModel",headingTag:"h2"}}),a=new be({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"}}),ce=new be({props:{name:"__call__",anchor:"transformers.FlaxViTModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": <function PRNGKey at 0x7fd98c808dc0> = 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>
`}}),N=new Le({props:{$$slots:{default:[Do]},$$scope:{ctx:F}}}),U=new Oe({props:{anchor:"transformers.FlaxViTModel.__call__.example",$$slots:{default:[Qo]},$$scope:{ctx:F}}}),xe=new Ze({props:{title:"FlaxViTForImageClassification",local:"transformers.FlaxViTForImageClassification ][ transformers.FlaxViTForImageClassification",headingTag:"h2"}}),Ve=new be({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"}}),ue=new be({props:{name:"__call__",anchor:"transformers.FlaxViTForImageClassification.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": <function PRNGKey at 0x7fd98c808dc0> = 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 Le({props:{$$slots:{default:[Ao]},$$scope:{ctx:F}}}),X=new Oe({props:{anchor:"transformers.FlaxViTForImageClassification.__call__.example",$$slots:{default:[Oo]},$$scope:{ctx:F}}}),{c(){b(t.$$.fragment),p=i(),o=d("div"),b(a.$$.fragment),_=i(),s=d("p"),s.textContent=x,ie=i(),j=d("p"),j.innerHTML=R,le=i(),z=d("p"),z.innerHTML=S,de=i(),u=d("p"),u.textContent=Z,G=i(),E=d("ul"),E.innerHTML=Ce,ye=i(),J=d("div"),b(ce.$$.fragment),pe=i(),O=d("p"),O.innerHTML=Ie,je=i(),b(N.$$.fragment),Ne=i(),b(U.$$.fragment),te=i(),b(xe.$$.fragment),q=i(),W=d("div"),b(Ve.$$.fragment),K=i(),fe=d("p"),fe.textContent=Fe,oe=i(),ke=d("p"),ke.innerHTML=ne,$e=i(),se=d("p"),se.innerHTML=ee,D=i(),L=d("p"),L.textContent=me,Ue=i(),he=d("ul"),he.innerHTML=Je,ge=i(),P=d("div"),b(ue.$$.fragment),ve=i(),ae=d("p"),ae.innerHTML=T,C=i(),b(H.$$.fragment),B=i(),b(X.$$.fragment),this.h()},l(V){y(t.$$.fragment,V),p=l(V),o=c(V,"DIV",{class:!0});var I=re(o);y(a.$$.fragment,I),_=l(I),s=c(I,"P",{"data-svelte-h":!0}),g(s)!=="svelte-1vbye9a"&&(s.textContent=x),ie=l(I),j=c(I,"P",{"data-svelte-h":!0}),g(j)!=="svelte-qqhrqm"&&(j.innerHTML=R),le=l(I),z=c(I,"P",{"data-svelte-h":!0}),g(z)!=="svelte-10nfsf3"&&(z.innerHTML=S),de=l(I),u=c(I,"P",{"data-svelte-h":!0}),g(u)!=="svelte-1pplc4a"&&(u.textContent=Z),G=l(I),E=c(I,"UL",{"data-svelte-h":!0}),g(E)!=="svelte-1w7z84m"&&(E.innerHTML=Ce),ye=l(I),J=c(I,"DIV",{class:!0});var Q=re(J);y(ce.$$.fragment,Q),pe=l(Q),O=c(Q,"P",{"data-svelte-h":!0}),g(O)!=="svelte-8rbifc"&&(O.innerHTML=Ie),je=l(Q),y(N.$$.fragment,Q),Ne=l(Q),y(U.$$.fragment,Q),Q.forEach(n),I.forEach(n),te=l(V),y(xe.$$.fragment,V),q=l(V),W=c(V,"DIV",{class:!0});var Y=re(W);y(Ve.$$.fragment,Y),K=l(Y),fe=c(Y,"P",{"data-svelte-h":!0}),g(fe)!=="svelte-ju5wm2"&&(fe.textContent=Fe),oe=l(Y),ke=c(Y,"P",{"data-svelte-h":!0}),g(ke)!=="svelte-qqhrqm"&&(ke.innerHTML=ne),$e=l(Y),se=c(Y,"P",{"data-svelte-h":!0}),g(se)!=="svelte-10nfsf3"&&(se.innerHTML=ee),D=l(Y),L=c(Y,"P",{"data-svelte-h":!0}),g(L)!=="svelte-1pplc4a"&&(L.textContent=me),Ue=l(Y),he=c(Y,"UL",{"data-svelte-h":!0}),g(he)!=="svelte-1w7z84m"&&(he.innerHTML=Je),ge=l(Y),P=c(Y,"DIV",{class:!0});var h=re(P);y(ue.$$.fragment,h),ve=l(h),ae=c(h,"P",{"data-svelte-h":!0}),g(ae)!=="svelte-8rbifc"&&(ae.innerHTML=T),C=l(h),y(H.$$.fragment,h),B=l(h),y(X.$$.fragment,h),h.forEach(n),Y.forEach(n),this.h()},h(){A(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(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(V,I){v(t,V,I),r(V,p,I),r(V,o,I),v(a,o,null),m(o,_),m(o,s),m(o,ie),m(o,j),m(o,le),m(o,z),m(o,de),m(o,u),m(o,G),m(o,E),m(o,ye),m(o,J),v(ce,J,null),m(J,pe),m(J,O),m(J,je),v(N,J,null),m(J,Ne),v(U,J,null),r(V,te,I),v(xe,V,I),r(V,q,I),r(V,W,I),v(Ve,W,null),m(W,K),m(W,fe),m(W,oe),m(W,ke),m(W,$e),m(W,se),m(W,D),m(W,L),m(W,Ue),m(W,he),m(W,ge),m(W,P),v(ue,P,null),m(P,ve),m(P,ae),m(P,C),v(H,P,null),m(P,B),v(X,P,null),we=!0},p(V,I){const Q={};I&2&&(Q.$$scope={dirty:I,ctx:V}),N.$set(Q);const Y={};I&2&&(Y.$$scope={dirty:I,ctx:V}),U.$set(Y);const h={};I&2&&(h.$$scope={dirty:I,ctx:V}),H.$set(h);const k={};I&2&&(k.$$scope={dirty:I,ctx:V}),X.$set(k)},i(V){we||(M(t.$$.fragment,V),M(a.$$.fragment,V),M(ce.$$.fragment,V),M(N.$$.fragment,V),M(U.$$.fragment,V),M(xe.$$.fragment,V),M(Ve.$$.fragment,V),M(ue.$$.fragment,V),M(H.$$.fragment,V),M(X.$$.fragment,V),we=!0)},o(V){$(t.$$.fragment,V),$(a.$$.fragment,V),$(ce.$$.fragment,V),$(N.$$.fragment,V),$(U.$$.fragment,V),$(xe.$$.fragment,V),$(Ve.$$.fragment,V),$(ue.$$.fragment,V),$(H.$$.fragment,V),$(X.$$.fragment,V),we=!1},d(V){V&&(n(p),n(o),n(te),n(q),n(W)),w(t,V),w(a),w(ce),w(N),w(U),w(xe,V),w(Ve),w(ue),w(H),w(X)}}}function en(F){let t,p;return t=new ro({props:{$$slots:{default:[Ko]},$$scope:{ctx:F}}}),{c(){b(t.$$.fragment)},l(o){y(t.$$.fragment,o)},m(o,a){v(t,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),t.$set(_)},i(o){p||(M(t.$$.fragment,o),p=!0)},o(o){$(t.$$.fragment,o),p=!1},d(o){w(t,o)}}}function tn(F){let t,p,o,a,_,s,x,ie,j,R='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) 구조와 비교해 매우 우수한 결과를 달성했습니다.',le,z,S="논문의 초록은 다음과 같습니다:",de,u,Z="<em>Transformer 아키텍처는 자연어 처리 작업에서 사실상 표준으로 자리 잡았으나, 컴퓨터 비전 분야에서의 적용은 여전히 제한적입니다. 비전에서 어텐션 메커니즘은 종종 합성곱 신경망(CNN)과 결합하여 사용되거나, 전체 구조를 유지하면서 합성곱 신경망의 특정 구성 요소를 대체하는 데 사용됩니다. 우리는 이러한 CNN 의존성이 필요하지 않으며, 이미지 패치를 순차적으로 입력받는 순수한 Transformer가 이미지 분류 작업에서 매우 우수한 성능을 발휘할 수 있음을 보여줍니다. 대규모 데이터로 사전 학습된 후, ImageNet, CIFAR-100, VTAB 등 다양한 중소형 이미지 인식 벤치마크에 적용하면 Vision Transformer(ViT)는 최신 합성곱 신경망과 비교해 매우 우수한 성능을 발휘하면서도 훈련에 필요한 계산 자원을 상당히 줄일 수 있습니다.</em>",G,E,Ce,ye,J,ce='ViT 아키텍처. <a href="https://arxiv.org/abs/2010.11929">원본 논문</a>에서 발췌.',pe,O,Ie="원래의 Vision Transformer에 이어, 여러 후속 연구들이 진행되었습니다:",je,N,Ne=`<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>`,U,te,xe='이 모델은 <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>에 의해 기여되었습니다. 원본 코드(JAX로 작성됨)은 <a href="https://github.com/google-research/vision_transformer" rel="nofollow">여기</a>에서 확인할 수 있습니다.',q,W,Ve='참고로, 우리는 Ross Wightman의 <a href="https://github.com/rwightman/pytorch-image-models" rel="nofollow">timm 라이브러리</a>에서 JAX에서 PyTorch로 변환된 가중치를 다시 변환했습니다. 모든 공로는 그에게 돌립니다!',K,fe,Fe,oe,ke='<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>',ne,$e,se,ee,D='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> 페이지를 참조하십시오.',L,me,Ue="SDPA는 <code>torch&gt;=2.1.1</code>에서 구현이 가능한 경우 기본적으로 사용되지만, <code>from_pretrained()</code>에서 <code>attn_implementation=&quot;sdpa&quot;</code>로 설정하여 SDPA를 명시적으로 요청할 수도 있습니다.",he,Je,ge,P,ue="최적의 속도 향상을 위해 모델을 반정밀도(예: <code>torch.float16</code> 또는 <code>torch.bfloat16</code>)로 로드하는 것을 권장합니다.",ve,ae,T="로컬 벤치마크(A100-40GB, PyTorch 2.3.0, OS Ubuntu 22.04)에서 <code>float32</code>와 <code>google/vit-base-patch16-224</code> 모델을 사용한 추론 시, 다음과 같은 속도 향상을 확인했습니다.",C,H,B="<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>",X,we,V,I,Q='ViT의 추론 및 커스텀 데이터에 대한 미세 조정과 관련된 데모 노트북은 <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer" rel="nofollow">여기</a>에서 확인할 수 있습니다. Hugging Face에서 공식적으로 제공하는 자료와 커뮤니티(🌎로 표시된) 자료 목록은 ViT를 시작하는 데 도움이 될 것입니다. 이 목록에 포함될 자료를 제출하고 싶다면 Pull Request를 열어 주시면 검토하겠습니다. 새로운 내용을 설명하는 자료가 가장 이상적이며, 기존 자료를 중복하지 않도록 해주십시오.',Y,h,k="<code>ViTForImageClassification</code> 은 다음에서 지원됩니다:",ze,_e,We,Te,Pe='<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>',Ke,qe,Ft="⚗️ 최적화",It,et,io='<li><a href="https://www.philschmid.de/optimizing-vision-transformer" rel="nofollow">Optimum을 사용한 양자화를 통해 Vision Transformer(ViT) 가속</a>에 대한 블로그 포스트</li>',jt,tt,lo="⚡️ 추론",kt,ot,co='<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>',Ut,nt,mo="🚀 배포",Jt,st,po='<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>',zt,at,Wt,Re,rt,Dt,Tt,fo=`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.`,Qt,bt,ho=`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.`,At,Se,Zt,it,Nt,Ee,lt,Ot,Ye,dt,Kt,yt,go="Preprocess an image or a batch of images.",Pt,ct,Rt,He,mt,eo,vt,uo="Constructs a ViT image processor.",to,De,pt,oo,Mt,_o="Preprocess an image or batch of images.",Lt,ft,Ht,Be,ht,no,$t,To="Constructs a fast ViT image processor.",so,Qe,gt,ao,wt,bo="Preprocess an image or batch of images.",Bt,Ae,Gt,ut,qt,Ct,Et;return _=new Ze({props:{title:"Vision Transformer (ViT)",local:"vision-transformer-vit",headingTag:"h1"}}),x=new Ze({props:{title:"개요",local:"overview",headingTag:"h2"}}),fe=new Ze({props:{title:"사용 팁",local:"usage-tips",headingTag:"h2"}}),$e=new Ze({props:{title:"Scaled Dot Product Attention (SDPA) 사용하기",local:"using-scaled-dot-product-attention-sdpa",headingTag:"h3"}}),Je=new Xe({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 Ze({props:{title:"리소스",local:"resources",headingTag:"h2"}}),_e=new Fo({props:{pipeline:"image-classification"}}),at=new Ze({props:{title:"ViTConfig",local:"transformers.ViTConfig ][ transformers.ViTConfig",headingTag:"h2"}}),rt=new be({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"}}),Se=new Oe({props:{anchor:"transformers.ViTConfig.example",$$slots:{default:[Io]},$$scope:{ctx:F}}}),it=new Ze({props:{title:"ViTFeatureExtractor",local:"transformers.ViTFeatureExtractor ][ transformers.ViTFeatureExtractor",headingTag:"h2"}}),lt=new be({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#L26"}}),dt=new be({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#L40"}}),ct=new Ze({props:{title:"ViTImageProcessor",local:"transformers.ViTImageProcessor ][ transformers.ViTImageProcessor",headingTag:"h2"}}),mt=new be({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#L42"}}),pt=new be({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.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[str, transformers.image_utils.ChannelDimension, 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#L151"}}),ft=new Ze({props:{title:"ViTImageProcessorFast",local:"transformers.ViTImageProcessorFast ][ transformers.ViTImageProcessorFast",headingTag:"h2"}}),ht=new be({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>self.do_resize</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ViTImageProcessorFast.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
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.ViTImageProcessorFast.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.default_to_square</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>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. Can be
overridden by the <code>resample</code> parameter in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ViTImageProcessorFast.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,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>self.crop_size</code>) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.ViTImageProcessorFast.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 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.ViTImageProcessorFast.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ViTImageProcessorFast.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. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.ViTImageProcessorFast.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;
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. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ViTImageProcessorFast.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;
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.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ViTImageProcessorFast.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"},{anchor:"transformers.ViTImageProcessorFast.return_tensors",description:"<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>, defaults to <code>self.return_tensors</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>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>self.data_format</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>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>self.input_data_format</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>self.device</code>) &#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/models/vit/image_processing_vit_fast.py#L31"}}),gt=new be({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:"**kwargs",val:": typing_extensions.Unpack[transformers.image_processing_utils_fast.DefaultFastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.ViTImageProcessorFast.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.ViTImageProcessorFast.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.ViTImageProcessorFast.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.ViTImageProcessorFast.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> or <code>InterpolationMode</code>, <em>optional</em>, defaults to <code>self.resample</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>, defaults to <code>self.do_center_crop</code>) &#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>, defaults to <code>self.crop_size</code>) &#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>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ViTImageProcessorFast.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.ViTImageProcessorFast.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.ViTImageProcessorFast.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 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>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</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>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ViTImageProcessorFast.preprocess.return_tensors",description:"<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>, defaults to <code>self.return_tensors</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>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>self.data_format</code>) &#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>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>self.input_data_format</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>, defaults to <code>self.device</code>) &#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#L667"}}),Ae=new Vo({props:{pytorch:!0,tensorflow:!0,jax:!0,$$slots:{jax:[en],tensorflow:[Yo],pytorch:[Ro]},$$scope:{ctx:F}}}),ut=new Co({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/model_doc/vit.md"}}),{c(){t=d("meta"),p=i(),o=d("p"),a=i(),b(_.$$.fragment),s=i(),b(x.$$.fragment),ie=i(),j=d("p"),j.innerHTML=R,le=i(),z=d("p"),z.textContent=S,de=i(),u=d("p"),u.innerHTML=Z,G=i(),E=d("img"),ye=i(),J=d("small"),J.innerHTML=ce,pe=i(),O=d("p"),O.textContent=Ie,je=i(),N=d("ul"),N.innerHTML=Ne,U=i(),te=d("p"),te.innerHTML=xe,q=i(),W=d("p"),W.innerHTML=Ve,K=i(),b(fe.$$.fragment),Fe=i(),oe=d("ul"),oe.innerHTML=ke,ne=i(),b($e.$$.fragment),se=i(),ee=d("p"),ee.innerHTML=D,L=i(),me=d("p"),me.innerHTML=Ue,he=i(),b(Je.$$.fragment),ge=i(),P=d("p"),P.innerHTML=ue,ve=i(),ae=d("p"),ae.innerHTML=T,C=i(),H=d("table"),H.innerHTML=B,X=i(),b(we.$$.fragment),V=i(),I=d("p"),I.innerHTML=Q,Y=i(),h=d("p"),h.innerHTML=k,ze=i(),b(_e.$$.fragment),We=i(),Te=d("ul"),Te.innerHTML=Pe,Ke=i(),qe=d("p"),qe.textContent=Ft,It=i(),et=d("ul"),et.innerHTML=io,jt=i(),tt=d("p"),tt.textContent=lo,kt=i(),ot=d("ul"),ot.innerHTML=co,Ut=i(),nt=d("p"),nt.textContent=mo,Jt=i(),st=d("ul"),st.innerHTML=po,zt=i(),b(at.$$.fragment),Wt=i(),Re=d("div"),b(rt.$$.fragment),Dt=i(),Tt=d("p"),Tt.innerHTML=fo,Qt=i(),bt=d("p"),bt.innerHTML=ho,At=i(),b(Se.$$.fragment),Zt=i(),b(it.$$.fragment),Nt=i(),Ee=d("div"),b(lt.$$.fragment),Ot=i(),Ye=d("div"),b(dt.$$.fragment),Kt=i(),yt=d("p"),yt.textContent=go,Pt=i(),b(ct.$$.fragment),Rt=i(),He=d("div"),b(mt.$$.fragment),eo=i(),vt=d("p"),vt.textContent=uo,to=i(),De=d("div"),b(pt.$$.fragment),oo=i(),Mt=d("p"),Mt.textContent=_o,Lt=i(),b(ft.$$.fragment),Ht=i(),Be=d("div"),b(ht.$$.fragment),no=i(),$t=d("p"),$t.textContent=To,so=i(),Qe=d("div"),b(gt.$$.fragment),ao=i(),wt=d("p"),wt.textContent=bo,Bt=i(),b(Ae.$$.fragment),Gt=i(),b(ut.$$.fragment),qt=i(),Ct=d("p"),this.h()},l(e){const f=xo("svelte-u9bgzb",document.head);t=c(f,"META",{name:!0,content:!0}),f.forEach(n),p=l(e),o=c(e,"P",{}),re(o).forEach(n),a=l(e),y(_.$$.fragment,e),s=l(e),y(x.$$.fragment,e),ie=l(e),j=c(e,"P",{"data-svelte-h":!0}),g(j)!=="svelte-m3xvsu"&&(j.innerHTML=R),le=l(e),z=c(e,"P",{"data-svelte-h":!0}),g(z)!=="svelte-e5r8wp"&&(z.textContent=S),de=l(e),u=c(e,"P",{"data-svelte-h":!0}),g(u)!=="svelte-5cj3dm"&&(u.innerHTML=Z),G=l(e),E=c(e,"IMG",{src:!0,alt:!0,width:!0}),ye=l(e),J=c(e,"SMALL",{"data-svelte-h":!0}),g(J)!=="svelte-97j547"&&(J.innerHTML=ce),pe=l(e),O=c(e,"P",{"data-svelte-h":!0}),g(O)!=="svelte-uj830e"&&(O.textContent=Ie),je=l(e),N=c(e,"UL",{"data-svelte-h":!0}),g(N)!=="svelte-1lx5elv"&&(N.innerHTML=Ne),U=l(e),te=c(e,"P",{"data-svelte-h":!0}),g(te)!=="svelte-1pp61sl"&&(te.innerHTML=xe),q=l(e),W=c(e,"P",{"data-svelte-h":!0}),g(W)!=="svelte-1u70d3z"&&(W.innerHTML=Ve),K=l(e),y(fe.$$.fragment,e),Fe=l(e),oe=c(e,"UL",{"data-svelte-h":!0}),g(oe)!=="svelte-108u5ut"&&(oe.innerHTML=ke),ne=l(e),y($e.$$.fragment,e),se=l(e),ee=c(e,"P",{"data-svelte-h":!0}),g(ee)!=="svelte-18ipb9m"&&(ee.innerHTML=D),L=l(e),me=c(e,"P",{"data-svelte-h":!0}),g(me)!=="svelte-gstdxu"&&(me.innerHTML=Ue),he=l(e),y(Je.$$.fragment,e),ge=l(e),P=c(e,"P",{"data-svelte-h":!0}),g(P)!=="svelte-10fxkod"&&(P.innerHTML=ue),ve=l(e),ae=c(e,"P",{"data-svelte-h":!0}),g(ae)!=="svelte-gaf3vw"&&(ae.innerHTML=T),C=l(e),H=c(e,"TABLE",{"data-svelte-h":!0}),g(H)!=="svelte-vyu660"&&(H.innerHTML=B),X=l(e),y(we.$$.fragment,e),V=l(e),I=c(e,"P",{"data-svelte-h":!0}),g(I)!=="svelte-o730q4"&&(I.innerHTML=Q),Y=l(e),h=c(e,"P",{"data-svelte-h":!0}),g(h)!=="svelte-ne2b97"&&(h.innerHTML=k),ze=l(e),y(_e.$$.fragment,e),We=l(e),Te=c(e,"UL",{"data-svelte-h":!0}),g(Te)!=="svelte-13xw2c3"&&(Te.innerHTML=Pe),Ke=l(e),qe=c(e,"P",{"data-svelte-h":!0}),g(qe)!=="svelte-14a1znp"&&(qe.textContent=Ft),It=l(e),et=c(e,"UL",{"data-svelte-h":!0}),g(et)!=="svelte-188r12y"&&(et.innerHTML=io),jt=l(e),tt=c(e,"P",{"data-svelte-h":!0}),g(tt)!=="svelte-1x58uo"&&(tt.textContent=lo),kt=l(e),ot=c(e,"UL",{"data-svelte-h":!0}),g(ot)!=="svelte-1jbj357"&&(ot.innerHTML=co),Ut=l(e),nt=c(e,"P",{"data-svelte-h":!0}),g(nt)!=="svelte-3z2x4b"&&(nt.textContent=mo),Jt=l(e),st=c(e,"UL",{"data-svelte-h":!0}),g(st)!=="svelte-mjj64f"&&(st.innerHTML=po),zt=l(e),y(at.$$.fragment,e),Wt=l(e),Re=c(e,"DIV",{class:!0});var Ge=re(Re);y(rt.$$.fragment,Ge),Dt=l(Ge),Tt=c(Ge,"P",{"data-svelte-h":!0}),g(Tt)!=="svelte-1od0z89"&&(Tt.innerHTML=fo),Qt=l(Ge),bt=c(Ge,"P",{"data-svelte-h":!0}),g(bt)!=="svelte-qr3t5r"&&(bt.innerHTML=ho),At=l(Ge),y(Se.$$.fragment,Ge),Ge.forEach(n),Zt=l(e),y(it.$$.fragment,e),Nt=l(e),Ee=c(e,"DIV",{class:!0});var _t=re(Ee);y(lt.$$.fragment,_t),Ot=l(_t),Ye=c(_t,"DIV",{class:!0});var Xt=re(Ye);y(dt.$$.fragment,Xt),Kt=l(Xt),yt=c(Xt,"P",{"data-svelte-h":!0}),g(yt)!=="svelte-khengj"&&(yt.textContent=go),Xt.forEach(n),_t.forEach(n),Pt=l(e),y(ct.$$.fragment,e),Rt=l(e),He=c(e,"DIV",{class:!0});var xt=re(He);y(mt.$$.fragment,xt),eo=l(xt),vt=c(xt,"P",{"data-svelte-h":!0}),g(vt)!=="svelte-1ebexfn"&&(vt.textContent=uo),to=l(xt),De=c(xt,"DIV",{class:!0});var St=re(De);y(pt.$$.fragment,St),oo=l(St),Mt=c(St,"P",{"data-svelte-h":!0}),g(Mt)!=="svelte-1x3yxsa"&&(Mt.textContent=_o),St.forEach(n),xt.forEach(n),Lt=l(e),y(ft.$$.fragment,e),Ht=l(e),Be=c(e,"DIV",{class:!0});var Vt=re(Be);y(ht.$$.fragment,Vt),no=l(Vt),$t=c(Vt,"P",{"data-svelte-h":!0}),g($t)!=="svelte-xw8p39"&&($t.textContent=To),so=l(Vt),Qe=c(Vt,"DIV",{class:!0});var Yt=re(Qe);y(gt.$$.fragment,Yt),ao=l(Yt),wt=c(Yt,"P",{"data-svelte-h":!0}),g(wt)!=="svelte-1x3yxsa"&&(wt.textContent=bo),Yt.forEach(n),Vt.forEach(n),Bt=l(e),y(Ae.$$.fragment,e),Gt=l(e),y(ut.$$.fragment,e),qt=l(e),Ct=c(e,"P",{}),re(Ct).forEach(n),this.h()},h(){A(t,"name","hf:doc:metadata"),A(t,"content",on),vo(E.src,Ce="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/vit_architecture.jpg")||A(E,"src",Ce),A(E,"alt","drawing"),A(E,"width","600"),A(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Be,"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){m(document.head,t),r(e,p,f),r(e,o,f),r(e,a,f),v(_,e,f),r(e,s,f),v(x,e,f),r(e,ie,f),r(e,j,f),r(e,le,f),r(e,z,f),r(e,de,f),r(e,u,f),r(e,G,f),r(e,E,f),r(e,ye,f),r(e,J,f),r(e,pe,f),r(e,O,f),r(e,je,f),r(e,N,f),r(e,U,f),r(e,te,f),r(e,q,f),r(e,W,f),r(e,K,f),v(fe,e,f),r(e,Fe,f),r(e,oe,f),r(e,ne,f),v($e,e,f),r(e,se,f),r(e,ee,f),r(e,L,f),r(e,me,f),r(e,he,f),v(Je,e,f),r(e,ge,f),r(e,P,f),r(e,ve,f),r(e,ae,f),r(e,C,f),r(e,H,f),r(e,X,f),v(we,e,f),r(e,V,f),r(e,I,f),r(e,Y,f),r(e,h,f),r(e,ze,f),v(_e,e,f),r(e,We,f),r(e,Te,f),r(e,Ke,f),r(e,qe,f),r(e,It,f),r(e,et,f),r(e,jt,f),r(e,tt,f),r(e,kt,f),r(e,ot,f),r(e,Ut,f),r(e,nt,f),r(e,Jt,f),r(e,st,f),r(e,zt,f),v(at,e,f),r(e,Wt,f),r(e,Re,f),v(rt,Re,null),m(Re,Dt),m(Re,Tt),m(Re,Qt),m(Re,bt),m(Re,At),v(Se,Re,null),r(e,Zt,f),v(it,e,f),r(e,Nt,f),r(e,Ee,f),v(lt,Ee,null),m(Ee,Ot),m(Ee,Ye),v(dt,Ye,null),m(Ye,Kt),m(Ye,yt),r(e,Pt,f),v(ct,e,f),r(e,Rt,f),r(e,He,f),v(mt,He,null),m(He,eo),m(He,vt),m(He,to),m(He,De),v(pt,De,null),m(De,oo),m(De,Mt),r(e,Lt,f),v(ft,e,f),r(e,Ht,f),r(e,Be,f),v(ht,Be,null),m(Be,no),m(Be,$t),m(Be,so),m(Be,Qe),v(gt,Qe,null),m(Qe,ao),m(Qe,wt),r(e,Bt,f),v(Ae,e,f),r(e,Gt,f),v(ut,e,f),r(e,qt,f),r(e,Ct,f),Et=!0},p(e,[f]){const Ge={};f&2&&(Ge.$$scope={dirty:f,ctx:e}),Se.$set(Ge);const _t={};f&2&&(_t.$$scope={dirty:f,ctx:e}),Ae.$set(_t)},i(e){Et||(M(_.$$.fragment,e),M(x.$$.fragment,e),M(fe.$$.fragment,e),M($e.$$.fragment,e),M(Je.$$.fragment,e),M(we.$$.fragment,e),M(_e.$$.fragment,e),M(at.$$.fragment,e),M(rt.$$.fragment,e),M(Se.$$.fragment,e),M(it.$$.fragment,e),M(lt.$$.fragment,e),M(dt.$$.fragment,e),M(ct.$$.fragment,e),M(mt.$$.fragment,e),M(pt.$$.fragment,e),M(ft.$$.fragment,e),M(ht.$$.fragment,e),M(gt.$$.fragment,e),M(Ae.$$.fragment,e),M(ut.$$.fragment,e),Et=!0)},o(e){$(_.$$.fragment,e),$(x.$$.fragment,e),$(fe.$$.fragment,e),$($e.$$.fragment,e),$(Je.$$.fragment,e),$(we.$$.fragment,e),$(_e.$$.fragment,e),$(at.$$.fragment,e),$(rt.$$.fragment,e),$(Se.$$.fragment,e),$(it.$$.fragment,e),$(lt.$$.fragment,e),$(dt.$$.fragment,e),$(ct.$$.fragment,e),$(mt.$$.fragment,e),$(pt.$$.fragment,e),$(ft.$$.fragment,e),$(ht.$$.fragment,e),$(gt.$$.fragment,e),$(Ae.$$.fragment,e),$(ut.$$.fragment,e),Et=!1},d(e){e&&(n(p),n(o),n(a),n(s),n(ie),n(j),n(le),n(z),n(de),n(u),n(G),n(E),n(ye),n(J),n(pe),n(O),n(je),n(N),n(U),n(te),n(q),n(W),n(K),n(Fe),n(oe),n(ne),n(se),n(ee),n(L),n(me),n(he),n(ge),n(P),n(ve),n(ae),n(C),n(H),n(X),n(V),n(I),n(Y),n(h),n(ze),n(We),n(Te),n(Ke),n(qe),n(It),n(et),n(jt),n(tt),n(kt),n(ot),n(Ut),n(nt),n(Jt),n(st),n(zt),n(Wt),n(Re),n(Zt),n(Nt),n(Ee),n(Pt),n(Rt),n(He),n(Lt),n(Ht),n(Be),n(Bt),n(Gt),n(qt),n(Ct)),n(t),w(_,e),w(x,e),w(fe,e),w($e,e),w(Je,e),w(we,e),w(_e,e),w(at,e),w(rt),w(Se),w(it,e),w(lt),w(dt),w(ct,e),w(mt),w(pt),w(ft,e),w(ht),w(gt),w(Ae,e),w(ut,e)}}}const on='{"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 nn(F){return Mo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hn extends $o{constructor(t){super(),wo(this,t,nn,tn,yo,{})}}export{hn as component};
