import{s as no,f as so,o as ao,n as ye}from"../chunks/scheduler.25b97de1.js";import{S as ro,i as io,g as d,s as i,r as b,A as lo,h as c,f as s,c as l,j as Te,u as v,x as u,k as ee,y as m,a as r,v as y,d as w,t as M,w as $}from"../chunks/index.d9030fc9.js";import{T as Le}from"../chunks/Tip.baa67368.js";import{D as $e}from"../chunks/Docstring.e257edda.js";import{C as qe}from"../chunks/CodeBlock.e6cd0d95.js";import{F as co,M as Xt}from"../chunks/Markdown.7217f838.js";import{E as Qe}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as mo}from"../chunks/PipelineTag.5f100392.js";import{H as ze,E as po}from"../chunks/EditOnGithub.91d95064.js";function ho(V){let e,p="Example:",o,a,_;return a=new qe({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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-11lpom8"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function fo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function uo(V){let e,p="Example:",o,a,_;return a=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEFtb2RlbCUyMCUzRCUyMFZpVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",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>)
<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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-11lpom8"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function go(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-7i3y9o"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function _o(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function To(V){let e,p="Examples:",o,a,_;return a=new qe({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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-kvfsh7"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function bo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-111lhr1"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function vo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function yo(V){let e,p="Example:",o,a,_;return a=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",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>)
<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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-11lpom8"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function wo(V){let e,p,o,a,_,n,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.`,re,I,H,ie,Z,S='The <a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.ViTModel">ViTModel</a> forward method, overrides the <code>__call__</code> special method.',le,g,N,G,q,je,be,J,de,me,D,Ce='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>.',Ie,z,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,E,W,Fe,O,pe='The <a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.ViTForMaskedImageModeling">ViTForMaskedImageModeling</a> forward method, overrides the <code>__call__</code> special method.',Ve,oe,ke,ne,we,se,K,A,L,ce,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,fe,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,j,R,B,X='The <a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Me,F,C,Q,Y;return e=new ze({props:{title:"ViTModel",local:"transformers.ViTModel",headingTag:"h2"}}),a=new $e({props:{name:"class transformers.ViTModel",anchor:"transformers.ViTModel",parameters:[{name:"config",val:": ViTConfig"},{name:"add_pooling_layer",val:": bool = True"},{name:"use_mask_token",val:": bool = False"}],parametersDescription:[{anchor:"transformers.ViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_vit.py#L538"}}),H=new $e({props:{name:"forward",anchor:"transformers.ViTModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"bool_masked_pos",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30799/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30799/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_30799/en/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/vr_30799/src/transformers/models/vit/modeling_vit.py#L567",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30799/en/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/pr_30799/en/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/pr_30799/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),g=new Le({props:{$$slots:{default:[fo]},$$scope:{ctx:V}}}),G=new Qe({props:{anchor:"transformers.ViTModel.forward.example",$$slots:{default:[uo]},$$scope:{ctx:V}}}),je=new ze({props:{title:"ViTForMaskedImageModeling",local:"transformers.ViTForMaskedImageModeling",headingTag:"h2"}}),de=new $e({props:{name:"class transformers.ViTForMaskedImageModeling",anchor:"transformers.ViTForMaskedImageModeling",parameters:[{name:"config",val:": ViTConfig"}],parametersDescription:[{anchor:"transformers.ViTForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_vit.py#L652"}}),z=new Le({props:{$$slots:{default:[go]},$$scope:{ctx:V}}}),W=new $e({props:{name:"forward",anchor:"transformers.ViTForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"bool_masked_pos",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30799/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30799/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_30799/en/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/vr_30799/src/transformers/models/vit/modeling_vit.py#L682",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/pr_30799/en/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:[_o]},$$scope:{ctx:V}}}),ne=new Qe({props:{anchor:"transformers.ViTForMaskedImageModeling.forward.example",$$slots:{default:[To]},$$scope:{ctx:V}}}),se=new ze({props:{title:"ViTForImageClassification",local:"transformers.ViTForImageClassification",headingTag:"h2"}}),L=new $e({props:{name:"class transformers.ViTForImageClassification",anchor:"transformers.ViTForImageClassification",parameters:[{name:"config",val:": ViTConfig"}],parametersDescription:[{anchor:"transformers.ViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_vit.py#L778"}}),fe=new Le({props:{$$slots:{default:[bo]},$$scope:{ctx:V}}}),j=new $e({props:{name:"forward",anchor:"transformers.ViTForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30799/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30799/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_30799/en/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/vr_30799/src/transformers/models/vit/modeling_vit.py#L806",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30799/en/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/pr_30799/en/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/pr_30799/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),F=new Le({props:{$$slots:{default:[vo]},$$scope:{ctx:V}}}),Q=new Qe({props:{anchor:"transformers.ViTForImageClassification.forward.example",$$slots:{default:[yo]},$$scope:{ctx:V}}}),{c(){b(e.$$.fragment),p=i(),o=d("div"),b(a.$$.fragment),_=i(),n=d("p"),n.innerHTML=x,re=i(),I=d("div"),b(H.$$.fragment),ie=i(),Z=d("p"),Z.innerHTML=S,le=i(),b(g.$$.fragment),N=i(),b(G.$$.fragment),q=i(),b(je.$$.fragment),be=i(),J=d("div"),b(de.$$.fragment),me=i(),D=d("p"),D.innerHTML=Ce,Ie=i(),b(z.$$.fragment),Ne=i(),U=d("p"),U.innerHTML=te,xe=i(),E=d("div"),b(W.$$.fragment),Fe=i(),O=d("p"),O.innerHTML=pe,Ve=i(),b(oe.$$.fragment),ke=i(),b(ne.$$.fragment),we=i(),b(se.$$.fragment),K=i(),A=d("div"),b(L.$$.fragment),ce=i(),Ue=d("p"),Ue.textContent=he,Je=i(),b(fe.$$.fragment),P=i(),ue=d("p"),ue.innerHTML=ve,ae=i(),T=d("div"),b(j.$$.fragment),R=i(),B=d("p"),B.innerHTML=X,Me=i(),b(F.$$.fragment),C=i(),b(Q.$$.fragment),this.h()},l(h){v(e.$$.fragment,h),p=l(h),o=c(h,"DIV",{class:!0});var k=Te(o);v(a.$$.fragment,k),_=l(k),n=c(k,"P",{"data-svelte-h":!0}),u(n)!=="svelte-ulamh0"&&(n.innerHTML=x),re=l(k),I=c(k,"DIV",{class:!0});var Ze=Te(I);v(H.$$.fragment,Ze),ie=l(Ze),Z=c(Ze,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-grnm4y"&&(Z.innerHTML=S),le=l(Ze),v(g.$$.fragment,Ze),N=l(Ze),v(G.$$.fragment,Ze),Ze.forEach(s),k.forEach(s),q=l(h),v(je.$$.fragment,h),be=l(h),J=c(h,"DIV",{class:!0});var ge=Te(J);v(de.$$.fragment,ge),me=l(ge),D=c(ge,"P",{"data-svelte-h":!0}),u(D)!=="svelte-hwvz1m"&&(D.innerHTML=Ce),Ie=l(ge),v(z.$$.fragment,ge),Ne=l(ge),U=c(ge,"P",{"data-svelte-h":!0}),u(U)!=="svelte-1gjh92c"&&(U.innerHTML=te),xe=l(ge),E=c(ge,"DIV",{class:!0});var We=Te(E);v(W.$$.fragment,We),Fe=l(We),O=c(We,"P",{"data-svelte-h":!0}),u(O)!=="svelte-10s0ixy"&&(O.innerHTML=pe),Ve=l(We),v(oe.$$.fragment,We),ke=l(We),v(ne.$$.fragment,We),We.forEach(s),ge.forEach(s),we=l(h),v(se.$$.fragment,h),K=l(h),A=c(h,"DIV",{class:!0});var _e=Te(A);v(L.$$.fragment,_e),ce=l(_e),Ue=c(_e,"P",{"data-svelte-h":!0}),u(Ue)!=="svelte-ju5wm2"&&(Ue.textContent=he),Je=l(_e),v(fe.$$.fragment,_e),P=l(_e),ue=c(_e,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-1gjh92c"&&(ue.innerHTML=ve),ae=l(_e),T=c(_e,"DIV",{class:!0});var Pe=Te(T);v(j.$$.fragment,Pe),R=l(Pe),B=c(Pe,"P",{"data-svelte-h":!0}),u(B)!=="svelte-15ljxi2"&&(B.innerHTML=X),Me=l(Pe),v(F.$$.fragment,Pe),C=l(Pe),v(Q.$$.fragment,Pe),Pe.forEach(s),_e.forEach(s),this.h()},h(){ee(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(A,"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){y(e,h,k),r(h,p,k),r(h,o,k),y(a,o,null),m(o,_),m(o,n),m(o,re),m(o,I),y(H,I,null),m(I,ie),m(I,Z),m(I,le),y(g,I,null),m(I,N),y(G,I,null),r(h,q,k),y(je,h,k),r(h,be,k),r(h,J,k),y(de,J,null),m(J,me),m(J,D),m(J,Ie),y(z,J,null),m(J,Ne),m(J,U),m(J,xe),m(J,E),y(W,E,null),m(E,Fe),m(E,O),m(E,Ve),y(oe,E,null),m(E,ke),y(ne,E,null),r(h,we,k),y(se,h,k),r(h,K,k),r(h,A,k),y(L,A,null),m(A,ce),m(A,Ue),m(A,Je),y(fe,A,null),m(A,P),m(A,ue),m(A,ae),m(A,T),y(j,T,null),m(T,R),m(T,B),m(T,Me),y(F,T,null),m(T,C),y(Q,T,null),Y=!0},p(h,k){const Ze={};k&2&&(Ze.$$scope={dirty:k,ctx:h}),g.$set(Ze);const ge={};k&2&&(ge.$$scope={dirty:k,ctx:h}),G.$set(ge);const We={};k&2&&(We.$$scope={dirty:k,ctx:h}),z.$set(We);const _e={};k&2&&(_e.$$scope={dirty:k,ctx:h}),oe.$set(_e);const Pe={};k&2&&(Pe.$$scope={dirty:k,ctx:h}),ne.$set(Pe);const De={};k&2&&(De.$$scope={dirty:k,ctx:h}),fe.$set(De);const Ge={};k&2&&(Ge.$$scope={dirty:k,ctx:h}),F.$set(Ge);const bt={};k&2&&(bt.$$scope={dirty:k,ctx:h}),Q.$set(bt)},i(h){Y||(w(e.$$.fragment,h),w(a.$$.fragment,h),w(H.$$.fragment,h),w(g.$$.fragment,h),w(G.$$.fragment,h),w(je.$$.fragment,h),w(de.$$.fragment,h),w(z.$$.fragment,h),w(W.$$.fragment,h),w(oe.$$.fragment,h),w(ne.$$.fragment,h),w(se.$$.fragment,h),w(L.$$.fragment,h),w(fe.$$.fragment,h),w(j.$$.fragment,h),w(F.$$.fragment,h),w(Q.$$.fragment,h),Y=!0)},o(h){M(e.$$.fragment,h),M(a.$$.fragment,h),M(H.$$.fragment,h),M(g.$$.fragment,h),M(G.$$.fragment,h),M(je.$$.fragment,h),M(de.$$.fragment,h),M(z.$$.fragment,h),M(W.$$.fragment,h),M(oe.$$.fragment,h),M(ne.$$.fragment,h),M(se.$$.fragment,h),M(L.$$.fragment,h),M(fe.$$.fragment,h),M(j.$$.fragment,h),M(F.$$.fragment,h),M(Q.$$.fragment,h),Y=!1},d(h){h&&(s(p),s(o),s(q),s(be),s(J),s(we),s(K),s(A)),$(e,h),$(a),$(H),$(g),$(G),$(je,h),$(de),$(z),$(W),$(oe),$(ne),$(se,h),$(L),$(fe),$(j),$(F),$(Q)}}}function Mo(V){let e,p;return e=new Xt({props:{$$slots:{default:[wo]},$$scope:{ctx:V}}}),{c(){b(e.$$.fragment)},l(o){v(e.$$.fragment,o)},m(o,a){y(e,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),e.$set(_)},i(o){p||(w(e.$$.fragment,o),p=!0)},o(o){M(e.$$.fragment,o),p=!1},d(o){$(e,o)}}}function $o(V){let e,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>",n,x,re=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,I,H,ie=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,Z,S,le=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=d("p"),e.innerHTML=p,o=i(),a=d("ul"),a.innerHTML=_,n=i(),x=d("p"),x.innerHTML=re,I=i(),H=d("ul"),H.innerHTML=ie,Z=i(),S=d("p"),S.innerHTML=le},l(g){e=c(g,"P",{"data-svelte-h":!0}),u(e)!=="svelte-1ajbfxg"&&(e.innerHTML=p),o=l(g),a=c(g,"UL",{"data-svelte-h":!0}),u(a)!=="svelte-qm1t26"&&(a.innerHTML=_),n=l(g),x=c(g,"P",{"data-svelte-h":!0}),u(x)!=="svelte-1v9qsc5"&&(x.innerHTML=re),I=l(g),H=c(g,"UL",{"data-svelte-h":!0}),u(H)!=="svelte-99h8aq"&&(H.innerHTML=ie),Z=l(g),S=c(g,"P",{"data-svelte-h":!0}),u(S)!=="svelte-1an3odd"&&(S.innerHTML=le)},m(g,N){r(g,e,N),r(g,o,N),r(g,a,N),r(g,n,N),r(g,x,N),r(g,I,N),r(g,H,N),r(g,Z,N),r(g,S,N)},p:ye,d(g){g&&(s(e),s(o),s(a),s(n),s(x),s(I),s(H),s(Z),s(S))}}}function xo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function Fo(V){let e,p="Example:",o,a,_;return a=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGVmlUTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtYmFzZS1wYXRjaDE2LTIyNC1pbjIxayUyMiklMEFtb2RlbCUyMCUzRCUyMFRGVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0LWluMjFrJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",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>)
<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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-11lpom8"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function Vo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-111lhr1"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function jo(V){let e,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>",n,x,re=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,I,H,ie=`<li>a single Tensor with <code>pixel_values</code> only and nothing else: <code>model(pixel_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([pixel_values, attention_mask])</code> or <code>model([pixel_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;pixel_values&quot;: pixel_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,Z,S,le=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=d("p"),e.innerHTML=p,o=i(),a=d("ul"),a.innerHTML=_,n=i(),x=d("p"),x.innerHTML=re,I=i(),H=d("ul"),H.innerHTML=ie,Z=i(),S=d("p"),S.innerHTML=le},l(g){e=c(g,"P",{"data-svelte-h":!0}),u(e)!=="svelte-1ajbfxg"&&(e.innerHTML=p),o=l(g),a=c(g,"UL",{"data-svelte-h":!0}),u(a)!=="svelte-qm1t26"&&(a.innerHTML=_),n=l(g),x=c(g,"P",{"data-svelte-h":!0}),u(x)!=="svelte-1v9qsc5"&&(x.innerHTML=re),I=l(g),H=c(g,"UL",{"data-svelte-h":!0}),u(H)!=="svelte-99h8aq"&&(H.innerHTML=ie),Z=l(g),S=c(g,"P",{"data-svelte-h":!0}),u(S)!=="svelte-1an3odd"&&(S.innerHTML=le)},m(g,N){r(g,e,N),r(g,o,N),r(g,a,N),r(g,n,N),r(g,x,N),r(g,I,N),r(g,H,N),r(g,Z,N),r(g,S,N)},p:ye,d(g){g&&(s(e),s(o),s(a),s(n),s(x),s(I),s(H),s(Z),s(S))}}}function Co(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function Io(V){let e,p="Example:",o,a,_;return a=new qe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGVmlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlZpVEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",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>)
<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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-11lpom8"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function ko(V){let e,p,o,a,_,n,x="The bare ViT Model transformer outputting raw hidden-states without any specific head on top.",re,I,H=`This model inherits from <a href="/docs/transformers/pr_30799/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ie,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.`,le,g,N,G,q,je,be,J='The <a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.TFViTModel">TFViTModel</a> forward method, overrides the <code>__call__</code> special method.',de,me,D,Ce,Ie,z,Ne,U,te,xe,E,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.`,Fe,O,pe,Ve,oe=`This model inherits from <a href="/docs/transformers/pr_30799/en/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,we=`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,K,A,L,ce,Ue,he,Je='The <a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.TFViTForImageClassification">TFViTForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',fe,P,ue,ve,ae;return e=new ze({props:{title:"TFViTModel",local:"transformers.TFViTModel",headingTag:"h2"}}),a=new $e({props:{name:"class transformers.TFViTModel",anchor:"transformers.TFViTModel",parameters:[{name:"config",val:": ViTConfig"},{name:"*inputs",val:""},{name:"add_pooling_layer",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_tf_vit.py#L736"}}),g=new Le({props:{$$slots:{default:[$o]},$$scope:{ctx:V}}}),q=new $e({props:{name:"call",anchor:"transformers.TFViTModel.call",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFViTModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30799/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30799/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_30799/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/vr_30799/src/transformers/models/vit/modeling_tf_vit.py#L746",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30799/en/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/pr_30799/en/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/pr_30799/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),me=new Le({props:{$$slots:{default:[xo]},$$scope:{ctx:V}}}),Ce=new Qe({props:{anchor:"transformers.TFViTModel.call.example",$$slots:{default:[Fo]},$$scope:{ctx:V}}}),z=new ze({props:{title:"TFViTForImageClassification",local:"transformers.TFViTForImageClassification",headingTag:"h2"}}),te=new $e({props:{name:"class transformers.TFViTForImageClassification",anchor:"transformers.TFViTForImageClassification",parameters:[{name:"config",val:": ViTConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_tf_vit.py#L815"}}),O=new Le({props:{$$slots:{default:[Vo]},$$scope:{ctx:V}}}),K=new Le({props:{$$slots:{default:[jo]},$$scope:{ctx:V}}}),ce=new $e({props:{name:"call",anchor:"transformers.TFViTForImageClassification.call",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFViTForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30799/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30799/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_30799/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/vr_30799/src/transformers/models/vit/modeling_tf_vit.py#L845",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30799/en/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/pr_30799/en/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/pr_30799/en/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:[Co]},$$scope:{ctx:V}}}),ve=new Qe({props:{anchor:"transformers.TFViTForImageClassification.call.example",$$slots:{default:[Io]},$$scope:{ctx:V}}}),{c(){b(e.$$.fragment),p=i(),o=d("div"),b(a.$$.fragment),_=i(),n=d("p"),n.textContent=x,re=i(),I=d("p"),I.innerHTML=H,ie=i(),Z=d("p"),Z.innerHTML=S,le=i(),b(g.$$.fragment),N=i(),G=d("div"),b(q.$$.fragment),je=i(),be=d("p"),be.innerHTML=J,de=i(),b(me.$$.fragment),D=i(),b(Ce.$$.fragment),Ie=i(),b(z.$$.fragment),Ne=i(),U=d("div"),b(te.$$.fragment),xe=i(),E=d("p"),E.textContent=W,Fe=i(),b(O.$$.fragment),pe=i(),Ve=d("p"),Ve.innerHTML=oe,ke=i(),ne=d("p"),ne.innerHTML=we,se=i(),b(K.$$.fragment),A=i(),L=d("div"),b(ce.$$.fragment),Ue=i(),he=d("p"),he.innerHTML=Je,fe=i(),b(P.$$.fragment),ue=i(),b(ve.$$.fragment),this.h()},l(T){v(e.$$.fragment,T),p=l(T),o=c(T,"DIV",{class:!0});var j=Te(o);v(a.$$.fragment,j),_=l(j),n=c(j,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1vbye9a"&&(n.textContent=x),re=l(j),I=c(j,"P",{"data-svelte-h":!0}),u(I)!=="svelte-ntcufm"&&(I.innerHTML=H),ie=l(j),Z=c(j,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-1be7e3c"&&(Z.innerHTML=S),le=l(j),v(g.$$.fragment,j),N=l(j),G=c(j,"DIV",{class:!0});var R=Te(G);v(q.$$.fragment,R),je=l(R),be=c(R,"P",{"data-svelte-h":!0}),u(be)!=="svelte-1b1ejki"&&(be.innerHTML=J),de=l(R),v(me.$$.fragment,R),D=l(R),v(Ce.$$.fragment,R),R.forEach(s),j.forEach(s),Ie=l(T),v(z.$$.fragment,T),Ne=l(T),U=c(T,"DIV",{class:!0});var B=Te(U);v(te.$$.fragment,B),xe=l(B),E=c(B,"P",{"data-svelte-h":!0}),u(E)!=="svelte-ju5wm2"&&(E.textContent=W),Fe=l(B),v(O.$$.fragment,B),pe=l(B),Ve=c(B,"P",{"data-svelte-h":!0}),u(Ve)!=="svelte-ntcufm"&&(Ve.innerHTML=oe),ke=l(B),ne=c(B,"P",{"data-svelte-h":!0}),u(ne)!=="svelte-1be7e3c"&&(ne.innerHTML=we),se=l(B),v(K.$$.fragment,B),A=l(B),L=c(B,"DIV",{class:!0});var X=Te(L);v(ce.$$.fragment,X),Ue=l(X),he=c(X,"P",{"data-svelte-h":!0}),u(he)!=="svelte-1kjotxq"&&(he.innerHTML=Je),fe=l(X),v(P.$$.fragment,X),ue=l(X),v(ve.$$.fragment,X),X.forEach(s),B.forEach(s),this.h()},h(){ee(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(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,j){y(e,T,j),r(T,p,j),r(T,o,j),y(a,o,null),m(o,_),m(o,n),m(o,re),m(o,I),m(o,ie),m(o,Z),m(o,le),y(g,o,null),m(o,N),m(o,G),y(q,G,null),m(G,je),m(G,be),m(G,de),y(me,G,null),m(G,D),y(Ce,G,null),r(T,Ie,j),y(z,T,j),r(T,Ne,j),r(T,U,j),y(te,U,null),m(U,xe),m(U,E),m(U,Fe),y(O,U,null),m(U,pe),m(U,Ve),m(U,ke),m(U,ne),m(U,se),y(K,U,null),m(U,A),m(U,L),y(ce,L,null),m(L,Ue),m(L,he),m(L,fe),y(P,L,null),m(L,ue),y(ve,L,null),ae=!0},p(T,j){const R={};j&2&&(R.$$scope={dirty:j,ctx:T}),g.$set(R);const B={};j&2&&(B.$$scope={dirty:j,ctx:T}),me.$set(B);const X={};j&2&&(X.$$scope={dirty:j,ctx:T}),Ce.$set(X);const Me={};j&2&&(Me.$$scope={dirty:j,ctx:T}),O.$set(Me);const F={};j&2&&(F.$$scope={dirty:j,ctx:T}),K.$set(F);const C={};j&2&&(C.$$scope={dirty:j,ctx:T}),P.$set(C);const Q={};j&2&&(Q.$$scope={dirty:j,ctx:T}),ve.$set(Q)},i(T){ae||(w(e.$$.fragment,T),w(a.$$.fragment,T),w(g.$$.fragment,T),w(q.$$.fragment,T),w(me.$$.fragment,T),w(Ce.$$.fragment,T),w(z.$$.fragment,T),w(te.$$.fragment,T),w(O.$$.fragment,T),w(K.$$.fragment,T),w(ce.$$.fragment,T),w(P.$$.fragment,T),w(ve.$$.fragment,T),ae=!0)},o(T){M(e.$$.fragment,T),M(a.$$.fragment,T),M(g.$$.fragment,T),M(q.$$.fragment,T),M(me.$$.fragment,T),M(Ce.$$.fragment,T),M(z.$$.fragment,T),M(te.$$.fragment,T),M(O.$$.fragment,T),M(K.$$.fragment,T),M(ce.$$.fragment,T),M(P.$$.fragment,T),M(ve.$$.fragment,T),ae=!1},d(T){T&&(s(p),s(o),s(Ie),s(Ne),s(U)),$(e,T),$(a),$(g),$(q),$(me),$(Ce),$(z,T),$(te),$(O),$(K),$(ce),$(P),$(ve)}}}function Uo(V){let e,p;return e=new Xt({props:{$$slots:{default:[ko]},$$scope:{ctx:V}}}),{c(){b(e.$$.fragment)},l(o){v(e.$$.fragment,o)},m(o,a){y(e,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),e.$set(_)},i(o){p||(w(e.$$.fragment,o),p=!0)},o(o){M(e.$$.fragment,o),p=!1},d(o){$(e,o)}}}function Jo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function Zo(V){let e,p="Examples:",o,a,_;return a=new qe({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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-kvfsh7"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function Wo(V){let e,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(){e=d("p"),e.innerHTML=p},l(o){e=c(o,"P",{"data-svelte-h":!0}),u(e)!=="svelte-fincs2"&&(e.innerHTML=p)},m(o,a){r(o,e,a)},p:ye,d(o){o&&s(e)}}}function No(V){let e,p="Example:",o,a,_;return a=new qe({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(){e=d("p"),e.textContent=p,o=i(),b(a.$$.fragment)},l(n){e=c(n,"P",{"data-svelte-h":!0}),u(e)!=="svelte-11lpom8"&&(e.textContent=p),o=l(n),v(a.$$.fragment,n)},m(n,x){r(n,e,x),r(n,o,x),y(a,n,x),_=!0},p:ye,i(n){_||(w(a.$$.fragment,n),_=!0)},o(n){M(a.$$.fragment,n),_=!1},d(n){n&&(s(e),s(o)),$(a,n)}}}function zo(V){let e,p,o,a,_,n,x="The bare ViT Model transformer outputting raw hidden-states without any specific head on top.",re,I,H=`This model inherits from <a href="/docs/transformers/pr_30799/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`,ie,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.`,le,g,N="Finally, this model supports inherent JAX features such as:",G,q,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>',be,J,de,me,D,Ce="The <code>FlaxViTPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Ie,z,Ne,U,te,xe,E,W,Fe,O,pe,Ve=`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/pr_30799/en/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)`,we,se,K=`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.`,A,L,ce="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>',fe,P,ue,ve,ae,T="The <code>FlaxViTPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",j,R,B,X,Me;return e=new ze({props:{title:"FlaxVitModel",local:"transformers.FlaxViTModel",headingTag:"h2"}}),a=new $e({props:{name:"class transformers.FlaxViTModel",anchor:"transformers.FlaxViTModel",parameters:[{name:"config",val:": ViTConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_30799/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_flax_vit.py#L552"}}),de=new $e({props:{name:"__call__",anchor:"transformers.FlaxViTModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_flax_vit.py#L472",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),z=new Le({props:{$$slots:{default:[Jo]},$$scope:{ctx:V}}}),U=new Qe({props:{anchor:"transformers.FlaxViTModel.__call__.example",$$slots:{default:[Zo]},$$scope:{ctx:V}}}),xe=new ze({props:{title:"FlaxViTForImageClassification",local:"transformers.FlaxViTForImageClassification",headingTag:"h2"}}),Fe=new $e({props:{name:"class transformers.FlaxViTForImageClassification",anchor:"transformers.FlaxViTForImageClassification",parameters:[{name:"config",val:": ViTConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30799/en/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/pr_30799/en/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/pr_30799/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_30799/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_flax_vit.py#L632"}}),ue=new $e({props:{name:"__call__",anchor:"transformers.FlaxViTForImageClassification.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/modeling_flax_vit.py#L472",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30799/en/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/pr_30799/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),R=new Le({props:{$$slots:{default:[Wo]},$$scope:{ctx:V}}}),X=new Qe({props:{anchor:"transformers.FlaxViTForImageClassification.__call__.example",$$slots:{default:[No]},$$scope:{ctx:V}}}),{c(){b(e.$$.fragment),p=i(),o=d("div"),b(a.$$.fragment),_=i(),n=d("p"),n.textContent=x,re=i(),I=d("p"),I.innerHTML=H,ie=i(),Z=d("p"),Z.innerHTML=S,le=i(),g=d("p"),g.textContent=N,G=i(),q=d("ul"),q.innerHTML=je,be=i(),J=d("div"),b(de.$$.fragment),me=i(),D=d("p"),D.innerHTML=Ce,Ie=i(),b(z.$$.fragment),Ne=i(),b(U.$$.fragment),te=i(),b(xe.$$.fragment),E=i(),W=d("div"),b(Fe.$$.fragment),O=i(),pe=d("p"),pe.textContent=Ve,oe=i(),ke=d("p"),ke.innerHTML=ne,we=i(),se=d("p"),se.innerHTML=K,A=i(),L=d("p"),L.textContent=ce,Ue=i(),he=d("ul"),he.innerHTML=Je,fe=i(),P=d("div"),b(ue.$$.fragment),ve=i(),ae=d("p"),ae.innerHTML=T,j=i(),b(R.$$.fragment),B=i(),b(X.$$.fragment),this.h()},l(F){v(e.$$.fragment,F),p=l(F),o=c(F,"DIV",{class:!0});var C=Te(o);v(a.$$.fragment,C),_=l(C),n=c(C,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1vbye9a"&&(n.textContent=x),re=l(C),I=c(C,"P",{"data-svelte-h":!0}),u(I)!=="svelte-60jni3"&&(I.innerHTML=H),ie=l(C),Z=c(C,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-10nfsf3"&&(Z.innerHTML=S),le=l(C),g=c(C,"P",{"data-svelte-h":!0}),u(g)!=="svelte-1pplc4a"&&(g.textContent=N),G=l(C),q=c(C,"UL",{"data-svelte-h":!0}),u(q)!=="svelte-1w7z84m"&&(q.innerHTML=je),be=l(C),J=c(C,"DIV",{class:!0});var Q=Te(J);v(de.$$.fragment,Q),me=l(Q),D=c(Q,"P",{"data-svelte-h":!0}),u(D)!=="svelte-8rbifc"&&(D.innerHTML=Ce),Ie=l(Q),v(z.$$.fragment,Q),Ne=l(Q),v(U.$$.fragment,Q),Q.forEach(s),C.forEach(s),te=l(F),v(xe.$$.fragment,F),E=l(F),W=c(F,"DIV",{class:!0});var Y=Te(W);v(Fe.$$.fragment,Y),O=l(Y),pe=c(Y,"P",{"data-svelte-h":!0}),u(pe)!=="svelte-ju5wm2"&&(pe.textContent=Ve),oe=l(Y),ke=c(Y,"P",{"data-svelte-h":!0}),u(ke)!=="svelte-60jni3"&&(ke.innerHTML=ne),we=l(Y),se=c(Y,"P",{"data-svelte-h":!0}),u(se)!=="svelte-10nfsf3"&&(se.innerHTML=K),A=l(Y),L=c(Y,"P",{"data-svelte-h":!0}),u(L)!=="svelte-1pplc4a"&&(L.textContent=ce),Ue=l(Y),he=c(Y,"UL",{"data-svelte-h":!0}),u(he)!=="svelte-1w7z84m"&&(he.innerHTML=Je),fe=l(Y),P=c(Y,"DIV",{class:!0});var h=Te(P);v(ue.$$.fragment,h),ve=l(h),ae=c(h,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-8rbifc"&&(ae.innerHTML=T),j=l(h),v(R.$$.fragment,h),B=l(h),v(X.$$.fragment,h),h.forEach(s),Y.forEach(s),this.h()},h(){ee(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(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(F,C){y(e,F,C),r(F,p,C),r(F,o,C),y(a,o,null),m(o,_),m(o,n),m(o,re),m(o,I),m(o,ie),m(o,Z),m(o,le),m(o,g),m(o,G),m(o,q),m(o,be),m(o,J),y(de,J,null),m(J,me),m(J,D),m(J,Ie),y(z,J,null),m(J,Ne),y(U,J,null),r(F,te,C),y(xe,F,C),r(F,E,C),r(F,W,C),y(Fe,W,null),m(W,O),m(W,pe),m(W,oe),m(W,ke),m(W,we),m(W,se),m(W,A),m(W,L),m(W,Ue),m(W,he),m(W,fe),m(W,P),y(ue,P,null),m(P,ve),m(P,ae),m(P,j),y(R,P,null),m(P,B),y(X,P,null),Me=!0},p(F,C){const Q={};C&2&&(Q.$$scope={dirty:C,ctx:F}),z.$set(Q);const Y={};C&2&&(Y.$$scope={dirty:C,ctx:F}),U.$set(Y);const h={};C&2&&(h.$$scope={dirty:C,ctx:F}),R.$set(h);const k={};C&2&&(k.$$scope={dirty:C,ctx:F}),X.$set(k)},i(F){Me||(w(e.$$.fragment,F),w(a.$$.fragment,F),w(de.$$.fragment,F),w(z.$$.fragment,F),w(U.$$.fragment,F),w(xe.$$.fragment,F),w(Fe.$$.fragment,F),w(ue.$$.fragment,F),w(R.$$.fragment,F),w(X.$$.fragment,F),Me=!0)},o(F){M(e.$$.fragment,F),M(a.$$.fragment,F),M(de.$$.fragment,F),M(z.$$.fragment,F),M(U.$$.fragment,F),M(xe.$$.fragment,F),M(Fe.$$.fragment,F),M(ue.$$.fragment,F),M(R.$$.fragment,F),M(X.$$.fragment,F),Me=!1},d(F){F&&(s(p),s(o),s(te),s(E),s(W)),$(e,F),$(a),$(de),$(z),$(U),$(xe,F),$(Fe),$(ue),$(R),$(X)}}}function Po(V){let e,p;return e=new Xt({props:{$$slots:{default:[zo]},$$scope:{ctx:V}}}),{c(){b(e.$$.fragment)},l(o){v(e.$$.fragment,o)},m(o,a){y(e,o,a),p=!0},p(o,a){const _={};a&2&&(_.$$scope={dirty:a,ctx:o}),e.$set(_)},i(o){p||(w(e.$$.fragment,o),p=!0)},o(o){M(e.$$.fragment,o),p=!1},d(o){$(e,o)}}}function Ho(V){let e,p,o,a,_,n,x,re,I,H=`The Vision Transformer (ViT) model was proposed in <a href="https://arxiv.org/abs/2010.11929" rel="nofollow">An Image is Worth 16x16 Words: Transformers for Image Recognition
at Scale</a> by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk
Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob
Uszkoreit, Neil Houlsby. It’s the first paper that successfully trains a Transformer encoder on ImageNet, attaining
very good results compared to familiar convolutional architectures.`,ie,Z,S="The abstract from the paper is the following:",le,g,N=`<em>While the Transformer architecture has become the de-facto standard for natural language processing tasks, its
applications to computer vision remain limited. In vision, attention is either applied in conjunction with
convolutional networks, or used to replace certain components of convolutional networks while keeping their overall
structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to
sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of
data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.),
Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring
substantially fewer computational resources to train.</em>`,G,q,je,be,J,de='ViT architecture. Taken from the <a href="https://arxiv.org/abs/2010.11929">original paper.</a>',me,D,Ce="Following the original Vision Transformer, some follow-up works have been made:",Ie,z,Ne=`<li><p><a href="deit">DeiT</a> (Data-efficient Image Transformers) by Facebook AI. DeiT models are distilled vision transformers.
The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into <a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.ViTModel">ViTModel</a> or
<a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.ViTForImageClassification">ViTForImageClassification</a>. There are 4 variants available (in 3 different sizes): <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>. Note that one should
use <a href="/docs/transformers/pr_30799/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a> in order to prepare images for the model.</p></li> <li><p><a href="beit">BEiT</a> (BERT pre-training of Image Transformers) by Microsoft Research. BEiT models outperform supervised pre-trained
vision transformers using a self-supervised method inspired by BERT (masked image modeling) and based on a VQ-VAE.</p></li> <li><p>DINO (a method for self-supervised training of Vision Transformers) by Facebook AI. Vision Transformers trained using
the DINO method show very interesting properties not seen with convolutional models. They are capable of segmenting
objects, without having ever been trained to do so. DINO checkpoints can be found on the <a href="https://huggingface.co/models?other=dino" rel="nofollow">hub</a>.</p></li> <li><p><a href="vit_mae">MAE</a> (Masked Autoencoders) by Facebook AI. By pre-training Vision Transformers to reconstruct pixel values for a high portion
(75%) of masked patches (using an asymmetric encoder-decoder architecture), the authors show that this simple method outperforms
supervised pre-training after fine-tuning.</p></li>`,U,te,xe=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>. The original code (written in JAX) can be
found <a href="https://github.com/google-research/vision_transformer" rel="nofollow">here</a>.`,E,W,Fe=`Note that we converted the weights from Ross Wightman’s <a href="https://github.com/rwightman/pytorch-image-models" rel="nofollow">timm library</a>,
who already converted the weights from JAX to PyTorch. Credits go to him!`,O,pe,Ve,oe,ke=`<li>To feed images to the Transformer encoder, each image is split into a sequence of fixed-size non-overlapping patches,
which are then linearly embedded. A [CLS] token is added to serve as representation of an entire image, which can be
used for classification. The authors also add absolute position embeddings, and feed the resulting sequence of
vectors to a standard Transformer encoder.</li> <li>As the Vision Transformer expects each image to be of the same size (resolution), one can use
<a href="/docs/transformers/pr_30799/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> to resize (or rescale) and normalize images for the model.</li> <li>Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, <code>google/vit-base-patch16-224</code> refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the <a href="https://huggingface.co/models?search=vit" rel="nofollow">hub</a>.</li> <li>The available checkpoints are either (1) pre-trained on <a href="http://www.image-net.org/" rel="nofollow">ImageNet-21k</a> (a collection of
14 million images and 21k classes) only, or (2) also fine-tuned on <a href="http://www.image-net.org/challenges/LSVRC/2012/" rel="nofollow">ImageNet</a> (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).</li> <li>The Vision Transformer was pre-trained using a resolution of 224x224. During fine-tuning, it is often beneficial to
use a higher resolution than pre-training <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">(Kolesnikov
et al., 2020)</a>. In order to fine-tune at higher resolution, the authors perform
2D interpolation of the pre-trained position embeddings, according to their location in the original image.</li> <li>The best results are obtained with supervised pre-training, which is not the case in NLP. The authors also performed
an experiment with a self-supervised pre-training objective, namely masked patched prediction (inspired by masked
language modeling). With this approach, the smaller ViT-B/16 model achieves 79.9% accuracy on ImageNet, a significant
improvement of 2% to training from scratch, but still 4% behind supervised pre-training.</li>`,ne,we,se,K,A=`PyTorch includes a native scaled dot-product attention (SDPA) operator as part of <code>torch.nn.functional</code>. This function
encompasses several implementations that can be applied depending on the inputs and the hardware in use. See the
<a href="https://pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow">official documentation</a>
or the <a href="https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#pytorch-scaled-dot-product-attention" rel="nofollow">GPU Inference</a>
page for more information.`,L,ce,Ue=`SDPA is used by default for <code>torch&gt;=2.1.1</code> when an implementation is available, but you may also set
<code>attn_implementation=&quot;sdpa&quot;</code> in <code>from_pretrained()</code> to explicitly request SDPA to be used.`,he,Je,fe,P,ue="For the best speedups, we recommend loading the model in half-precision (e.g. <code>torch.float16</code> or <code>torch.bfloat16</code>).",ve,ae,T="On a local benchmark (A100-40GB, PyTorch 2.3.0, OS Ubuntu 22.04) with <code>float32</code> and <code>google/vit-base-patch16-224</code> model, we saw the following speedups during inference.",j,R,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,Me,F,C,Q=`Demo notebooks regarding inference as well as fine-tuning ViT on custom data can be found <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer" rel="nofollow">here</a>.
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with ViT. If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.`,Y,h,k="<code>ViTForImageClassification</code> is supported by:",Ze,ge,We,_e,Pe='<li>A blog post on how to <a href="https://huggingface.co/blog/fine-tune-vit" rel="nofollow">Fine-Tune ViT for Image Classification with Hugging Face Transformers</a></li> <li>A blog post on <a href="https://www.philschmid.de/image-classification-huggingface-transformers-keras" rel="nofollow">Image Classification with Hugging Face Transformers and <code>Keras</code></a></li> <li>A notebook on <a href="https://github.com/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">Fine-tuning for Image Classification with Hugging Face Transformers</a></li> <li>A notebook on how to <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">Fine-tune the Vision Transformer on CIFAR-10 with the Hugging Face Trainer</a></li> <li>A notebook on how to <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">Fine-tune the Vision Transformer on CIFAR-10 with PyTorch Lightning</a></li>',De,Ge,bt="⚗️ Optimization",yt,Oe,St='<li>A blog post on how to <a href="https://www.philschmid.de/optimizing-vision-transformer" rel="nofollow">Accelerate Vision Transformer (ViT) with Quantization using Optimum</a></li>',wt,Ke,Yt="⚡️ Inference",Mt,et,At='<li>A notebook on <a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Quick_demo_of_HuggingFace_version_of_Vision_Transformer_inference.ipynb" rel="nofollow">Quick demo: Vision Transformer (ViT) by Google Brain</a></li>',$t,tt,Qt="🚀 Deploy",xt,ot,Dt='<li>A blog post on <a href="https://huggingface.co/blog/tf-serving-vision" rel="nofollow">Deploying Tensorflow Vision Models in Hugging Face with TF Serving</a></li> <li>A blog post on <a href="https://huggingface.co/blog/deploy-vertex-ai" rel="nofollow">Deploying Hugging Face ViT on Vertex AI</a></li> <li>A blog post on <a href="https://huggingface.co/blog/deploy-tfserving-kubernetes" rel="nofollow">Deploying Hugging Face ViT on Kubernetes with TF Serving</a></li>',Ft,nt,Vt,He,st,Pt,ht,Ot=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30799/en/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.`,Ht,ft,Kt=`Configuration objects inherit from <a href="/docs/transformers/pr_30799/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_30799/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Lt,Xe,jt,at,Ct,Ee,rt,Rt,Se,it,Bt,ut,eo="Preprocess an image or a batch of images.",It,lt,kt,Re,dt,Gt,gt,to="Constructs a ViT image processor.",Et,Ye,ct,qt,_t,oo="Preprocess an image or batch of images.",Ut,Ae,Jt,mt,Zt,vt,Wt;return _=new ze({props:{title:"Vision Transformer (ViT)",local:"vision-transformer-vit",headingTag:"h1"}}),x=new ze({props:{title:"Overview",local:"overview",headingTag:"h2"}}),pe=new ze({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),we=new ze({props:{title:"Using Scaled Dot Product Attention (SDPA)",local:"using-scaled-dot-product-attention-sdpa",headingTag:"h3"}}),Je=new qe({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}}),Me=new ze({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ge=new mo({props:{pipeline:"image-classification"}}),nt=new ze({props:{title:"ViTConfig",local:"transformers.ViTConfig",headingTag:"h2"}}),st=new $e({props:{name:"class transformers.ViTConfig",anchor:"transformers.ViTConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"encoder_stride",val:" = 16"},{name:"**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"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/configuration_vit.py#L30"}}),Xe=new Qe({props:{anchor:"transformers.ViTConfig.example",$$slots:{default:[ho]},$$scope:{ctx:V}}}),at=new ze({props:{title:"ViTFeatureExtractor",local:"transformers.ViTFeatureExtractor",headingTag:"h2"}}),rt=new $e({props:{name:"class transformers.ViTFeatureExtractor",anchor:"transformers.ViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/feature_extraction_vit.py#L26"}}),it=new $e({props:{name:"__call__",anchor:"transformers.ViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/image_processing_utils.py#L560"}}),lt=new ze({props:{title:"ViTImageProcessor",local:"transformers.ViTImageProcessor",headingTag:"h2"}}),dt=new $e({props:{name:"class transformers.ViTImageProcessor",anchor:"transformers.ViTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = 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"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/image_processing_vit.py#L43"}}),ct=new $e({props:{name:"preprocess",anchor:"transformers.ViTImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Union = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],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"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/vit/image_processing_vit.py#L162"}}),Ae=new co({props:{pytorch:!0,tensorflow:!0,jax:!0,$$slots:{jax:[Po],tensorflow:[Uo],pytorch:[Mo]},$$scope:{ctx:V}}}),mt=new po({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/vit.md"}}),{c(){e=d("meta"),p=i(),o=d("p"),a=i(),b(_.$$.fragment),n=i(),b(x.$$.fragment),re=i(),I=d("p"),I.innerHTML=H,ie=i(),Z=d("p"),Z.textContent=S,le=i(),g=d("p"),g.innerHTML=N,G=i(),q=d("img"),be=i(),J=d("small"),J.innerHTML=de,me=i(),D=d("p"),D.textContent=Ce,Ie=i(),z=d("ul"),z.innerHTML=Ne,U=i(),te=d("p"),te.innerHTML=xe,E=i(),W=d("p"),W.innerHTML=Fe,O=i(),b(pe.$$.fragment),Ve=i(),oe=d("ul"),oe.innerHTML=ke,ne=i(),b(we.$$.fragment),se=i(),K=d("p"),K.innerHTML=A,L=i(),ce=d("p"),ce.innerHTML=Ue,he=i(),b(Je.$$.fragment),fe=i(),P=d("p"),P.innerHTML=ue,ve=i(),ae=d("p"),ae.innerHTML=T,j=i(),R=d("table"),R.innerHTML=B,X=i(),b(Me.$$.fragment),F=i(),C=d("p"),C.innerHTML=Q,Y=i(),h=d("p"),h.innerHTML=k,Ze=i(),b(ge.$$.fragment),We=i(),_e=d("ul"),_e.innerHTML=Pe,De=i(),Ge=d("p"),Ge.textContent=bt,yt=i(),Oe=d("ul"),Oe.innerHTML=St,wt=i(),Ke=d("p"),Ke.textContent=Yt,Mt=i(),et=d("ul"),et.innerHTML=At,$t=i(),tt=d("p"),tt.textContent=Qt,xt=i(),ot=d("ul"),ot.innerHTML=Dt,Ft=i(),b(nt.$$.fragment),Vt=i(),He=d("div"),b(st.$$.fragment),Pt=i(),ht=d("p"),ht.innerHTML=Ot,Ht=i(),ft=d("p"),ft.innerHTML=Kt,Lt=i(),b(Xe.$$.fragment),jt=i(),b(at.$$.fragment),Ct=i(),Ee=d("div"),b(rt.$$.fragment),Rt=i(),Se=d("div"),b(it.$$.fragment),Bt=i(),ut=d("p"),ut.textContent=eo,It=i(),b(lt.$$.fragment),kt=i(),Re=d("div"),b(dt.$$.fragment),Gt=i(),gt=d("p"),gt.textContent=to,Et=i(),Ye=d("div"),b(ct.$$.fragment),qt=i(),_t=d("p"),_t.textContent=oo,Ut=i(),b(Ae.$$.fragment),Jt=i(),b(mt.$$.fragment),Zt=i(),vt=d("p"),this.h()},l(t){const f=lo("svelte-u9bgzb",document.head);e=c(f,"META",{name:!0,content:!0}),f.forEach(s),p=l(t),o=c(t,"P",{}),Te(o).forEach(s),a=l(t),v(_.$$.fragment,t),n=l(t),v(x.$$.fragment,t),re=l(t),I=c(t,"P",{"data-svelte-h":!0}),u(I)!=="svelte-mxwj6a"&&(I.innerHTML=H),ie=l(t),Z=c(t,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-vfdo9a"&&(Z.textContent=S),le=l(t),g=c(t,"P",{"data-svelte-h":!0}),u(g)!=="svelte-yjj3f8"&&(g.innerHTML=N),G=l(t),q=c(t,"IMG",{src:!0,alt:!0,width:!0}),be=l(t),J=c(t,"SMALL",{"data-svelte-h":!0}),u(J)!=="svelte-7mkw5i"&&(J.innerHTML=de),me=l(t),D=c(t,"P",{"data-svelte-h":!0}),u(D)!=="svelte-ghhnmw"&&(D.textContent=Ce),Ie=l(t),z=c(t,"UL",{"data-svelte-h":!0}),u(z)!=="svelte-idazvg"&&(z.innerHTML=Ne),U=l(t),te=c(t,"P",{"data-svelte-h":!0}),u(te)!=="svelte-pwnwoc"&&(te.innerHTML=xe),E=l(t),W=c(t,"P",{"data-svelte-h":!0}),u(W)!=="svelte-11xcw47"&&(W.innerHTML=Fe),O=l(t),v(pe.$$.fragment,t),Ve=l(t),oe=c(t,"UL",{"data-svelte-h":!0}),u(oe)!=="svelte-ujcwmo"&&(oe.innerHTML=ke),ne=l(t),v(we.$$.fragment,t),se=l(t),K=c(t,"P",{"data-svelte-h":!0}),u(K)!=="svelte-1cid2pe"&&(K.innerHTML=A),L=l(t),ce=c(t,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-1x11lxg"&&(ce.innerHTML=Ue),he=l(t),v(Je.$$.fragment,t),fe=l(t),P=c(t,"P",{"data-svelte-h":!0}),u(P)!=="svelte-djb2w0"&&(P.innerHTML=ue),ve=l(t),ae=c(t,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-18g4o0h"&&(ae.innerHTML=T),j=l(t),R=c(t,"TABLE",{"data-svelte-h":!0}),u(R)!=="svelte-vyu660"&&(R.innerHTML=B),X=l(t),v(Me.$$.fragment,t),F=l(t),C=c(t,"P",{"data-svelte-h":!0}),u(C)!=="svelte-152spv0"&&(C.innerHTML=Q),Y=l(t),h=c(t,"P",{"data-svelte-h":!0}),u(h)!=="svelte-qrf7lp"&&(h.innerHTML=k),Ze=l(t),v(ge.$$.fragment,t),We=l(t),_e=c(t,"UL",{"data-svelte-h":!0}),u(_e)!=="svelte-1fybkhs"&&(_e.innerHTML=Pe),De=l(t),Ge=c(t,"P",{"data-svelte-h":!0}),u(Ge)!=="svelte-liq2q7"&&(Ge.textContent=bt),yt=l(t),Oe=c(t,"UL",{"data-svelte-h":!0}),u(Oe)!=="svelte-1vxkfqp"&&(Oe.innerHTML=St),wt=l(t),Ke=c(t,"P",{"data-svelte-h":!0}),u(Ke)!=="svelte-1wntqpp"&&(Ke.textContent=Yt),Mt=l(t),et=c(t,"UL",{"data-svelte-h":!0}),u(et)!=="svelte-1q3e2i6"&&(et.innerHTML=At),$t=l(t),tt=c(t,"P",{"data-svelte-h":!0}),u(tt)!=="svelte-lk14e4"&&(tt.textContent=Qt),xt=l(t),ot=c(t,"UL",{"data-svelte-h":!0}),u(ot)!=="svelte-1e4wiq4"&&(ot.innerHTML=Dt),Ft=l(t),v(nt.$$.fragment,t),Vt=l(t),He=c(t,"DIV",{class:!0});var Be=Te(He);v(st.$$.fragment,Be),Pt=l(Be),ht=c(Be,"P",{"data-svelte-h":!0}),u(ht)!=="svelte-qizona"&&(ht.innerHTML=Ot),Ht=l(Be),ft=c(Be,"P",{"data-svelte-h":!0}),u(ft)!=="svelte-ovej1r"&&(ft.innerHTML=Kt),Lt=l(Be),v(Xe.$$.fragment,Be),Be.forEach(s),jt=l(t),v(at.$$.fragment,t),Ct=l(t),Ee=c(t,"DIV",{class:!0});var pt=Te(Ee);v(rt.$$.fragment,pt),Rt=l(pt),Se=c(pt,"DIV",{class:!0});var Nt=Te(Se);v(it.$$.fragment,Nt),Bt=l(Nt),ut=c(Nt,"P",{"data-svelte-h":!0}),u(ut)!=="svelte-khengj"&&(ut.textContent=eo),Nt.forEach(s),pt.forEach(s),It=l(t),v(lt.$$.fragment,t),kt=l(t),Re=c(t,"DIV",{class:!0});var Tt=Te(Re);v(dt.$$.fragment,Tt),Gt=l(Tt),gt=c(Tt,"P",{"data-svelte-h":!0}),u(gt)!=="svelte-1ebexfn"&&(gt.textContent=to),Et=l(Tt),Ye=c(Tt,"DIV",{class:!0});var zt=Te(Ye);v(ct.$$.fragment,zt),qt=l(zt),_t=c(zt,"P",{"data-svelte-h":!0}),u(_t)!=="svelte-1x3yxsa"&&(_t.textContent=oo),zt.forEach(s),Tt.forEach(s),Ut=l(t),v(Ae.$$.fragment,t),Jt=l(t),v(mt.$$.fragment,t),Zt=l(t),vt=c(t,"P",{}),Te(vt).forEach(s),this.h()},h(){ee(e,"name","hf:doc:metadata"),ee(e,"content",Lo),so(q.src,je="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/vit_architecture.jpg")||ee(q,"src",je),ee(q,"alt","drawing"),ee(q,"width","600"),ee(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(Re,"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,f){m(document.head,e),r(t,p,f),r(t,o,f),r(t,a,f),y(_,t,f),r(t,n,f),y(x,t,f),r(t,re,f),r(t,I,f),r(t,ie,f),r(t,Z,f),r(t,le,f),r(t,g,f),r(t,G,f),r(t,q,f),r(t,be,f),r(t,J,f),r(t,me,f),r(t,D,f),r(t,Ie,f),r(t,z,f),r(t,U,f),r(t,te,f),r(t,E,f),r(t,W,f),r(t,O,f),y(pe,t,f),r(t,Ve,f),r(t,oe,f),r(t,ne,f),y(we,t,f),r(t,se,f),r(t,K,f),r(t,L,f),r(t,ce,f),r(t,he,f),y(Je,t,f),r(t,fe,f),r(t,P,f),r(t,ve,f),r(t,ae,f),r(t,j,f),r(t,R,f),r(t,X,f),y(Me,t,f),r(t,F,f),r(t,C,f),r(t,Y,f),r(t,h,f),r(t,Ze,f),y(ge,t,f),r(t,We,f),r(t,_e,f),r(t,De,f),r(t,Ge,f),r(t,yt,f),r(t,Oe,f),r(t,wt,f),r(t,Ke,f),r(t,Mt,f),r(t,et,f),r(t,$t,f),r(t,tt,f),r(t,xt,f),r(t,ot,f),r(t,Ft,f),y(nt,t,f),r(t,Vt,f),r(t,He,f),y(st,He,null),m(He,Pt),m(He,ht),m(He,Ht),m(He,ft),m(He,Lt),y(Xe,He,null),r(t,jt,f),y(at,t,f),r(t,Ct,f),r(t,Ee,f),y(rt,Ee,null),m(Ee,Rt),m(Ee,Se),y(it,Se,null),m(Se,Bt),m(Se,ut),r(t,It,f),y(lt,t,f),r(t,kt,f),r(t,Re,f),y(dt,Re,null),m(Re,Gt),m(Re,gt),m(Re,Et),m(Re,Ye),y(ct,Ye,null),m(Ye,qt),m(Ye,_t),r(t,Ut,f),y(Ae,t,f),r(t,Jt,f),y(mt,t,f),r(t,Zt,f),r(t,vt,f),Wt=!0},p(t,[f]){const Be={};f&2&&(Be.$$scope={dirty:f,ctx:t}),Xe.$set(Be);const pt={};f&2&&(pt.$$scope={dirty:f,ctx:t}),Ae.$set(pt)},i(t){Wt||(w(_.$$.fragment,t),w(x.$$.fragment,t),w(pe.$$.fragment,t),w(we.$$.fragment,t),w(Je.$$.fragment,t),w(Me.$$.fragment,t),w(ge.$$.fragment,t),w(nt.$$.fragment,t),w(st.$$.fragment,t),w(Xe.$$.fragment,t),w(at.$$.fragment,t),w(rt.$$.fragment,t),w(it.$$.fragment,t),w(lt.$$.fragment,t),w(dt.$$.fragment,t),w(ct.$$.fragment,t),w(Ae.$$.fragment,t),w(mt.$$.fragment,t),Wt=!0)},o(t){M(_.$$.fragment,t),M(x.$$.fragment,t),M(pe.$$.fragment,t),M(we.$$.fragment,t),M(Je.$$.fragment,t),M(Me.$$.fragment,t),M(ge.$$.fragment,t),M(nt.$$.fragment,t),M(st.$$.fragment,t),M(Xe.$$.fragment,t),M(at.$$.fragment,t),M(rt.$$.fragment,t),M(it.$$.fragment,t),M(lt.$$.fragment,t),M(dt.$$.fragment,t),M(ct.$$.fragment,t),M(Ae.$$.fragment,t),M(mt.$$.fragment,t),Wt=!1},d(t){t&&(s(p),s(o),s(a),s(n),s(re),s(I),s(ie),s(Z),s(le),s(g),s(G),s(q),s(be),s(J),s(me),s(D),s(Ie),s(z),s(U),s(te),s(E),s(W),s(O),s(Ve),s(oe),s(ne),s(se),s(K),s(L),s(ce),s(he),s(fe),s(P),s(ve),s(ae),s(j),s(R),s(X),s(F),s(C),s(Y),s(h),s(Ze),s(We),s(_e),s(De),s(Ge),s(yt),s(Oe),s(wt),s(Ke),s(Mt),s(et),s($t),s(tt),s(xt),s(ot),s(Ft),s(Vt),s(He),s(jt),s(Ct),s(Ee),s(It),s(kt),s(Re),s(Ut),s(Jt),s(Zt),s(vt)),s(e),$(_,t),$(x,t),$(pe,t),$(we,t),$(Je,t),$(Me,t),$(ge,t),$(nt,t),$(st),$(Xe),$(at,t),$(rt),$(it),$(lt,t),$(dt),$(ct),$(Ae,t),$(mt,t)}}}const Lo='{"title":"Vision Transformer (ViT)","local":"vision-transformer-vit","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[{"title":"Using Scaled Dot Product Attention (SDPA)","local":"using-scaled-dot-product-attention-sdpa","sections":[],"depth":3}],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"ViTConfig","local":"transformers.ViTConfig","sections":[],"depth":2},{"title":"ViTFeatureExtractor","local":"transformers.ViTFeatureExtractor","sections":[],"depth":2},{"title":"ViTImageProcessor","local":"transformers.ViTImageProcessor","sections":[],"depth":2},{"title":"ViTModel","local":"transformers.ViTModel","sections":[],"depth":2},{"title":"ViTForMaskedImageModeling","local":"transformers.ViTForMaskedImageModeling","sections":[],"depth":2},{"title":"ViTForImageClassification","local":"transformers.ViTForImageClassification","sections":[],"depth":2},{"title":"TFViTModel","local":"transformers.TFViTModel","sections":[],"depth":2},{"title":"TFViTForImageClassification","local":"transformers.TFViTForImageClassification","sections":[],"depth":2},{"title":"FlaxVitModel","local":"transformers.FlaxViTModel","sections":[],"depth":2},{"title":"FlaxViTForImageClassification","local":"transformers.FlaxViTForImageClassification","sections":[],"depth":2}],"depth":1}';function Ro(V){return ao(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Do extends ro{constructor(e){super(),io(this,e,Ro,Ho,no,{})}}export{Do as component};
