import{S as r_,i as n_,s as i_,e as a,k as p,w,t as n,M as l_,c as s,d as t,m as h,a as r,x as y,h as i,b as d,N as d_,G as e,g as f,y as $,q as k,o as E,B as I,v as c_,L as Qo}from"../../chunks/vendor-hf-doc-builder.js";import{T as He}from"../../chunks/Tip-hf-doc-builder.js";import{D as X}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Yo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ie}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as s_}from"../../chunks/PipelineTag-hf-doc-builder.js";function p_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import ViTConfig, ViTModel

# Initializing a ViT vit-base-patch16-224 style configuration
configuration = ViTConfig()

# Initializing a model (with random weights) from the vit-base-patch16-224 style configuration
model = ViTModel(configuration)

# Accessing the model configuration
configuration = model.config`,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`}}),{c(){c=a("p"),T=n("Example:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Example:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function h_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function m_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, ViTModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")
model = ViTModel.from_pretrained("google/vit-base-patch16-224-in21k")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,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>]`}}),{c(){c=a("p"),T=n("Example:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Example:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function f_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Note that we provide a script to pre-train this model on custom data in our "),g=a("a"),_=n(`examples
directory`),v=n("."),this.h()},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Note that we provide a script to pre-train this model on custom data in our "),g=s(u,"A",{href:!0,rel:!0});var x=r(g);_=i(x,`examples
directory`),x.forEach(t),v=i(u,"."),u.forEach(t),this.h()},h(){d(g,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),d(g,"rel","nofollow")},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function u_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function g_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, ViTForMaskedImageModeling
import torch
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")
model = ViTForMaskedImageModeling.from_pretrained("google/vit-base-patch16-224-in21k")

num_patches = (model.config.image_size // model.config.patch_size) ** 2
pixel_values = image_processor(images=image, return_tensors="pt").pixel_values
# create random boolean mask of shape (batch_size, num_patches)
bool_masked_pos = torch.randint(low=0, high=2, size=(1, num_patches)).bool()

outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
loss, reconstructed_pixel_values = outputs.loss, outputs.reconstruction
list(reconstructed_pixel_values.shape)`,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>]`}}),{c(){c=a("p"),T=n("Examples:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Examples:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function __(V){let c,T,g,_,v,l,u,x;return{c(){c=a("p"),T=n(`Note that it\u2019s possible to fine-tune ViT on higher resolution images than the ones it has been trained on, by
setting `),g=a("code"),_=n("interpolate_pos_encoding"),v=n(" to "),l=a("code"),u=n("True"),x=n(` in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`)},l(N){c=s(N,"P",{});var j=r(c);T=i(j,`Note that it\u2019s possible to fine-tune ViT on higher resolution images than the ones it has been trained on, by
setting `),g=s(j,"CODE",{});var z=r(g);_=i(z,"interpolate_pos_encoding"),z.forEach(t),v=i(j," to "),l=s(j,"CODE",{});var D=r(l);u=i(D,"True"),D.forEach(t),x=i(j,` in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`),j.forEach(t)},m(N,j){f(N,c,j),e(c,T),e(c,g),e(g,_),e(c,v),e(c,l),e(l,u),e(c,x)},d(N){N&&t(c)}}}function v_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function T_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, ViTForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224")
model = ViTForImageClassification.from_pretrained("google/vit-base-patch16-224")

inputs = image_processor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,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`}}),{c(){c=a("p"),T=n("Example:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Example:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function b_(V){let c,T,g,_,v,l,u,x,N,j,z,D,re,F,Ke,Z,Je,je,W,Ge,ne,ie,Xe,Ce,Q,Qe,Ae,Y,xe,Ye,ve,A,L,ze,C,le,Ze,H,et,tt,O,Ve,de,ot,ce,pe,Te,at,ee,st,S,rt,he,R,nt,q,it,lt;return{c(){c=a("p"),T=n("TensorFlow models and layers in "),g=a("code"),_=n("transformers"),v=n(" accept two formats as input:"),l=p(),u=a("ul"),x=a("li"),N=n("having all inputs as keyword arguments (like PyTorch models), or"),j=p(),z=a("li"),D=n("having all inputs as a list, tuple or dict in the first positional argument."),re=p(),F=a("p"),Ke=n(`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 `),Z=a("code"),Je=n("model.fit()"),je=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),W=a("code"),Ge=n("model.fit()"),ne=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=a("code"),Xe=n("fit()"),Ce=n(" and "),Q=a("code"),Qe=n("predict()"),Ae=n(`, such as when creating your own layers or models with
the Keras `),Y=a("code"),xe=n("Functional"),Ye=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ve=p(),A=a("ul"),L=a("li"),ze=n("a single Tensor with "),C=a("code"),le=n("pixel_values"),Ze=n(" only and nothing else: "),H=a("code"),et=n("model(pixel_values)"),tt=p(),O=a("li"),Ve=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),de=a("code"),ot=n("model([pixel_values, attention_mask])"),ce=n(" or "),pe=a("code"),Te=n("model([pixel_values, attention_mask, token_type_ids])"),at=p(),ee=a("li"),st=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),rt=n('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),he=p(),R=a("p"),nt=n(`Note that when creating models and layers with
`),q=a("a"),it=n("subclassing"),lt=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(b){c=s(b,"P",{});var P=r(c);T=i(P,"TensorFlow models and layers in "),g=s(P,"CODE",{});var Tt=r(g);_=i(Tt,"transformers"),Tt.forEach(t),v=i(P," accept two formats as input:"),P.forEach(t),l=h(b),u=s(b,"UL",{});var te=r(u);x=s(te,"LI",{});var bt=r(x);N=i(bt,"having all inputs as keyword arguments (like PyTorch models), or"),bt.forEach(t),j=h(te),z=s(te,"LI",{});var wt=r(z);D=i(wt,"having all inputs as a list, tuple or dict in the first positional argument."),wt.forEach(t),te.forEach(t),re=h(b),F=s(b,"P",{});var M=r(F);Ke=i(M,`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 `),Z=s(M,"CODE",{});var yt=r(Z);Je=i(yt,"model.fit()"),yt.forEach(t),je=i(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),W=s(M,"CODE",{});var $t=r(W);Ge=i($t,"model.fit()"),$t.forEach(t),ne=i(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=s(M,"CODE",{});var kt=r(ie);Xe=i(kt,"fit()"),kt.forEach(t),Ce=i(M," and "),Q=s(M,"CODE",{});var me=r(Q);Qe=i(me,"predict()"),me.forEach(t),Ae=i(M,`, such as when creating your own layers or models with
the Keras `),Y=s(M,"CODE",{});var Et=r(Y);xe=i(Et,"Functional"),Et.forEach(t),Ye=i(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),ve=h(b),A=s(b,"UL",{});var U=r(A);L=s(U,"LI",{});var fe=r(L);ze=i(fe,"a single Tensor with "),C=s(fe,"CODE",{});var It=r(C);le=i(It,"pixel_values"),It.forEach(t),Ze=i(fe," only and nothing else: "),H=s(fe,"CODE",{});var Fe=r(H);et=i(Fe,"model(pixel_values)"),Fe.forEach(t),fe.forEach(t),tt=h(U),O=s(U,"LI",{});var ue=r(O);Ve=i(ue,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),de=s(ue,"CODE",{});var xt=r(de);ot=i(xt,"model([pixel_values, attention_mask])"),xt.forEach(t),ce=i(ue," or "),pe=s(ue,"CODE",{});var Vt=r(pe);Te=i(Vt,"model([pixel_values, attention_mask, token_type_ids])"),Vt.forEach(t),ue.forEach(t),at=h(U),ee=s(U,"LI",{});var Pe=r(ee);st=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=s(Pe,"CODE",{});var Ft=r(S);rt=i(Ft,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),Ft.forEach(t),Pe.forEach(t),U.forEach(t),he=h(b),R=s(b,"P",{});var be=r(R);nt=i(be,`Note that when creating models and layers with
`),q=s(be,"A",{href:!0,rel:!0});var we=r(q);it=i(we,"subclassing"),we.forEach(t),lt=i(be,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),be.forEach(t),this.h()},h(){d(q,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(q,"rel","nofollow")},m(b,P){f(b,c,P),e(c,T),e(c,g),e(g,_),e(c,v),f(b,l,P),f(b,u,P),e(u,x),e(x,N),e(u,j),e(u,z),e(z,D),f(b,re,P),f(b,F,P),e(F,Ke),e(F,Z),e(Z,Je),e(F,je),e(F,W),e(W,Ge),e(F,ne),e(F,ie),e(ie,Xe),e(F,Ce),e(F,Q),e(Q,Qe),e(F,Ae),e(F,Y),e(Y,xe),e(F,Ye),f(b,ve,P),f(b,A,P),e(A,L),e(L,ze),e(L,C),e(C,le),e(L,Ze),e(L,H),e(H,et),e(A,tt),e(A,O),e(O,Ve),e(O,de),e(de,ot),e(O,ce),e(O,pe),e(pe,Te),e(A,at),e(A,ee),e(ee,st),e(ee,S),e(S,rt),f(b,he,P),f(b,R,P),e(R,nt),e(R,q),e(q,it),e(R,lt)},d(b){b&&t(c),b&&t(l),b&&t(u),b&&t(re),b&&t(F),b&&t(ve),b&&t(A),b&&t(he),b&&t(R)}}}function w_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function y_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, TFViTModel
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")
model = TFViTModel.from_pretrained("google/vit-base-patch16-224-in21k")

inputs = image_processor(image, return_tensors="tf")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,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>]`}}),{c(){c=a("p"),T=n("Example:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Example:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function $_(V){let c,T,g,_,v,l,u,x;return{c(){c=a("p"),T=n(`Note that it\u2019s possible to fine-tune ViT on higher resolution images than the ones it has been trained on, by
setting `),g=a("code"),_=n("interpolate_pos_encoding"),v=n(" to "),l=a("code"),u=n("True"),x=n(` in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`)},l(N){c=s(N,"P",{});var j=r(c);T=i(j,`Note that it\u2019s possible to fine-tune ViT on higher resolution images than the ones it has been trained on, by
setting `),g=s(j,"CODE",{});var z=r(g);_=i(z,"interpolate_pos_encoding"),z.forEach(t),v=i(j," to "),l=s(j,"CODE",{});var D=r(l);u=i(D,"True"),D.forEach(t),x=i(j,` in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`),j.forEach(t)},m(N,j){f(N,c,j),e(c,T),e(c,g),e(g,_),e(c,v),e(c,l),e(l,u),e(c,x)},d(N){N&&t(c)}}}function k_(V){let c,T,g,_,v,l,u,x,N,j,z,D,re,F,Ke,Z,Je,je,W,Ge,ne,ie,Xe,Ce,Q,Qe,Ae,Y,xe,Ye,ve,A,L,ze,C,le,Ze,H,et,tt,O,Ve,de,ot,ce,pe,Te,at,ee,st,S,rt,he,R,nt,q,it,lt;return{c(){c=a("p"),T=n("TensorFlow models and layers in "),g=a("code"),_=n("transformers"),v=n(" accept two formats as input:"),l=p(),u=a("ul"),x=a("li"),N=n("having all inputs as keyword arguments (like PyTorch models), or"),j=p(),z=a("li"),D=n("having all inputs as a list, tuple or dict in the first positional argument."),re=p(),F=a("p"),Ke=n(`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 `),Z=a("code"),Je=n("model.fit()"),je=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),W=a("code"),Ge=n("model.fit()"),ne=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=a("code"),Xe=n("fit()"),Ce=n(" and "),Q=a("code"),Qe=n("predict()"),Ae=n(`, such as when creating your own layers or models with
the Keras `),Y=a("code"),xe=n("Functional"),Ye=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ve=p(),A=a("ul"),L=a("li"),ze=n("a single Tensor with "),C=a("code"),le=n("pixel_values"),Ze=n(" only and nothing else: "),H=a("code"),et=n("model(pixel_values)"),tt=p(),O=a("li"),Ve=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),de=a("code"),ot=n("model([pixel_values, attention_mask])"),ce=n(" or "),pe=a("code"),Te=n("model([pixel_values, attention_mask, token_type_ids])"),at=p(),ee=a("li"),st=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),rt=n('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),he=p(),R=a("p"),nt=n(`Note that when creating models and layers with
`),q=a("a"),it=n("subclassing"),lt=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(b){c=s(b,"P",{});var P=r(c);T=i(P,"TensorFlow models and layers in "),g=s(P,"CODE",{});var Tt=r(g);_=i(Tt,"transformers"),Tt.forEach(t),v=i(P," accept two formats as input:"),P.forEach(t),l=h(b),u=s(b,"UL",{});var te=r(u);x=s(te,"LI",{});var bt=r(x);N=i(bt,"having all inputs as keyword arguments (like PyTorch models), or"),bt.forEach(t),j=h(te),z=s(te,"LI",{});var wt=r(z);D=i(wt,"having all inputs as a list, tuple or dict in the first positional argument."),wt.forEach(t),te.forEach(t),re=h(b),F=s(b,"P",{});var M=r(F);Ke=i(M,`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 `),Z=s(M,"CODE",{});var yt=r(Z);Je=i(yt,"model.fit()"),yt.forEach(t),je=i(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),W=s(M,"CODE",{});var $t=r(W);Ge=i($t,"model.fit()"),$t.forEach(t),ne=i(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=s(M,"CODE",{});var kt=r(ie);Xe=i(kt,"fit()"),kt.forEach(t),Ce=i(M," and "),Q=s(M,"CODE",{});var me=r(Q);Qe=i(me,"predict()"),me.forEach(t),Ae=i(M,`, such as when creating your own layers or models with
the Keras `),Y=s(M,"CODE",{});var Et=r(Y);xe=i(Et,"Functional"),Et.forEach(t),Ye=i(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),ve=h(b),A=s(b,"UL",{});var U=r(A);L=s(U,"LI",{});var fe=r(L);ze=i(fe,"a single Tensor with "),C=s(fe,"CODE",{});var It=r(C);le=i(It,"pixel_values"),It.forEach(t),Ze=i(fe," only and nothing else: "),H=s(fe,"CODE",{});var Fe=r(H);et=i(Fe,"model(pixel_values)"),Fe.forEach(t),fe.forEach(t),tt=h(U),O=s(U,"LI",{});var ue=r(O);Ve=i(ue,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),de=s(ue,"CODE",{});var xt=r(de);ot=i(xt,"model([pixel_values, attention_mask])"),xt.forEach(t),ce=i(ue," or "),pe=s(ue,"CODE",{});var Vt=r(pe);Te=i(Vt,"model([pixel_values, attention_mask, token_type_ids])"),Vt.forEach(t),ue.forEach(t),at=h(U),ee=s(U,"LI",{});var Pe=r(ee);st=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=s(Pe,"CODE",{});var Ft=r(S);rt=i(Ft,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),Ft.forEach(t),Pe.forEach(t),U.forEach(t),he=h(b),R=s(b,"P",{});var be=r(R);nt=i(be,`Note that when creating models and layers with
`),q=s(be,"A",{href:!0,rel:!0});var we=r(q);it=i(we,"subclassing"),we.forEach(t),lt=i(be,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),be.forEach(t),this.h()},h(){d(q,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(q,"rel","nofollow")},m(b,P){f(b,c,P),e(c,T),e(c,g),e(g,_),e(c,v),f(b,l,P),f(b,u,P),e(u,x),e(x,N),e(u,j),e(u,z),e(z,D),f(b,re,P),f(b,F,P),e(F,Ke),e(F,Z),e(Z,Je),e(F,je),e(F,W),e(W,Ge),e(F,ne),e(F,ie),e(ie,Xe),e(F,Ce),e(F,Q),e(Q,Qe),e(F,Ae),e(F,Y),e(Y,xe),e(F,Ye),f(b,ve,P),f(b,A,P),e(A,L),e(L,ze),e(L,C),e(C,le),e(L,Ze),e(L,H),e(H,et),e(A,tt),e(A,O),e(O,Ve),e(O,de),e(de,ot),e(O,ce),e(O,pe),e(pe,Te),e(A,at),e(A,ee),e(ee,st),e(ee,S),e(S,rt),f(b,he,P),f(b,R,P),e(R,nt),e(R,q),e(q,it),e(R,lt)},d(b){b&&t(c),b&&t(l),b&&t(u),b&&t(re),b&&t(F),b&&t(ve),b&&t(A),b&&t(he),b&&t(R)}}}function E_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function I_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, TFViTForImageClassification
import tensorflow as tf
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224")
model = TFViTForImageClassification.from_pretrained("google/vit-base-patch16-224")

inputs = image_processor(image, return_tensors="tf")
logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = int(tf.math.argmax(logits, axis=-1))
print(model.config.id2label[predicted_label])`,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`}}),{c(){c=a("p"),T=n("Example:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Example:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function x_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function V_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, FlaxViTModel
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")
model = FlaxViTModel.from_pretrained("google/vit-base-patch16-224-in21k")

inputs = image_processor(images=image, return_tensors="np")
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state`,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`}}),{c(){c=a("p"),T=n("Examples:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Examples:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function F_(V){let c,T,g,_,v;return{c(){c=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var x=r(g);_=i(x,"Module"),x.forEach(t),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,c,u),e(c,T),e(c,g),e(g,_),e(c,v)},d(l){l&&t(c)}}}function P_(V){let c,T,g,_,v;return _=new Yo({props:{code:`from transformers import AutoImageProcessor, FlaxViTForImageClassification
from PIL import Image
import jax
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224")
model = FlaxViTForImageClassification.from_pretrained("google/vit-base-patch16-224")

inputs = image_processor(images=image, return_tensors="np")
outputs = model(**inputs)
logits = outputs.logits

# model predicts one of the 1000 ImageNet classes
predicted_class_idx = jax.numpy.argmax(logits, axis=-1)
print("Predicted class:", model.config.id2label[predicted_class_idx.item()])`,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()])`}}),{c(){c=a("p"),T=n("Example:"),g=p(),w(_.$$.fragment)},l(l){c=s(l,"P",{});var u=r(c);T=i(u,"Example:"),u.forEach(t),g=h(l),y(_.$$.fragment,l)},m(l,u){f(l,c,u),e(c,T),f(l,g,u),$(_,l,u),v=!0},p:Qo,i(l){v||(k(_.$$.fragment,l),v=!0)},o(l){E(_.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(g),I(_,l)}}}function M_(V){let c,T,g,_,v,l,u,x,N,j,z,D,re,F,Ke,Z,Je,je,W,Ge,ne,ie,Xe,Ce,Q,Qe,Ae,Y,xe,Ye,ve,A,L,ze,C,le,Ze,H,et,tt,O,Ve,de,ot,ce,pe,Te,at,ee,st,S,rt,he,R,nt,q,it,lt,b,P,Tt,te,bt,wt,M,yt,$t,kt,me,Et,U,fe,It,Fe,ue,xt,Vt,Pe,Ft,be,we,ff,ui,Zo,Al,As,zl,gi,zs,Nl,_i,Ne,Br,B,Ns,ql,Dl,qs,Ll,Ol,Ds,Sl,Rl,Hr,Ul,Wl,Kr,Bl,Hl,Jr,Kl,Jl,Gr,Gl,Xl,Ls,Ql,Yl,Zl,Xr,Os,Ss,ed,td,od,Qr,ea,ad,ta,sd,rd,nd,Yr,Rs,Us,id,ld,vi,mt,dd,oa,cd,pd,aa,hd,md,Ti,eo,fd,sa,ud,gd,bi,Pt,to,Zr,ra,_d,en,vd,wi,Ws,Td,yi,na,$i,qe,ft,Bs,bd,wd,ia,yd,$d,la,kd,Ed,Id,Mt,xd,Hs,Vd,Fd,da,Pd,Md,jd,jt,Cd,Ks,Ad,zd,ca,Nd,qd,Dd,tn,Js,Ld,ki,Gs,Od,Ei,Xs,oo,Qs,Sd,Rd,pa,Ud,Wd,Ii,Ys,Bd,xi,Ct,ao,on,ha,Hd,an,Kd,Vi,Zs,Jd,Fi,ma,sn,Gd,Xd,Pi,fa,Mi,ye,er,Qd,ua,Yd,Zd,tr,ec,so,tc,rn,oc,ac,or,sc,ga,rc,nc,ar,ic,_a,lc,dc,sr,cc,va,pc,ji,rr,hc,Ci,nr,ir,mc,Ta,fc,Ai,lr,uc,zi,dr,cr,gc,ba,_c,Ni,pr,vc,qi,ut,hr,Tc,wa,bc,wc,mr,yc,ya,$c,kc,fr,Ec,$a,Ic,Di,At,ro,nn,ka,xc,ln,Vc,Li,Me,Ea,Fc,zt,Pc,ur,Mc,jc,Ia,Cc,Ac,zc,Nt,Nc,gr,qc,Dc,_r,Lc,Oc,Sc,no,Oi,qt,io,dn,xa,Rc,cn,Uc,Si,Dt,Va,Wc,lo,Fa,Bc,pn,Hc,Ri,Lt,co,hn,Pa,Kc,mn,Jc,Ui,dt,Ma,Gc,fn,Xc,Qc,po,ja,Yc,un,Zc,Wi,Ot,ho,gn,Ca,ep,_n,tp,Bi,ct,Aa,op,za,ap,Na,sp,rp,np,De,qa,ip,St,lp,vr,dp,cp,vn,pp,hp,mp,mo,fp,fo,Hi,Rt,uo,Tn,Da,up,bn,gp,Ki,ge,La,_p,Oa,vp,Sa,Tp,bp,wp,go,yp,Ra,$p,Ua,kp,Ep,Ip,Le,Wa,xp,Ut,Vp,Tr,Fp,Pp,wn,Mp,jp,Cp,_o,Ap,vo,Ji,Wt,To,yn,Ba,zp,$n,Np,Gi,_e,Ha,qp,kn,Dp,Lp,bo,Op,Ka,Sp,Ja,Rp,Up,Wp,Oe,Ga,Bp,Bt,Hp,br,Kp,Jp,En,Gp,Xp,Qp,wo,Yp,yo,Xi,Ht,$o,In,Xa,Zp,xn,eh,Qi,oe,Qa,th,Vn,oh,ah,Ya,sh,wr,rh,nh,ih,Za,lh,es,dh,ch,ph,ko,hh,Se,ts,mh,Kt,fh,yr,uh,gh,Fn,_h,vh,Th,Eo,bh,Io,Yi,Jt,xo,Pn,os,wh,Mn,yh,Zi,K,as,$h,jn,kh,Eh,Vo,Ih,ss,xh,$r,Vh,Fh,Ph,rs,Mh,ns,jh,Ch,Ah,Fo,zh,Re,is,Nh,Gt,qh,kr,Dh,Lh,Cn,Oh,Sh,Rh,Po,Uh,Mo,el,Xt,jo,An,ls,Wh,zn,Bh,tl,J,ds,Hh,Nn,Kh,Jh,cs,Gh,Er,Xh,Qh,Yh,ps,Zh,hs,em,tm,om,qn,am,sm,pt,Dn,ms,rm,nm,Ln,fs,im,lm,On,us,dm,cm,Sn,gs,pm,hm,Ue,_s,mm,Qt,fm,Rn,um,gm,Un,_m,vm,Tm,Co,bm,Ao,ol,Yt,zo,Wn,vs,wm,Bn,ym,al,G,Ts,$m,Hn,km,Em,bs,Im,Ir,xm,Vm,Fm,ws,Pm,ys,Mm,jm,Cm,Kn,Am,zm,ht,Jn,$s,Nm,qm,Gn,ks,Dm,Lm,Xn,Es,Om,Sm,Qn,Is,Rm,Um,We,xs,Wm,Zt,Bm,Yn,Hm,Km,Zn,Jm,Gm,Xm,No,Qm,qo,sl;return l=new Ie({}),F=new Ie({}),ra=new Ie({}),na=new s_({props:{pipeline:"image-classification"}}),ha=new Ie({}),fa=new s_({props:{pipeline:"image-classification"}}),ka=new Ie({}),Ea=new X({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.1) &#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.1) &#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 <code>224</code>) &#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 <code>16</code>) &#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 <code>3</code>) &#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>, <code>optional</code>, 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/v4.29.0/src/transformers/models/vit/configuration_vit.py#L35"}}),no=new Xo({props:{anchor:"transformers.ViTConfig.example",$$slots:{default:[p_]},$$scope:{ctx:V}}}),xa=new Ie({}),Va=new X({props:{name:"class transformers.ViTFeatureExtractor",anchor:"transformers.ViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/vit/feature_extraction_vit.py#L26"}}),Fa=new X({props:{name:"__call__",anchor:"transformers.ViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/image_processing_utils.py#L462"}}),Pa=new Ie({}),Ma=new X({props:{name:"class transformers.ViTImageProcessor",anchor:"transformers.ViTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**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>PILImageResampling.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.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"rescale_factor"},{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/v4.29.0/src/transformers/models/vit/image_processing_vit.py#L39"}}),ja=new X({props:{name:"preprocess",anchor:"transformers.ViTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/vit/image_processing_vit.py#L181"}}),Ca=new Ie({}),Aa=new X({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/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_vit.py#L515"}}),qa=new X({props:{name:"forward",anchor:"transformers.ViTModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_vit.py#L540",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mo=new He({props:{$$slots:{default:[h_]},$$scope:{ctx:V}}}),fo=new Xo({props:{anchor:"transformers.ViTModel.forward.example",$$slots:{default:[m_]},$$scope:{ctx:V}}}),Da=new Ie({}),La=new X({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/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_vit.py#L637"}}),go=new He({props:{$$slots:{default:[f_]},$$scope:{ctx:V}}}),Wa=new X({props:{name:"forward",anchor:"transformers.ViTForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTForMaskedImageModeling.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_vit.py#L655",returnDescription:`
<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/v4.29.0/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) \u2014 Reconstruction loss.</li>
<li><strong>reconstruction</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 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>) \u2014 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:`
<p><code>transformers.modeling_outputs.MaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_o=new He({props:{$$slots:{default:[u_]},$$scope:{ctx:V}}}),vo=new Xo({props:{anchor:"transformers.ViTForMaskedImageModeling.forward.example",$$slots:{default:[g_]},$$scope:{ctx:V}}}),Ba=new Ie({}),Ha=new X({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/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_vit.py#L759"}}),bo=new He({props:{$$slots:{default:[__]},$$scope:{ctx:V}}}),Ga=new X({props:{name:"forward",anchor:"transformers.ViTForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_vit.py#L772",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wo=new He({props:{$$slots:{default:[v_]},$$scope:{ctx:V}}}),yo=new Xo({props:{anchor:"transformers.ViTForImageClassification.forward.example",$$slots:{default:[T_]},$$scope:{ctx:V}}}),Xa=new Ie({}),Qa=new X({props:{name:"class transformers.TFViTModel",anchor:"transformers.TFViTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_tf_vit.py#L661"}}),ko=new He({props:{$$slots:{default:[b_]},$$scope:{ctx:V}}}),ts=new X({props:{name:"call",anchor:"transformers.TFViTModel.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_tf_vit.py#L667",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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>) \u2014 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>) \u2014 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\u2019re 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Eo=new He({props:{$$slots:{default:[w_]},$$scope:{ctx:V}}}),Io=new Xo({props:{anchor:"transformers.TFViTModel.call.example",$$slots:{default:[y_]},$$scope:{ctx:V}}}),os=new Ie({}),as=new X({props:{name:"class transformers.TFViTForImageClassification",anchor:"transformers.TFViTForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_tf_vit.py#L745"}}),Vo=new He({props:{$$slots:{default:[$_]},$$scope:{ctx:V}}}),Fo=new He({props:{$$slots:{default:[k_]},$$scope:{ctx:V}}}),is=new X({props:{name:"call",anchor:"transformers.TFViTForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.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/v4.29.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.29.0/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/v4.29.0/src/transformers/models/vit/modeling_tf_vit.py#L759",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Po=new He({props:{$$slots:{default:[E_]},$$scope:{ctx:V}}}),Mo=new Xo({props:{anchor:"transformers.TFViTForImageClassification.call.example",$$slots:{default:[I_]},$$scope:{ctx:V}}}),ls=new Ie({}),ds=new X({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/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/vit/modeling_flax_vit.py#L555"}}),_s=new X({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:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/vit/modeling_flax_vit.py#L471",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Co=new He({props:{$$slots:{default:[x_]},$$scope:{ctx:V}}}),Ao=new Xo({props:{anchor:"transformers.FlaxViTModel.__call__.example",$$slots:{default:[V_]},$$scope:{ctx:V}}}),vs=new Ie({}),Ts=new X({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/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/vit/modeling_flax_vit.py#L638"}}),xs=new X({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:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/vit/modeling_flax_vit.py#L471",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),No=new He({props:{$$slots:{default:[F_]},$$scope:{ctx:V}}}),qo=new Xo({props:{anchor:"transformers.FlaxViTForImageClassification.__call__.example",$$slots:{default:[P_]},$$scope:{ctx:V}}}),{c(){c=a("meta"),T=p(),g=a("h1"),_=a("a"),v=a("span"),w(l.$$.fragment),u=p(),x=a("span"),N=n("Vision Transformer (ViT)"),j=p(),z=a("h2"),D=a("a"),re=a("span"),w(F.$$.fragment),Ke=p(),Z=a("span"),Je=n("Overview"),je=p(),W=a("p"),Ge=n("The Vision Transformer (ViT) model was proposed in "),ne=a("a"),ie=n(`An Image is Worth 16x16 Words: Transformers for Image Recognition
at Scale`),Xe=n(` 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\u2019s the first paper that successfully trains a Transformer encoder on ImageNet, attaining
very good results compared to familiar convolutional architectures.`),Ce=p(),Q=a("p"),Qe=n("The abstract from the paper is the following:"),Ae=p(),Y=a("p"),xe=a("em"),Ye=n(`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.`),ve=p(),A=a("p"),L=n("Tips:"),ze=p(),C=a("ul"),le=a("li"),Ze=n("Demo notebooks regarding inference as well as fine-tuning ViT on custom data can be found "),H=a("a"),et=n("here"),tt=n("."),O=p(),Ve=a("li"),de=n(`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.`),ot=p(),ce=a("li"),pe=n(`As the Vision Transformer expects each image to be of the same size (resolution), one can use
`),Te=a("a"),at=n("ViTImageProcessor"),ee=n(" to resize (or rescale) and normalize images for the model."),st=p(),S=a("li"),rt=n(`Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, `),he=a("code"),R=n("google/vit-base-patch16-224"),nt=n(` refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the `),q=a("a"),it=n("hub"),lt=n("."),b=p(),P=a("li"),Tt=n("The available checkpoints are either (1) pre-trained on "),te=a("a"),bt=n("ImageNet-21k"),wt=n(` (a collection of
14 million images and 21k classes) only, or (2) also fine-tuned on `),M=a("a"),yt=n("ImageNet"),$t=n(` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),kt=p(),me=a("li"),Et=n(`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 `),U=a("a"),fe=n("(Touvron et al., 2019)"),It=n(", "),Fe=a("a"),ue=n(`(Kolesnikov
et al., 2020)`),xt=n(`. 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.`),Vt=p(),Pe=a("li"),Ft=n(`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.`),be=p(),we=a("img"),ui=p(),Zo=a("small"),Al=n("ViT architecture. Taken from the "),As=a("a"),zl=n("original paper."),gi=p(),zs=a("p"),Nl=n("Following the original Vision Transformer, some follow-up works have been made:"),_i=p(),Ne=a("ul"),Br=a("li"),B=a("p"),Ns=a("a"),ql=n("DeiT"),Dl=n(` (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 `),qs=a("a"),Ll=n("ViTModel"),Ol=n(` or
`),Ds=a("a"),Sl=n("ViTForImageClassification"),Rl=n(". There are 4 variants available (in 3 different sizes): "),Hr=a("em"),Ul=n("facebook/deit-tiny-patch16-224"),Wl=n(`,
`),Kr=a("em"),Bl=n("facebook/deit-small-patch16-224"),Hl=n(", "),Jr=a("em"),Kl=n("facebook/deit-base-patch16-224"),Jl=n(" and "),Gr=a("em"),Gl=n("facebook/deit-base-patch16-384"),Xl=n(`. Note that one should
use `),Ls=a("a"),Ql=n("DeiTImageProcessor"),Yl=n(" in order to prepare images for the model."),Zl=p(),Xr=a("li"),Os=a("p"),Ss=a("a"),ed=n("BEiT"),td=n(` (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.`),od=p(),Qr=a("li"),ea=a("p"),ad=n(`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 `),ta=a("a"),sd=n("hub"),rd=n("."),nd=p(),Yr=a("li"),Rs=a("p"),Us=a("a"),id=n("MAE"),ld=n(` (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.`),vi=p(),mt=a("p"),dd=n("This model was contributed by "),oa=a("a"),cd=n("nielsr"),pd=n(`. The original code (written in JAX) can be
found `),aa=a("a"),hd=n("here"),md=n("."),Ti=p(),eo=a("p"),fd=n("Note that we converted the weights from Ross Wightman\u2019s "),sa=a("a"),ud=n("timm library"),gd=n(`, who already converted the weights from JAX to PyTorch. Credits
go to him!`),bi=p(),Pt=a("h2"),to=a("a"),Zr=a("span"),w(ra.$$.fragment),_d=p(),en=a("span"),vd=n("Resources"),wi=p(),Ws=a("p"),Td=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT."),yi=p(),w(na.$$.fragment),$i=p(),qe=a("ul"),ft=a("li"),Bs=a("a"),bd=n("ViTForImageClassification"),wd=n(" is supported by this "),ia=a("a"),yd=n("example script"),$d=n(" and "),la=a("a"),kd=n("notebook"),Ed=n("."),Id=p(),Mt=a("li"),xd=n("A blog on fine-tuning "),Hs=a("a"),Vd=n("ViTForImageClassification"),Fd=n(" on a custom dataset can be found "),da=a("a"),Pd=n("here"),Md=n("."),jd=p(),jt=a("li"),Cd=n("More demo notebooks to fine-tune "),Ks=a("a"),Ad=n("ViTForImageClassification"),zd=n(" can be found "),ca=a("a"),Nd=n("here"),qd=n("."),Dd=p(),tn=a("li"),Js=a("a"),Ld=n("Image classification task guide"),ki=p(),Gs=a("p"),Od=n("Besides that:"),Ei=p(),Xs=a("ul"),oo=a("li"),Qs=a("a"),Sd=n("ViTForMaskedImageModeling"),Rd=n(" is supported by this "),pa=a("a"),Ud=n("example script"),Wd=n("."),Ii=p(),Ys=a("p"),Bd=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),xi=p(),Ct=a("h2"),ao=a("a"),on=a("span"),w(ha.$$.fragment),Hd=p(),an=a("span"),Kd=n("Resources"),Vi=p(),Zs=a("p"),Jd=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Fi=p(),ma=a("p"),sn=a("code"),Gd=n("ViTForImageClassification"),Xd=n(" is supported by:"),Pi=p(),w(fa.$$.fragment),Mi=p(),ye=a("ul"),er=a("li"),Qd=n("A blog post on how to "),ua=a("a"),Yd=n("Fine-Tune ViT for Image Classification with Hugging Face Transformers"),Zd=p(),tr=a("li"),ec=n("A blog post on "),so=a("a"),tc=n("Image Classification with Hugging Face Transformers and "),rn=a("code"),oc=n("Keras"),ac=p(),or=a("li"),sc=n("A notebook on "),ga=a("a"),rc=n("Fine-tuning for Image Classification with Hugging Face Transformers"),nc=p(),ar=a("li"),ic=n("A notebook on how to "),_a=a("a"),lc=n("Fine-tune the Vision Transformer on CIFAR-10 with the Hugging Face Trainer"),dc=p(),sr=a("li"),cc=n("A notebook on how to "),va=a("a"),pc=n("Fine-tune the Vision Transformer on CIFAR-10 with PyTorch Lightning"),ji=p(),rr=a("p"),hc=n("\u2697\uFE0F Optimization"),Ci=p(),nr=a("ul"),ir=a("li"),mc=n("A blog post on how to "),Ta=a("a"),fc=n("Accelerate Vision Transformer (ViT) with Quantization using Optimum"),Ai=p(),lr=a("p"),uc=n("\u26A1\uFE0F Inference"),zi=p(),dr=a("ul"),cr=a("li"),gc=n("A notebook on "),ba=a("a"),_c=n("Quick demo: Vision Transformer (ViT) by Google Brain"),Ni=p(),pr=a("p"),vc=n("\u{1F680} Deploy"),qi=p(),ut=a("ul"),hr=a("li"),Tc=n("A blog post on "),wa=a("a"),bc=n("Deploying Tensorflow Vision Models in Hugging Face with TF Serving"),wc=p(),mr=a("li"),yc=n("A blog post on "),ya=a("a"),$c=n("Deploying Hugging Face ViT on Vertex AI"),kc=p(),fr=a("li"),Ec=n("A blog post on "),$a=a("a"),Ic=n("Deploying Hugging Face ViT on Kubernetes with TF Serving"),Di=p(),At=a("h2"),ro=a("a"),nn=a("span"),w(ka.$$.fragment),xc=p(),ln=a("span"),Vc=n("ViTConfig"),Li=p(),Me=a("div"),w(Ea.$$.fragment),Fc=p(),zt=a("p"),Pc=n("This is the configuration class to store the configuration of a "),ur=a("a"),Mc=n("ViTModel"),jc=n(`. 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
`),Ia=a("a"),Cc=n("google/vit-base-patch16-224"),Ac=n(" architecture."),zc=p(),Nt=a("p"),Nc=n("Configuration objects inherit from "),gr=a("a"),qc=n("PretrainedConfig"),Dc=n(` and can be used to control the model outputs. Read the
documentation from `),_r=a("a"),Lc=n("PretrainedConfig"),Oc=n(" for more information."),Sc=p(),w(no.$$.fragment),Oi=p(),qt=a("h2"),io=a("a"),dn=a("span"),w(xa.$$.fragment),Rc=p(),cn=a("span"),Uc=n("ViTFeatureExtractor"),Si=p(),Dt=a("div"),w(Va.$$.fragment),Wc=p(),lo=a("div"),w(Fa.$$.fragment),Bc=p(),pn=a("p"),Hc=n("Preprocess an image or a batch of images."),Ri=p(),Lt=a("h2"),co=a("a"),hn=a("span"),w(Pa.$$.fragment),Kc=p(),mn=a("span"),Jc=n("ViTImageProcessor"),Ui=p(),dt=a("div"),w(Ma.$$.fragment),Gc=p(),fn=a("p"),Xc=n("Constructs a ViT image processor."),Qc=p(),po=a("div"),w(ja.$$.fragment),Yc=p(),un=a("p"),Zc=n("Preprocess an image or batch of images."),Wi=p(),Ot=a("h2"),ho=a("a"),gn=a("span"),w(Ca.$$.fragment),ep=p(),_n=a("span"),tp=n("ViTModel"),Bi=p(),ct=a("div"),w(Aa.$$.fragment),op=p(),za=a("p"),ap=n(`The bare ViT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Na=a("a"),sp=n("torch.nn.Module"),rp=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),np=p(),De=a("div"),w(qa.$$.fragment),ip=p(),St=a("p"),lp=n("The "),vr=a("a"),dp=n("ViTModel"),cp=n(" forward method, overrides the "),vn=a("code"),pp=n("__call__"),hp=n(" special method."),mp=p(),w(mo.$$.fragment),fp=p(),w(fo.$$.fragment),Hi=p(),Rt=a("h2"),uo=a("a"),Tn=a("span"),w(Da.$$.fragment),up=p(),bn=a("span"),gp=n("ViTForMaskedImageModeling"),Ki=p(),ge=a("div"),w(La.$$.fragment),_p=p(),Oa=a("p"),vp=n("ViT Model with a decoder on top for masked image modeling, as proposed in "),Sa=a("a"),Tp=n("SimMIM"),bp=n("."),wp=p(),w(go.$$.fragment),yp=p(),Ra=a("p"),$p=n("This model is a PyTorch "),Ua=a("a"),kp=n("torch.nn.Module"),Ep=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ip=p(),Le=a("div"),w(Wa.$$.fragment),xp=p(),Ut=a("p"),Vp=n("The "),Tr=a("a"),Fp=n("ViTForMaskedImageModeling"),Pp=n(" forward method, overrides the "),wn=a("code"),Mp=n("__call__"),jp=n(" special method."),Cp=p(),w(_o.$$.fragment),Ap=p(),w(vo.$$.fragment),Ji=p(),Wt=a("h2"),To=a("a"),yn=a("span"),w(Ba.$$.fragment),zp=p(),$n=a("span"),Np=n("ViTForImageClassification"),Gi=p(),_e=a("div"),w(Ha.$$.fragment),qp=p(),kn=a("p"),Dp=n(`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.`),Lp=p(),w(bo.$$.fragment),Op=p(),Ka=a("p"),Sp=n("This model is a PyTorch "),Ja=a("a"),Rp=n("torch.nn.Module"),Up=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wp=p(),Oe=a("div"),w(Ga.$$.fragment),Bp=p(),Bt=a("p"),Hp=n("The "),br=a("a"),Kp=n("ViTForImageClassification"),Jp=n(" forward method, overrides the "),En=a("code"),Gp=n("__call__"),Xp=n(" special method."),Qp=p(),w(wo.$$.fragment),Yp=p(),w(yo.$$.fragment),Xi=p(),Ht=a("h2"),$o=a("a"),In=a("span"),w(Xa.$$.fragment),Zp=p(),xn=a("span"),eh=n("TFViTModel"),Qi=p(),oe=a("div"),w(Qa.$$.fragment),th=p(),Vn=a("p"),oh=n("The bare ViT Model transformer outputting raw hidden-states without any specific head on top."),ah=p(),Ya=a("p"),sh=n("This model inherits from "),wr=a("a"),rh=n("TFPreTrainedModel"),nh=n(`. 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.)`),ih=p(),Za=a("p"),lh=n("This model is also a "),es=a("a"),dh=n("tf.keras.Model"),ch=n(` 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.`),ph=p(),w(ko.$$.fragment),hh=p(),Se=a("div"),w(ts.$$.fragment),mh=p(),Kt=a("p"),fh=n("The "),yr=a("a"),uh=n("TFViTModel"),gh=n(" forward method, overrides the "),Fn=a("code"),_h=n("__call__"),vh=n(" special method."),Th=p(),w(Eo.$$.fragment),bh=p(),w(Io.$$.fragment),Yi=p(),Jt=a("h2"),xo=a("a"),Pn=a("span"),w(os.$$.fragment),wh=p(),Mn=a("span"),yh=n("TFViTForImageClassification"),Zi=p(),K=a("div"),w(as.$$.fragment),$h=p(),jn=a("p"),kh=n(`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.`),Eh=p(),w(Vo.$$.fragment),Ih=p(),ss=a("p"),xh=n("This model inherits from "),$r=a("a"),Vh=n("TFPreTrainedModel"),Fh=n(`. 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.)`),Ph=p(),rs=a("p"),Mh=n("This model is also a "),ns=a("a"),jh=n("tf.keras.Model"),Ch=n(` 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.`),Ah=p(),w(Fo.$$.fragment),zh=p(),Re=a("div"),w(is.$$.fragment),Nh=p(),Gt=a("p"),qh=n("The "),kr=a("a"),Dh=n("TFViTForImageClassification"),Lh=n(" forward method, overrides the "),Cn=a("code"),Oh=n("__call__"),Sh=n(" special method."),Rh=p(),w(Po.$$.fragment),Uh=p(),w(Mo.$$.fragment),el=p(),Xt=a("h2"),jo=a("a"),An=a("span"),w(ls.$$.fragment),Wh=p(),zn=a("span"),Bh=n("FlaxVitModel"),tl=p(),J=a("div"),w(ds.$$.fragment),Hh=p(),Nn=a("p"),Kh=n("The bare ViT Model transformer outputting raw hidden-states without any specific head on top."),Jh=p(),cs=a("p"),Gh=n("This model inherits from "),Er=a("a"),Xh=n("FlaxPreTrainedModel"),Qh=n(`. 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)`),Yh=p(),ps=a("p"),Zh=n("This model is also a Flax Linen "),hs=a("a"),em=n("flax.linen.Module"),tm=n(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),om=p(),qn=a("p"),am=n("Finally, this model supports inherent JAX features such as:"),sm=p(),pt=a("ul"),Dn=a("li"),ms=a("a"),rm=n("Just-In-Time (JIT) compilation"),nm=p(),Ln=a("li"),fs=a("a"),im=n("Automatic Differentiation"),lm=p(),On=a("li"),us=a("a"),dm=n("Vectorization"),cm=p(),Sn=a("li"),gs=a("a"),pm=n("Parallelization"),hm=p(),Ue=a("div"),w(_s.$$.fragment),mm=p(),Qt=a("p"),fm=n("The "),Rn=a("code"),um=n("FlaxViTPreTrainedModel"),gm=n(" forward method, overrides the "),Un=a("code"),_m=n("__call__"),vm=n(" special method."),Tm=p(),w(Co.$$.fragment),bm=p(),w(Ao.$$.fragment),ol=p(),Yt=a("h2"),zo=a("a"),Wn=a("span"),w(vs.$$.fragment),wm=p(),Bn=a("span"),ym=n("FlaxViTForImageClassification"),al=p(),G=a("div"),w(Ts.$$.fragment),$m=p(),Hn=a("p"),km=n(`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.`),Em=p(),bs=a("p"),Im=n("This model inherits from "),Ir=a("a"),xm=n("FlaxPreTrainedModel"),Vm=n(`. 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)`),Fm=p(),ws=a("p"),Pm=n("This model is also a Flax Linen "),ys=a("a"),Mm=n("flax.linen.Module"),jm=n(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Cm=p(),Kn=a("p"),Am=n("Finally, this model supports inherent JAX features such as:"),zm=p(),ht=a("ul"),Jn=a("li"),$s=a("a"),Nm=n("Just-In-Time (JIT) compilation"),qm=p(),Gn=a("li"),ks=a("a"),Dm=n("Automatic Differentiation"),Lm=p(),Xn=a("li"),Es=a("a"),Om=n("Vectorization"),Sm=p(),Qn=a("li"),Is=a("a"),Rm=n("Parallelization"),Um=p(),We=a("div"),w(xs.$$.fragment),Wm=p(),Zt=a("p"),Bm=n("The "),Yn=a("code"),Hm=n("FlaxViTPreTrainedModel"),Km=n(" forward method, overrides the "),Zn=a("code"),Jm=n("__call__"),Gm=n(" special method."),Xm=p(),w(No.$$.fragment),Qm=p(),w(qo.$$.fragment),this.h()},l(o){const m=l_('[data-svelte="svelte-1phssyn"]',document.head);c=s(m,"META",{name:!0,content:!0}),m.forEach(t),T=h(o),g=s(o,"H1",{class:!0});var Vs=r(g);_=s(Vs,"A",{id:!0,class:!0,href:!0});var ei=r(_);v=s(ei,"SPAN",{});var ti=r(v);y(l.$$.fragment,ti),ti.forEach(t),ei.forEach(t),u=h(Vs),x=s(Vs,"SPAN",{});var oi=r(x);N=i(oi,"Vision Transformer (ViT)"),oi.forEach(t),Vs.forEach(t),j=h(o),z=s(o,"H2",{class:!0});var Fs=r(z);D=s(Fs,"A",{id:!0,class:!0,href:!0});var ai=r(D);re=s(ai,"SPAN",{});var si=r(re);y(F.$$.fragment,si),si.forEach(t),ai.forEach(t),Ke=h(Fs),Z=s(Fs,"SPAN",{});var ri=r(Z);Je=i(ri,"Overview"),ri.forEach(t),Fs.forEach(t),je=h(o),W=s(o,"P",{});var Ps=r(W);Ge=i(Ps,"The Vision Transformer (ViT) model was proposed in "),ne=s(Ps,"A",{href:!0,rel:!0});var ni=r(ne);ie=i(ni,`An Image is Worth 16x16 Words: Transformers for Image Recognition
at Scale`),ni.forEach(t),Xe=i(Ps,` 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\u2019s the first paper that successfully trains a Transformer encoder on ImageNet, attaining
very good results compared to familiar convolutional architectures.`),Ps.forEach(t),Ce=h(o),Q=s(o,"P",{});var ii=r(Q);Qe=i(ii,"The abstract from the paper is the following:"),ii.forEach(t),Ae=h(o),Y=s(o,"P",{});var li=r(Y);xe=s(li,"EM",{});var di=r(xe);Ye=i(di,`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.`),di.forEach(t),li.forEach(t),ve=h(o),A=s(o,"P",{});var ci=r(A);L=i(ci,"Tips:"),ci.forEach(t),ze=h(o),C=s(o,"UL",{});var ae=r(C);le=s(ae,"LI",{});var Ms=r(le);Ze=i(Ms,"Demo notebooks regarding inference as well as fine-tuning ViT on custom data can be found "),H=s(Ms,"A",{href:!0,rel:!0});var pi=r(H);et=i(pi,"here"),pi.forEach(t),tt=i(Ms,"."),Ms.forEach(t),O=h(ae),Ve=s(ae,"LI",{});var hi=r(Ve);de=i(hi,`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.`),hi.forEach(t),ot=h(ae),ce=s(ae,"LI",{});var js=r(ce);pe=i(js,`As the Vision Transformer expects each image to be of the same size (resolution), one can use
`),Te=s(js,"A",{href:!0});var mi=r(Te);at=i(mi,"ViTImageProcessor"),mi.forEach(t),ee=i(js," to resize (or rescale) and normalize images for the model."),js.forEach(t),st=h(ae),S=s(ae,"LI",{});var xr=r(S);rt=i(xr,`Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, `),he=s(xr,"CODE",{});var uf=r(he);R=i(uf,"google/vit-base-patch16-224"),uf.forEach(t),nt=i(xr,` refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the `),q=s(xr,"A",{href:!0,rel:!0});var gf=r(q);it=i(gf,"hub"),gf.forEach(t),lt=i(xr,"."),xr.forEach(t),b=h(ae),P=s(ae,"LI",{});var Vr=r(P);Tt=i(Vr,"The available checkpoints are either (1) pre-trained on "),te=s(Vr,"A",{href:!0,rel:!0});var _f=r(te);bt=i(_f,"ImageNet-21k"),_f.forEach(t),wt=i(Vr,` (a collection of
14 million images and 21k classes) only, or (2) also fine-tuned on `),M=s(Vr,"A",{href:!0,rel:!0});var vf=r(M);yt=i(vf,"ImageNet"),vf.forEach(t),$t=i(Vr,` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Vr.forEach(t),kt=h(ae),me=s(ae,"LI",{});var Fr=r(me);Et=i(Fr,`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 `),U=s(Fr,"A",{href:!0,rel:!0});var Tf=r(U);fe=i(Tf,"(Touvron et al., 2019)"),Tf.forEach(t),It=i(Fr,", "),Fe=s(Fr,"A",{href:!0,rel:!0});var bf=r(Fe);ue=i(bf,`(Kolesnikov
et al., 2020)`),bf.forEach(t),xt=i(Fr,`. 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.`),Fr.forEach(t),Vt=h(ae),Pe=s(ae,"LI",{});var wf=r(Pe);Ft=i(wf,`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.`),wf.forEach(t),ae.forEach(t),be=h(o),we=s(o,"IMG",{src:!0,alt:!0,width:!0}),ui=h(o),Zo=s(o,"SMALL",{});var Ym=r(Zo);Al=i(Ym,"ViT architecture. Taken from the "),As=s(Ym,"A",{href:!0});var yf=r(As);zl=i(yf,"original paper."),yf.forEach(t),Ym.forEach(t),gi=h(o),zs=s(o,"P",{});var $f=r(zs);Nl=i($f,"Following the original Vision Transformer, some follow-up works have been made:"),$f.forEach(t),_i=h(o),Ne=s(o,"UL",{});var Do=r(Ne);Br=s(Do,"LI",{});var kf=r(Br);B=s(kf,"P",{});var se=r(B);Ns=s(se,"A",{href:!0});var Ef=r(Ns);ql=i(Ef,"DeiT"),Ef.forEach(t),Dl=i(se,` (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 `),qs=s(se,"A",{href:!0});var If=r(qs);Ll=i(If,"ViTModel"),If.forEach(t),Ol=i(se,` or
`),Ds=s(se,"A",{href:!0});var xf=r(Ds);Sl=i(xf,"ViTForImageClassification"),xf.forEach(t),Rl=i(se,". There are 4 variants available (in 3 different sizes): "),Hr=s(se,"EM",{});var Vf=r(Hr);Ul=i(Vf,"facebook/deit-tiny-patch16-224"),Vf.forEach(t),Wl=i(se,`,
`),Kr=s(se,"EM",{});var Ff=r(Kr);Bl=i(Ff,"facebook/deit-small-patch16-224"),Ff.forEach(t),Hl=i(se,", "),Jr=s(se,"EM",{});var Pf=r(Jr);Kl=i(Pf,"facebook/deit-base-patch16-224"),Pf.forEach(t),Jl=i(se," and "),Gr=s(se,"EM",{});var Mf=r(Gr);Gl=i(Mf,"facebook/deit-base-patch16-384"),Mf.forEach(t),Xl=i(se,`. Note that one should
use `),Ls=s(se,"A",{href:!0});var jf=r(Ls);Ql=i(jf,"DeiTImageProcessor"),jf.forEach(t),Yl=i(se," in order to prepare images for the model."),se.forEach(t),kf.forEach(t),Zl=h(Do),Xr=s(Do,"LI",{});var Cf=r(Xr);Os=s(Cf,"P",{});var Zm=r(Os);Ss=s(Zm,"A",{href:!0});var Af=r(Ss);ed=i(Af,"BEiT"),Af.forEach(t),td=i(Zm,` (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.`),Zm.forEach(t),Cf.forEach(t),od=h(Do),Qr=s(Do,"LI",{});var zf=r(Qr);ea=s(zf,"P",{});var rl=r(ea);ad=i(rl,`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 `),ta=s(rl,"A",{href:!0,rel:!0});var Nf=r(ta);sd=i(Nf,"hub"),Nf.forEach(t),rd=i(rl,"."),rl.forEach(t),zf.forEach(t),nd=h(Do),Yr=s(Do,"LI",{});var qf=r(Yr);Rs=s(qf,"P",{});var ef=r(Rs);Us=s(ef,"A",{href:!0});var Df=r(Us);id=i(Df,"MAE"),Df.forEach(t),ld=i(ef,` (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.`),ef.forEach(t),qf.forEach(t),Do.forEach(t),vi=h(o),mt=s(o,"P",{});var Pr=r(mt);dd=i(Pr,"This model was contributed by "),oa=s(Pr,"A",{href:!0,rel:!0});var Lf=r(oa);cd=i(Lf,"nielsr"),Lf.forEach(t),pd=i(Pr,`. The original code (written in JAX) can be
found `),aa=s(Pr,"A",{href:!0,rel:!0});var Of=r(aa);hd=i(Of,"here"),Of.forEach(t),md=i(Pr,"."),Pr.forEach(t),Ti=h(o),eo=s(o,"P",{});var nl=r(eo);fd=i(nl,"Note that we converted the weights from Ross Wightman\u2019s "),sa=s(nl,"A",{href:!0,rel:!0});var Sf=r(sa);ud=i(Sf,"timm library"),Sf.forEach(t),gd=i(nl,`, who already converted the weights from JAX to PyTorch. Credits
go to him!`),nl.forEach(t),bi=h(o),Pt=s(o,"H2",{class:!0});var il=r(Pt);to=s(il,"A",{id:!0,class:!0,href:!0});var Rf=r(to);Zr=s(Rf,"SPAN",{});var Uf=r(Zr);y(ra.$$.fragment,Uf),Uf.forEach(t),Rf.forEach(t),_d=h(il),en=s(il,"SPAN",{});var Wf=r(en);vd=i(Wf,"Resources"),Wf.forEach(t),il.forEach(t),wi=h(o),Ws=s(o,"P",{});var Bf=r(Ws);Td=i(Bf,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT."),Bf.forEach(t),yi=h(o),y(na.$$.fragment,o),$i=h(o),qe=s(o,"UL",{});var Lo=r(qe);ft=s(Lo,"LI",{});var Cs=r(ft);Bs=s(Cs,"A",{href:!0});var Hf=r(Bs);bd=i(Hf,"ViTForImageClassification"),Hf.forEach(t),wd=i(Cs," is supported by this "),ia=s(Cs,"A",{href:!0,rel:!0});var Kf=r(ia);yd=i(Kf,"example script"),Kf.forEach(t),$d=i(Cs," and "),la=s(Cs,"A",{href:!0,rel:!0});var Jf=r(la);kd=i(Jf,"notebook"),Jf.forEach(t),Ed=i(Cs,"."),Cs.forEach(t),Id=h(Lo),Mt=s(Lo,"LI",{});var Mr=r(Mt);xd=i(Mr,"A blog on fine-tuning "),Hs=s(Mr,"A",{href:!0});var Gf=r(Hs);Vd=i(Gf,"ViTForImageClassification"),Gf.forEach(t),Fd=i(Mr," on a custom dataset can be found "),da=s(Mr,"A",{href:!0,rel:!0});var Xf=r(da);Pd=i(Xf,"here"),Xf.forEach(t),Md=i(Mr,"."),Mr.forEach(t),jd=h(Lo),jt=s(Lo,"LI",{});var jr=r(jt);Cd=i(jr,"More demo notebooks to fine-tune "),Ks=s(jr,"A",{href:!0});var Qf=r(Ks);Ad=i(Qf,"ViTForImageClassification"),Qf.forEach(t),zd=i(jr," can be found "),ca=s(jr,"A",{href:!0,rel:!0});var Yf=r(ca);Nd=i(Yf,"here"),Yf.forEach(t),qd=i(jr,"."),jr.forEach(t),Dd=h(Lo),tn=s(Lo,"LI",{});var Zf=r(tn);Js=s(Zf,"A",{href:!0});var eu=r(Js);Ld=i(eu,"Image classification task guide"),eu.forEach(t),Zf.forEach(t),Lo.forEach(t),ki=h(o),Gs=s(o,"P",{});var tu=r(Gs);Od=i(tu,"Besides that:"),tu.forEach(t),Ei=h(o),Xs=s(o,"UL",{});var ou=r(Xs);oo=s(ou,"LI",{});var fi=r(oo);Qs=s(fi,"A",{href:!0});var au=r(Qs);Sd=i(au,"ViTForMaskedImageModeling"),au.forEach(t),Rd=i(fi," is supported by this "),pa=s(fi,"A",{href:!0,rel:!0});var su=r(pa);Ud=i(su,"example script"),su.forEach(t),Wd=i(fi,"."),fi.forEach(t),ou.forEach(t),Ii=h(o),Ys=s(o,"P",{});var ru=r(Ys);Bd=i(ru,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ru.forEach(t),xi=h(o),Ct=s(o,"H2",{class:!0});var ll=r(Ct);ao=s(ll,"A",{id:!0,class:!0,href:!0});var nu=r(ao);on=s(nu,"SPAN",{});var iu=r(on);y(ha.$$.fragment,iu),iu.forEach(t),nu.forEach(t),Hd=h(ll),an=s(ll,"SPAN",{});var lu=r(an);Kd=i(lu,"Resources"),lu.forEach(t),ll.forEach(t),Vi=h(o),Zs=s(o,"P",{});var du=r(Zs);Jd=i(du,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),du.forEach(t),Fi=h(o),ma=s(o,"P",{});var tf=r(ma);sn=s(tf,"CODE",{});var cu=r(sn);Gd=i(cu,"ViTForImageClassification"),cu.forEach(t),Xd=i(tf," is supported by:"),tf.forEach(t),Pi=h(o),y(fa.$$.fragment,o),Mi=h(o),ye=s(o,"UL",{});var gt=r(ye);er=s(gt,"LI",{});var of=r(er);Qd=i(of,"A blog post on how to "),ua=s(of,"A",{href:!0,rel:!0});var pu=r(ua);Yd=i(pu,"Fine-Tune ViT for Image Classification with Hugging Face Transformers"),pu.forEach(t),of.forEach(t),Zd=h(gt),tr=s(gt,"LI",{});var af=r(tr);ec=i(af,"A blog post on "),so=s(af,"A",{href:!0,rel:!0});var sf=r(so);tc=i(sf,"Image Classification with Hugging Face Transformers and "),rn=s(sf,"CODE",{});var hu=r(rn);oc=i(hu,"Keras"),hu.forEach(t),sf.forEach(t),af.forEach(t),ac=h(gt),or=s(gt,"LI",{});var rf=r(or);sc=i(rf,"A notebook on "),ga=s(rf,"A",{href:!0,rel:!0});var mu=r(ga);rc=i(mu,"Fine-tuning for Image Classification with Hugging Face Transformers"),mu.forEach(t),rf.forEach(t),nc=h(gt),ar=s(gt,"LI",{});var nf=r(ar);ic=i(nf,"A notebook on how to "),_a=s(nf,"A",{href:!0,rel:!0});var fu=r(_a);lc=i(fu,"Fine-tune the Vision Transformer on CIFAR-10 with the Hugging Face Trainer"),fu.forEach(t),nf.forEach(t),dc=h(gt),sr=s(gt,"LI",{});var lf=r(sr);cc=i(lf,"A notebook on how to "),va=s(lf,"A",{href:!0,rel:!0});var uu=r(va);pc=i(uu,"Fine-tune the Vision Transformer on CIFAR-10 with PyTorch Lightning"),uu.forEach(t),lf.forEach(t),gt.forEach(t),ji=h(o),rr=s(o,"P",{});var gu=r(rr);hc=i(gu,"\u2697\uFE0F Optimization"),gu.forEach(t),Ci=h(o),nr=s(o,"UL",{});var _u=r(nr);ir=s(_u,"LI",{});var df=r(ir);mc=i(df,"A blog post on how to "),Ta=s(df,"A",{href:!0,rel:!0});var vu=r(Ta);fc=i(vu,"Accelerate Vision Transformer (ViT) with Quantization using Optimum"),vu.forEach(t),df.forEach(t),_u.forEach(t),Ai=h(o),lr=s(o,"P",{});var Tu=r(lr);uc=i(Tu,"\u26A1\uFE0F Inference"),Tu.forEach(t),zi=h(o),dr=s(o,"UL",{});var bu=r(dr);cr=s(bu,"LI",{});var cf=r(cr);gc=i(cf,"A notebook on "),ba=s(cf,"A",{href:!0,rel:!0});var wu=r(ba);_c=i(wu,"Quick demo: Vision Transformer (ViT) by Google Brain"),wu.forEach(t),cf.forEach(t),bu.forEach(t),Ni=h(o),pr=s(o,"P",{});var yu=r(pr);vc=i(yu,"\u{1F680} Deploy"),yu.forEach(t),qi=h(o),ut=s(o,"UL",{});var Cr=r(ut);hr=s(Cr,"LI",{});var pf=r(hr);Tc=i(pf,"A blog post on "),wa=s(pf,"A",{href:!0,rel:!0});var $u=r(wa);bc=i($u,"Deploying Tensorflow Vision Models in Hugging Face with TF Serving"),$u.forEach(t),pf.forEach(t),wc=h(Cr),mr=s(Cr,"LI",{});var hf=r(mr);yc=i(hf,"A blog post on "),ya=s(hf,"A",{href:!0,rel:!0});var ku=r(ya);$c=i(ku,"Deploying Hugging Face ViT on Vertex AI"),ku.forEach(t),hf.forEach(t),kc=h(Cr),fr=s(Cr,"LI",{});var mf=r(fr);Ec=i(mf,"A blog post on "),$a=s(mf,"A",{href:!0,rel:!0});var Eu=r($a);Ic=i(Eu,"Deploying Hugging Face ViT on Kubernetes with TF Serving"),Eu.forEach(t),mf.forEach(t),Cr.forEach(t),Di=h(o),At=s(o,"H2",{class:!0});var dl=r(At);ro=s(dl,"A",{id:!0,class:!0,href:!0});var Iu=r(ro);nn=s(Iu,"SPAN",{});var xu=r(nn);y(ka.$$.fragment,xu),xu.forEach(t),Iu.forEach(t),xc=h(dl),ln=s(dl,"SPAN",{});var Vu=r(ln);Vc=i(Vu,"ViTConfig"),Vu.forEach(t),dl.forEach(t),Li=h(o),Me=s(o,"DIV",{class:!0});var Oo=r(Me);y(Ea.$$.fragment,Oo),Fc=h(Oo),zt=s(Oo,"P",{});var Ar=r(zt);Pc=i(Ar,"This is the configuration class to store the configuration of a "),ur=s(Ar,"A",{href:!0});var Fu=r(ur);Mc=i(Fu,"ViTModel"),Fu.forEach(t),jc=i(Ar,`. 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
`),Ia=s(Ar,"A",{href:!0,rel:!0});var Pu=r(Ia);Cc=i(Pu,"google/vit-base-patch16-224"),Pu.forEach(t),Ac=i(Ar," architecture."),Ar.forEach(t),zc=h(Oo),Nt=s(Oo,"P",{});var zr=r(Nt);Nc=i(zr,"Configuration objects inherit from "),gr=s(zr,"A",{href:!0});var Mu=r(gr);qc=i(Mu,"PretrainedConfig"),Mu.forEach(t),Dc=i(zr,` and can be used to control the model outputs. Read the
documentation from `),_r=s(zr,"A",{href:!0});var ju=r(_r);Lc=i(ju,"PretrainedConfig"),ju.forEach(t),Oc=i(zr," for more information."),zr.forEach(t),Sc=h(Oo),y(no.$$.fragment,Oo),Oo.forEach(t),Oi=h(o),qt=s(o,"H2",{class:!0});var cl=r(qt);io=s(cl,"A",{id:!0,class:!0,href:!0});var Cu=r(io);dn=s(Cu,"SPAN",{});var Au=r(dn);y(xa.$$.fragment,Au),Au.forEach(t),Cu.forEach(t),Rc=h(cl),cn=s(cl,"SPAN",{});var zu=r(cn);Uc=i(zu,"ViTFeatureExtractor"),zu.forEach(t),cl.forEach(t),Si=h(o),Dt=s(o,"DIV",{class:!0});var pl=r(Dt);y(Va.$$.fragment,pl),Wc=h(pl),lo=s(pl,"DIV",{class:!0});var hl=r(lo);y(Fa.$$.fragment,hl),Bc=h(hl),pn=s(hl,"P",{});var Nu=r(pn);Hc=i(Nu,"Preprocess an image or a batch of images."),Nu.forEach(t),hl.forEach(t),pl.forEach(t),Ri=h(o),Lt=s(o,"H2",{class:!0});var ml=r(Lt);co=s(ml,"A",{id:!0,class:!0,href:!0});var qu=r(co);hn=s(qu,"SPAN",{});var Du=r(hn);y(Pa.$$.fragment,Du),Du.forEach(t),qu.forEach(t),Kc=h(ml),mn=s(ml,"SPAN",{});var Lu=r(mn);Jc=i(Lu,"ViTImageProcessor"),Lu.forEach(t),ml.forEach(t),Ui=h(o),dt=s(o,"DIV",{class:!0});var Nr=r(dt);y(Ma.$$.fragment,Nr),Gc=h(Nr),fn=s(Nr,"P",{});var Ou=r(fn);Xc=i(Ou,"Constructs a ViT image processor."),Ou.forEach(t),Qc=h(Nr),po=s(Nr,"DIV",{class:!0});var fl=r(po);y(ja.$$.fragment,fl),Yc=h(fl),un=s(fl,"P",{});var Su=r(un);Zc=i(Su,"Preprocess an image or batch of images."),Su.forEach(t),fl.forEach(t),Nr.forEach(t),Wi=h(o),Ot=s(o,"H2",{class:!0});var ul=r(Ot);ho=s(ul,"A",{id:!0,class:!0,href:!0});var Ru=r(ho);gn=s(Ru,"SPAN",{});var Uu=r(gn);y(Ca.$$.fragment,Uu),Uu.forEach(t),Ru.forEach(t),ep=h(ul),_n=s(ul,"SPAN",{});var Wu=r(_n);tp=i(Wu,"ViTModel"),Wu.forEach(t),ul.forEach(t),Bi=h(o),ct=s(o,"DIV",{class:!0});var qr=r(ct);y(Aa.$$.fragment,qr),op=h(qr),za=s(qr,"P",{});var gl=r(za);ap=i(gl,`The bare ViT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Na=s(gl,"A",{href:!0,rel:!0});var Bu=r(Na);sp=i(Bu,"torch.nn.Module"),Bu.forEach(t),rp=i(gl,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gl.forEach(t),np=h(qr),De=s(qr,"DIV",{class:!0});var So=r(De);y(qa.$$.fragment,So),ip=h(So),St=s(So,"P",{});var Dr=r(St);lp=i(Dr,"The "),vr=s(Dr,"A",{href:!0});var Hu=r(vr);dp=i(Hu,"ViTModel"),Hu.forEach(t),cp=i(Dr," forward method, overrides the "),vn=s(Dr,"CODE",{});var Ku=r(vn);pp=i(Ku,"__call__"),Ku.forEach(t),hp=i(Dr," special method."),Dr.forEach(t),mp=h(So),y(mo.$$.fragment,So),fp=h(So),y(fo.$$.fragment,So),So.forEach(t),qr.forEach(t),Hi=h(o),Rt=s(o,"H2",{class:!0});var _l=r(Rt);uo=s(_l,"A",{id:!0,class:!0,href:!0});var Ju=r(uo);Tn=s(Ju,"SPAN",{});var Gu=r(Tn);y(Da.$$.fragment,Gu),Gu.forEach(t),Ju.forEach(t),up=h(_l),bn=s(_l,"SPAN",{});var Xu=r(bn);gp=i(Xu,"ViTForMaskedImageModeling"),Xu.forEach(t),_l.forEach(t),Ki=h(o),ge=s(o,"DIV",{class:!0});var _t=r(ge);y(La.$$.fragment,_t),_p=h(_t),Oa=s(_t,"P",{});var vl=r(Oa);vp=i(vl,"ViT Model with a decoder on top for masked image modeling, as proposed in "),Sa=s(vl,"A",{href:!0,rel:!0});var Qu=r(Sa);Tp=i(Qu,"SimMIM"),Qu.forEach(t),bp=i(vl,"."),vl.forEach(t),wp=h(_t),y(go.$$.fragment,_t),yp=h(_t),Ra=s(_t,"P",{});var Tl=r(Ra);$p=i(Tl,"This model is a PyTorch "),Ua=s(Tl,"A",{href:!0,rel:!0});var Yu=r(Ua);kp=i(Yu,"torch.nn.Module"),Yu.forEach(t),Ep=i(Tl,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tl.forEach(t),Ip=h(_t),Le=s(_t,"DIV",{class:!0});var Ro=r(Le);y(Wa.$$.fragment,Ro),xp=h(Ro),Ut=s(Ro,"P",{});var Lr=r(Ut);Vp=i(Lr,"The "),Tr=s(Lr,"A",{href:!0});var Zu=r(Tr);Fp=i(Zu,"ViTForMaskedImageModeling"),Zu.forEach(t),Pp=i(Lr," forward method, overrides the "),wn=s(Lr,"CODE",{});var eg=r(wn);Mp=i(eg,"__call__"),eg.forEach(t),jp=i(Lr," special method."),Lr.forEach(t),Cp=h(Ro),y(_o.$$.fragment,Ro),Ap=h(Ro),y(vo.$$.fragment,Ro),Ro.forEach(t),_t.forEach(t),Ji=h(o),Wt=s(o,"H2",{class:!0});var bl=r(Wt);To=s(bl,"A",{id:!0,class:!0,href:!0});var tg=r(To);yn=s(tg,"SPAN",{});var og=r(yn);y(Ba.$$.fragment,og),og.forEach(t),tg.forEach(t),zp=h(bl),$n=s(bl,"SPAN",{});var ag=r($n);Np=i(ag,"ViTForImageClassification"),ag.forEach(t),bl.forEach(t),Gi=h(o),_e=s(o,"DIV",{class:!0});var vt=r(_e);y(Ha.$$.fragment,vt),qp=h(vt),kn=s(vt,"P",{});var sg=r(kn);Dp=i(sg,`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.`),sg.forEach(t),Lp=h(vt),y(bo.$$.fragment,vt),Op=h(vt),Ka=s(vt,"P",{});var wl=r(Ka);Sp=i(wl,"This model is a PyTorch "),Ja=s(wl,"A",{href:!0,rel:!0});var rg=r(Ja);Rp=i(rg,"torch.nn.Module"),rg.forEach(t),Up=i(wl,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wl.forEach(t),Wp=h(vt),Oe=s(vt,"DIV",{class:!0});var Uo=r(Oe);y(Ga.$$.fragment,Uo),Bp=h(Uo),Bt=s(Uo,"P",{});var Or=r(Bt);Hp=i(Or,"The "),br=s(Or,"A",{href:!0});var ng=r(br);Kp=i(ng,"ViTForImageClassification"),ng.forEach(t),Jp=i(Or," forward method, overrides the "),En=s(Or,"CODE",{});var ig=r(En);Gp=i(ig,"__call__"),ig.forEach(t),Xp=i(Or," special method."),Or.forEach(t),Qp=h(Uo),y(wo.$$.fragment,Uo),Yp=h(Uo),y(yo.$$.fragment,Uo),Uo.forEach(t),vt.forEach(t),Xi=h(o),Ht=s(o,"H2",{class:!0});var yl=r(Ht);$o=s(yl,"A",{id:!0,class:!0,href:!0});var lg=r($o);In=s(lg,"SPAN",{});var dg=r(In);y(Xa.$$.fragment,dg),dg.forEach(t),lg.forEach(t),Zp=h(yl),xn=s(yl,"SPAN",{});var cg=r(xn);eh=i(cg,"TFViTModel"),cg.forEach(t),yl.forEach(t),Qi=h(o),oe=s(o,"DIV",{class:!0});var Be=r(oe);y(Qa.$$.fragment,Be),th=h(Be),Vn=s(Be,"P",{});var pg=r(Vn);oh=i(pg,"The bare ViT Model transformer outputting raw hidden-states without any specific head on top."),pg.forEach(t),ah=h(Be),Ya=s(Be,"P",{});var $l=r(Ya);sh=i($l,"This model inherits from "),wr=s($l,"A",{href:!0});var hg=r(wr);rh=i(hg,"TFPreTrainedModel"),hg.forEach(t),nh=i($l,`. 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.)`),$l.forEach(t),ih=h(Be),Za=s(Be,"P",{});var kl=r(Za);lh=i(kl,"This model is also a "),es=s(kl,"A",{href:!0,rel:!0});var mg=r(es);dh=i(mg,"tf.keras.Model"),mg.forEach(t),ch=i(kl,` 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.`),kl.forEach(t),ph=h(Be),y(ko.$$.fragment,Be),hh=h(Be),Se=s(Be,"DIV",{class:!0});var Wo=r(Se);y(ts.$$.fragment,Wo),mh=h(Wo),Kt=s(Wo,"P",{});var Sr=r(Kt);fh=i(Sr,"The "),yr=s(Sr,"A",{href:!0});var fg=r(yr);uh=i(fg,"TFViTModel"),fg.forEach(t),gh=i(Sr," forward method, overrides the "),Fn=s(Sr,"CODE",{});var ug=r(Fn);_h=i(ug,"__call__"),ug.forEach(t),vh=i(Sr," special method."),Sr.forEach(t),Th=h(Wo),y(Eo.$$.fragment,Wo),bh=h(Wo),y(Io.$$.fragment,Wo),Wo.forEach(t),Be.forEach(t),Yi=h(o),Jt=s(o,"H2",{class:!0});var El=r(Jt);xo=s(El,"A",{id:!0,class:!0,href:!0});var gg=r(xo);Pn=s(gg,"SPAN",{});var _g=r(Pn);y(os.$$.fragment,_g),_g.forEach(t),gg.forEach(t),wh=h(El),Mn=s(El,"SPAN",{});var vg=r(Mn);yh=i(vg,"TFViTForImageClassification"),vg.forEach(t),El.forEach(t),Zi=h(o),K=s(o,"DIV",{class:!0});var $e=r(K);y(as.$$.fragment,$e),$h=h($e),jn=s($e,"P",{});var Tg=r(jn);kh=i(Tg,`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.`),Tg.forEach(t),Eh=h($e),y(Vo.$$.fragment,$e),Ih=h($e),ss=s($e,"P",{});var Il=r(ss);xh=i(Il,"This model inherits from "),$r=s(Il,"A",{href:!0});var bg=r($r);Vh=i(bg,"TFPreTrainedModel"),bg.forEach(t),Fh=i(Il,`. 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.)`),Il.forEach(t),Ph=h($e),rs=s($e,"P",{});var xl=r(rs);Mh=i(xl,"This model is also a "),ns=s(xl,"A",{href:!0,rel:!0});var wg=r(ns);jh=i(wg,"tf.keras.Model"),wg.forEach(t),Ch=i(xl,` 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.`),xl.forEach(t),Ah=h($e),y(Fo.$$.fragment,$e),zh=h($e),Re=s($e,"DIV",{class:!0});var Bo=r(Re);y(is.$$.fragment,Bo),Nh=h(Bo),Gt=s(Bo,"P",{});var Rr=r(Gt);qh=i(Rr,"The "),kr=s(Rr,"A",{href:!0});var yg=r(kr);Dh=i(yg,"TFViTForImageClassification"),yg.forEach(t),Lh=i(Rr," forward method, overrides the "),Cn=s(Rr,"CODE",{});var $g=r(Cn);Oh=i($g,"__call__"),$g.forEach(t),Sh=i(Rr," special method."),Rr.forEach(t),Rh=h(Bo),y(Po.$$.fragment,Bo),Uh=h(Bo),y(Mo.$$.fragment,Bo),Bo.forEach(t),$e.forEach(t),el=h(o),Xt=s(o,"H2",{class:!0});var Vl=r(Xt);jo=s(Vl,"A",{id:!0,class:!0,href:!0});var kg=r(jo);An=s(kg,"SPAN",{});var Eg=r(An);y(ls.$$.fragment,Eg),Eg.forEach(t),kg.forEach(t),Wh=h(Vl),zn=s(Vl,"SPAN",{});var Ig=r(zn);Bh=i(Ig,"FlaxVitModel"),Ig.forEach(t),Vl.forEach(t),tl=h(o),J=s(o,"DIV",{class:!0});var ke=r(J);y(ds.$$.fragment,ke),Hh=h(ke),Nn=s(ke,"P",{});var xg=r(Nn);Kh=i(xg,"The bare ViT Model transformer outputting raw hidden-states without any specific head on top."),xg.forEach(t),Jh=h(ke),cs=s(ke,"P",{});var Fl=r(cs);Gh=i(Fl,"This model inherits from "),Er=s(Fl,"A",{href:!0});var Vg=r(Er);Xh=i(Vg,"FlaxPreTrainedModel"),Vg.forEach(t),Qh=i(Fl,`. 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)`),Fl.forEach(t),Yh=h(ke),ps=s(ke,"P",{});var Pl=r(ps);Zh=i(Pl,"This model is also a Flax Linen "),hs=s(Pl,"A",{href:!0,rel:!0});var Fg=r(hs);em=i(Fg,"flax.linen.Module"),Fg.forEach(t),tm=i(Pl,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Pl.forEach(t),om=h(ke),qn=s(ke,"P",{});var Pg=r(qn);am=i(Pg,"Finally, this model supports inherent JAX features such as:"),Pg.forEach(t),sm=h(ke),pt=s(ke,"UL",{});var Ho=r(pt);Dn=s(Ho,"LI",{});var Mg=r(Dn);ms=s(Mg,"A",{href:!0,rel:!0});var jg=r(ms);rm=i(jg,"Just-In-Time (JIT) compilation"),jg.forEach(t),Mg.forEach(t),nm=h(Ho),Ln=s(Ho,"LI",{});var Cg=r(Ln);fs=s(Cg,"A",{href:!0,rel:!0});var Ag=r(fs);im=i(Ag,"Automatic Differentiation"),Ag.forEach(t),Cg.forEach(t),lm=h(Ho),On=s(Ho,"LI",{});var zg=r(On);us=s(zg,"A",{href:!0,rel:!0});var Ng=r(us);dm=i(Ng,"Vectorization"),Ng.forEach(t),zg.forEach(t),cm=h(Ho),Sn=s(Ho,"LI",{});var qg=r(Sn);gs=s(qg,"A",{href:!0,rel:!0});var Dg=r(gs);pm=i(Dg,"Parallelization"),Dg.forEach(t),qg.forEach(t),Ho.forEach(t),hm=h(ke),Ue=s(ke,"DIV",{class:!0});var Ko=r(Ue);y(_s.$$.fragment,Ko),mm=h(Ko),Qt=s(Ko,"P",{});var Ur=r(Qt);fm=i(Ur,"The "),Rn=s(Ur,"CODE",{});var Lg=r(Rn);um=i(Lg,"FlaxViTPreTrainedModel"),Lg.forEach(t),gm=i(Ur," forward method, overrides the "),Un=s(Ur,"CODE",{});var Og=r(Un);_m=i(Og,"__call__"),Og.forEach(t),vm=i(Ur," special method."),Ur.forEach(t),Tm=h(Ko),y(Co.$$.fragment,Ko),bm=h(Ko),y(Ao.$$.fragment,Ko),Ko.forEach(t),ke.forEach(t),ol=h(o),Yt=s(o,"H2",{class:!0});var Ml=r(Yt);zo=s(Ml,"A",{id:!0,class:!0,href:!0});var Sg=r(zo);Wn=s(Sg,"SPAN",{});var Rg=r(Wn);y(vs.$$.fragment,Rg),Rg.forEach(t),Sg.forEach(t),wm=h(Ml),Bn=s(Ml,"SPAN",{});var Ug=r(Bn);ym=i(Ug,"FlaxViTForImageClassification"),Ug.forEach(t),Ml.forEach(t),al=h(o),G=s(o,"DIV",{class:!0});var Ee=r(G);y(Ts.$$.fragment,Ee),$m=h(Ee),Hn=s(Ee,"P",{});var Wg=r(Hn);km=i(Wg,`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.`),Wg.forEach(t),Em=h(Ee),bs=s(Ee,"P",{});var jl=r(bs);Im=i(jl,"This model inherits from "),Ir=s(jl,"A",{href:!0});var Bg=r(Ir);xm=i(Bg,"FlaxPreTrainedModel"),Bg.forEach(t),Vm=i(jl,`. 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)`),jl.forEach(t),Fm=h(Ee),ws=s(Ee,"P",{});var Cl=r(ws);Pm=i(Cl,"This model is also a Flax Linen "),ys=s(Cl,"A",{href:!0,rel:!0});var Hg=r(ys);Mm=i(Hg,"flax.linen.Module"),Hg.forEach(t),jm=i(Cl,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Cl.forEach(t),Cm=h(Ee),Kn=s(Ee,"P",{});var Kg=r(Kn);Am=i(Kg,"Finally, this model supports inherent JAX features such as:"),Kg.forEach(t),zm=h(Ee),ht=s(Ee,"UL",{});var Jo=r(ht);Jn=s(Jo,"LI",{});var Jg=r(Jn);$s=s(Jg,"A",{href:!0,rel:!0});var Gg=r($s);Nm=i(Gg,"Just-In-Time (JIT) compilation"),Gg.forEach(t),Jg.forEach(t),qm=h(Jo),Gn=s(Jo,"LI",{});var Xg=r(Gn);ks=s(Xg,"A",{href:!0,rel:!0});var Qg=r(ks);Dm=i(Qg,"Automatic Differentiation"),Qg.forEach(t),Xg.forEach(t),Lm=h(Jo),Xn=s(Jo,"LI",{});var Yg=r(Xn);Es=s(Yg,"A",{href:!0,rel:!0});var Zg=r(Es);Om=i(Zg,"Vectorization"),Zg.forEach(t),Yg.forEach(t),Sm=h(Jo),Qn=s(Jo,"LI",{});var e_=r(Qn);Is=s(e_,"A",{href:!0,rel:!0});var t_=r(Is);Rm=i(t_,"Parallelization"),t_.forEach(t),e_.forEach(t),Jo.forEach(t),Um=h(Ee),We=s(Ee,"DIV",{class:!0});var Go=r(We);y(xs.$$.fragment,Go),Wm=h(Go),Zt=s(Go,"P",{});var Wr=r(Zt);Bm=i(Wr,"The "),Yn=s(Wr,"CODE",{});var o_=r(Yn);Hm=i(o_,"FlaxViTPreTrainedModel"),o_.forEach(t),Km=i(Wr," forward method, overrides the "),Zn=s(Wr,"CODE",{});var a_=r(Zn);Jm=i(a_,"__call__"),a_.forEach(t),Gm=i(Wr," special method."),Wr.forEach(t),Xm=h(Go),y(No.$$.fragment,Go),Qm=h(Go),y(qo.$$.fragment,Go),Go.forEach(t),Ee.forEach(t),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(j_)),d(_,"id","vision-transformer-vit"),d(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(_,"href","#vision-transformer-vit"),d(g,"class","relative group"),d(D,"id","overview"),d(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(D,"href","#overview"),d(z,"class","relative group"),d(ne,"href","https://arxiv.org/abs/2010.11929"),d(ne,"rel","nofollow"),d(H,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),d(H,"rel","nofollow"),d(Te,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTImageProcessor"),d(q,"href","https://huggingface.co/models?search=vit"),d(q,"rel","nofollow"),d(te,"href","http://www.image-net.org/"),d(te,"rel","nofollow"),d(M,"href","http://www.image-net.org/challenges/LSVRC/2012/"),d(M,"rel","nofollow"),d(U,"href","https://arxiv.org/abs/1906.06423"),d(U,"rel","nofollow"),d(Fe,"href","https://arxiv.org/abs/1912.11370"),d(Fe,"rel","nofollow"),d_(we.src,ff="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/vit_architecture.jpg")||d(we,"src",ff),d(we,"alt","drawing"),d(we,"width","600"),d(As,"href","https://arxiv.org/abs/2010.11929"),d(Ns,"href","deit"),d(qs,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTModel"),d(Ds,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(Ls,"href","/docs/transformers/v4.29.0/en/model_doc/deit#transformers.DeiTImageProcessor"),d(Ss,"href","beit"),d(ta,"href","https://huggingface.co/models?other=dino"),d(ta,"rel","nofollow"),d(Us,"href","vit_mae"),d(oa,"href","https://huggingface.co/nielsr"),d(oa,"rel","nofollow"),d(aa,"href","https://github.com/google-research/vision_transformer"),d(aa,"rel","nofollow"),d(sa,"href","https://github.com/rwightman/pytorch-image-models"),d(sa,"rel","nofollow"),d(to,"id","resources"),d(to,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(to,"href","#resources"),d(Pt,"class","relative group"),d(Bs,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(ia,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(ia,"rel","nofollow"),d(la,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(la,"rel","nofollow"),d(Hs,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(da,"href","https://huggingface.co/blog/fine-tune-vit"),d(da,"rel","nofollow"),d(Ks,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(ca,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),d(ca,"rel","nofollow"),d(Js,"href","../tasks/image_classification"),d(Qs,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForMaskedImageModeling"),d(pa,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),d(pa,"rel","nofollow"),d(ao,"id","resources"),d(ao,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ao,"href","#resources"),d(Ct,"class","relative group"),d(ua,"href","https://huggingface.co/blog/fine-tune-vit"),d(ua,"rel","nofollow"),d(so,"href","https://www.philschmid.de/image-classification-huggingface-transformers-keras"),d(so,"rel","nofollow"),d(ga,"href","https://github.com/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(ga,"rel","nofollow"),d(_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"),d(_a,"rel","nofollow"),d(va,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Fine_tuning_the_Vision_Transformer_on_CIFAR_10_with_PyTorch_Lightning.ipynb"),d(va,"rel","nofollow"),d(Ta,"href","https://www.philschmid.de/optimizing-vision-transformer"),d(Ta,"rel","nofollow"),d(ba,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Quick_demo_of_HuggingFace_version_of_Vision_Transformer_inference.ipynb"),d(ba,"rel","nofollow"),d(wa,"href","https://huggingface.co/blog/tf-serving-vision"),d(wa,"rel","nofollow"),d(ya,"href","https://huggingface.co/blog/deploy-vertex-ai"),d(ya,"rel","nofollow"),d($a,"href","https://huggingface.co/blog/deploy-tfserving-kubernetes"),d($a,"rel","nofollow"),d(ro,"id","transformers.ViTConfig"),d(ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ro,"href","#transformers.ViTConfig"),d(At,"class","relative group"),d(ur,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTModel"),d(Ia,"href","https://huggingface.co/google/vit-base-patch16-224"),d(Ia,"rel","nofollow"),d(gr,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(_r,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(io,"id","transformers.ViTFeatureExtractor"),d(io,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(io,"href","#transformers.ViTFeatureExtractor"),d(qt,"class","relative group"),d(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(co,"id","transformers.ViTImageProcessor"),d(co,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(co,"href","#transformers.ViTImageProcessor"),d(Lt,"class","relative group"),d(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ho,"id","transformers.ViTModel"),d(ho,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ho,"href","#transformers.ViTModel"),d(Ot,"class","relative group"),d(Na,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Na,"rel","nofollow"),d(vr,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTModel"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(uo,"id","transformers.ViTForMaskedImageModeling"),d(uo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(uo,"href","#transformers.ViTForMaskedImageModeling"),d(Rt,"class","relative group"),d(Sa,"href","https://arxiv.org/abs/2111.09886"),d(Sa,"rel","nofollow"),d(Ua,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ua,"rel","nofollow"),d(Tr,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForMaskedImageModeling"),d(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(To,"id","transformers.ViTForImageClassification"),d(To,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(To,"href","#transformers.ViTForImageClassification"),d(Wt,"class","relative group"),d(Ja,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ja,"rel","nofollow"),d(br,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($o,"id","transformers.TFViTModel"),d($o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d($o,"href","#transformers.TFViTModel"),d(Ht,"class","relative group"),d(wr,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(es,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(es,"rel","nofollow"),d(yr,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.TFViTModel"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xo,"id","transformers.TFViTForImageClassification"),d(xo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(xo,"href","#transformers.TFViTForImageClassification"),d(Jt,"class","relative group"),d($r,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(ns,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(ns,"rel","nofollow"),d(kr,"href","/docs/transformers/v4.29.0/en/model_doc/vit#transformers.TFViTForImageClassification"),d(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jo,"id","transformers.FlaxViTModel"),d(jo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(jo,"href","#transformers.FlaxViTModel"),d(Xt,"class","relative group"),d(Er,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(hs,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(hs,"rel","nofollow"),d(ms,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(ms,"rel","nofollow"),d(fs,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(fs,"rel","nofollow"),d(us,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(us,"rel","nofollow"),d(gs,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(gs,"rel","nofollow"),d(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zo,"id","transformers.FlaxViTForImageClassification"),d(zo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(zo,"href","#transformers.FlaxViTForImageClassification"),d(Yt,"class","relative group"),d(Ir,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(ys,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(ys,"rel","nofollow"),d($s,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d($s,"rel","nofollow"),d(ks,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(ks,"rel","nofollow"),d(Es,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Es,"rel","nofollow"),d(Is,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Is,"rel","nofollow"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,m){e(document.head,c),f(o,T,m),f(o,g,m),e(g,_),e(_,v),$(l,v,null),e(g,u),e(g,x),e(x,N),f(o,j,m),f(o,z,m),e(z,D),e(D,re),$(F,re,null),e(z,Ke),e(z,Z),e(Z,Je),f(o,je,m),f(o,W,m),e(W,Ge),e(W,ne),e(ne,ie),e(W,Xe),f(o,Ce,m),f(o,Q,m),e(Q,Qe),f(o,Ae,m),f(o,Y,m),e(Y,xe),e(xe,Ye),f(o,ve,m),f(o,A,m),e(A,L),f(o,ze,m),f(o,C,m),e(C,le),e(le,Ze),e(le,H),e(H,et),e(le,tt),e(C,O),e(C,Ve),e(Ve,de),e(C,ot),e(C,ce),e(ce,pe),e(ce,Te),e(Te,at),e(ce,ee),e(C,st),e(C,S),e(S,rt),e(S,he),e(he,R),e(S,nt),e(S,q),e(q,it),e(S,lt),e(C,b),e(C,P),e(P,Tt),e(P,te),e(te,bt),e(P,wt),e(P,M),e(M,yt),e(P,$t),e(C,kt),e(C,me),e(me,Et),e(me,U),e(U,fe),e(me,It),e(me,Fe),e(Fe,ue),e(me,xt),e(C,Vt),e(C,Pe),e(Pe,Ft),f(o,be,m),f(o,we,m),f(o,ui,m),f(o,Zo,m),e(Zo,Al),e(Zo,As),e(As,zl),f(o,gi,m),f(o,zs,m),e(zs,Nl),f(o,_i,m),f(o,Ne,m),e(Ne,Br),e(Br,B),e(B,Ns),e(Ns,ql),e(B,Dl),e(B,qs),e(qs,Ll),e(B,Ol),e(B,Ds),e(Ds,Sl),e(B,Rl),e(B,Hr),e(Hr,Ul),e(B,Wl),e(B,Kr),e(Kr,Bl),e(B,Hl),e(B,Jr),e(Jr,Kl),e(B,Jl),e(B,Gr),e(Gr,Gl),e(B,Xl),e(B,Ls),e(Ls,Ql),e(B,Yl),e(Ne,Zl),e(Ne,Xr),e(Xr,Os),e(Os,Ss),e(Ss,ed),e(Os,td),e(Ne,od),e(Ne,Qr),e(Qr,ea),e(ea,ad),e(ea,ta),e(ta,sd),e(ea,rd),e(Ne,nd),e(Ne,Yr),e(Yr,Rs),e(Rs,Us),e(Us,id),e(Rs,ld),f(o,vi,m),f(o,mt,m),e(mt,dd),e(mt,oa),e(oa,cd),e(mt,pd),e(mt,aa),e(aa,hd),e(mt,md),f(o,Ti,m),f(o,eo,m),e(eo,fd),e(eo,sa),e(sa,ud),e(eo,gd),f(o,bi,m),f(o,Pt,m),e(Pt,to),e(to,Zr),$(ra,Zr,null),e(Pt,_d),e(Pt,en),e(en,vd),f(o,wi,m),f(o,Ws,m),e(Ws,Td),f(o,yi,m),$(na,o,m),f(o,$i,m),f(o,qe,m),e(qe,ft),e(ft,Bs),e(Bs,bd),e(ft,wd),e(ft,ia),e(ia,yd),e(ft,$d),e(ft,la),e(la,kd),e(ft,Ed),e(qe,Id),e(qe,Mt),e(Mt,xd),e(Mt,Hs),e(Hs,Vd),e(Mt,Fd),e(Mt,da),e(da,Pd),e(Mt,Md),e(qe,jd),e(qe,jt),e(jt,Cd),e(jt,Ks),e(Ks,Ad),e(jt,zd),e(jt,ca),e(ca,Nd),e(jt,qd),e(qe,Dd),e(qe,tn),e(tn,Js),e(Js,Ld),f(o,ki,m),f(o,Gs,m),e(Gs,Od),f(o,Ei,m),f(o,Xs,m),e(Xs,oo),e(oo,Qs),e(Qs,Sd),e(oo,Rd),e(oo,pa),e(pa,Ud),e(oo,Wd),f(o,Ii,m),f(o,Ys,m),e(Ys,Bd),f(o,xi,m),f(o,Ct,m),e(Ct,ao),e(ao,on),$(ha,on,null),e(Ct,Hd),e(Ct,an),e(an,Kd),f(o,Vi,m),f(o,Zs,m),e(Zs,Jd),f(o,Fi,m),f(o,ma,m),e(ma,sn),e(sn,Gd),e(ma,Xd),f(o,Pi,m),$(fa,o,m),f(o,Mi,m),f(o,ye,m),e(ye,er),e(er,Qd),e(er,ua),e(ua,Yd),e(ye,Zd),e(ye,tr),e(tr,ec),e(tr,so),e(so,tc),e(so,rn),e(rn,oc),e(ye,ac),e(ye,or),e(or,sc),e(or,ga),e(ga,rc),e(ye,nc),e(ye,ar),e(ar,ic),e(ar,_a),e(_a,lc),e(ye,dc),e(ye,sr),e(sr,cc),e(sr,va),e(va,pc),f(o,ji,m),f(o,rr,m),e(rr,hc),f(o,Ci,m),f(o,nr,m),e(nr,ir),e(ir,mc),e(ir,Ta),e(Ta,fc),f(o,Ai,m),f(o,lr,m),e(lr,uc),f(o,zi,m),f(o,dr,m),e(dr,cr),e(cr,gc),e(cr,ba),e(ba,_c),f(o,Ni,m),f(o,pr,m),e(pr,vc),f(o,qi,m),f(o,ut,m),e(ut,hr),e(hr,Tc),e(hr,wa),e(wa,bc),e(ut,wc),e(ut,mr),e(mr,yc),e(mr,ya),e(ya,$c),e(ut,kc),e(ut,fr),e(fr,Ec),e(fr,$a),e($a,Ic),f(o,Di,m),f(o,At,m),e(At,ro),e(ro,nn),$(ka,nn,null),e(At,xc),e(At,ln),e(ln,Vc),f(o,Li,m),f(o,Me,m),$(Ea,Me,null),e(Me,Fc),e(Me,zt),e(zt,Pc),e(zt,ur),e(ur,Mc),e(zt,jc),e(zt,Ia),e(Ia,Cc),e(zt,Ac),e(Me,zc),e(Me,Nt),e(Nt,Nc),e(Nt,gr),e(gr,qc),e(Nt,Dc),e(Nt,_r),e(_r,Lc),e(Nt,Oc),e(Me,Sc),$(no,Me,null),f(o,Oi,m),f(o,qt,m),e(qt,io),e(io,dn),$(xa,dn,null),e(qt,Rc),e(qt,cn),e(cn,Uc),f(o,Si,m),f(o,Dt,m),$(Va,Dt,null),e(Dt,Wc),e(Dt,lo),$(Fa,lo,null),e(lo,Bc),e(lo,pn),e(pn,Hc),f(o,Ri,m),f(o,Lt,m),e(Lt,co),e(co,hn),$(Pa,hn,null),e(Lt,Kc),e(Lt,mn),e(mn,Jc),f(o,Ui,m),f(o,dt,m),$(Ma,dt,null),e(dt,Gc),e(dt,fn),e(fn,Xc),e(dt,Qc),e(dt,po),$(ja,po,null),e(po,Yc),e(po,un),e(un,Zc),f(o,Wi,m),f(o,Ot,m),e(Ot,ho),e(ho,gn),$(Ca,gn,null),e(Ot,ep),e(Ot,_n),e(_n,tp),f(o,Bi,m),f(o,ct,m),$(Aa,ct,null),e(ct,op),e(ct,za),e(za,ap),e(za,Na),e(Na,sp),e(za,rp),e(ct,np),e(ct,De),$(qa,De,null),e(De,ip),e(De,St),e(St,lp),e(St,vr),e(vr,dp),e(St,cp),e(St,vn),e(vn,pp),e(St,hp),e(De,mp),$(mo,De,null),e(De,fp),$(fo,De,null),f(o,Hi,m),f(o,Rt,m),e(Rt,uo),e(uo,Tn),$(Da,Tn,null),e(Rt,up),e(Rt,bn),e(bn,gp),f(o,Ki,m),f(o,ge,m),$(La,ge,null),e(ge,_p),e(ge,Oa),e(Oa,vp),e(Oa,Sa),e(Sa,Tp),e(Oa,bp),e(ge,wp),$(go,ge,null),e(ge,yp),e(ge,Ra),e(Ra,$p),e(Ra,Ua),e(Ua,kp),e(Ra,Ep),e(ge,Ip),e(ge,Le),$(Wa,Le,null),e(Le,xp),e(Le,Ut),e(Ut,Vp),e(Ut,Tr),e(Tr,Fp),e(Ut,Pp),e(Ut,wn),e(wn,Mp),e(Ut,jp),e(Le,Cp),$(_o,Le,null),e(Le,Ap),$(vo,Le,null),f(o,Ji,m),f(o,Wt,m),e(Wt,To),e(To,yn),$(Ba,yn,null),e(Wt,zp),e(Wt,$n),e($n,Np),f(o,Gi,m),f(o,_e,m),$(Ha,_e,null),e(_e,qp),e(_e,kn),e(kn,Dp),e(_e,Lp),$(bo,_e,null),e(_e,Op),e(_e,Ka),e(Ka,Sp),e(Ka,Ja),e(Ja,Rp),e(Ka,Up),e(_e,Wp),e(_e,Oe),$(Ga,Oe,null),e(Oe,Bp),e(Oe,Bt),e(Bt,Hp),e(Bt,br),e(br,Kp),e(Bt,Jp),e(Bt,En),e(En,Gp),e(Bt,Xp),e(Oe,Qp),$(wo,Oe,null),e(Oe,Yp),$(yo,Oe,null),f(o,Xi,m),f(o,Ht,m),e(Ht,$o),e($o,In),$(Xa,In,null),e(Ht,Zp),e(Ht,xn),e(xn,eh),f(o,Qi,m),f(o,oe,m),$(Qa,oe,null),e(oe,th),e(oe,Vn),e(Vn,oh),e(oe,ah),e(oe,Ya),e(Ya,sh),e(Ya,wr),e(wr,rh),e(Ya,nh),e(oe,ih),e(oe,Za),e(Za,lh),e(Za,es),e(es,dh),e(Za,ch),e(oe,ph),$(ko,oe,null),e(oe,hh),e(oe,Se),$(ts,Se,null),e(Se,mh),e(Se,Kt),e(Kt,fh),e(Kt,yr),e(yr,uh),e(Kt,gh),e(Kt,Fn),e(Fn,_h),e(Kt,vh),e(Se,Th),$(Eo,Se,null),e(Se,bh),$(Io,Se,null),f(o,Yi,m),f(o,Jt,m),e(Jt,xo),e(xo,Pn),$(os,Pn,null),e(Jt,wh),e(Jt,Mn),e(Mn,yh),f(o,Zi,m),f(o,K,m),$(as,K,null),e(K,$h),e(K,jn),e(jn,kh),e(K,Eh),$(Vo,K,null),e(K,Ih),e(K,ss),e(ss,xh),e(ss,$r),e($r,Vh),e(ss,Fh),e(K,Ph),e(K,rs),e(rs,Mh),e(rs,ns),e(ns,jh),e(rs,Ch),e(K,Ah),$(Fo,K,null),e(K,zh),e(K,Re),$(is,Re,null),e(Re,Nh),e(Re,Gt),e(Gt,qh),e(Gt,kr),e(kr,Dh),e(Gt,Lh),e(Gt,Cn),e(Cn,Oh),e(Gt,Sh),e(Re,Rh),$(Po,Re,null),e(Re,Uh),$(Mo,Re,null),f(o,el,m),f(o,Xt,m),e(Xt,jo),e(jo,An),$(ls,An,null),e(Xt,Wh),e(Xt,zn),e(zn,Bh),f(o,tl,m),f(o,J,m),$(ds,J,null),e(J,Hh),e(J,Nn),e(Nn,Kh),e(J,Jh),e(J,cs),e(cs,Gh),e(cs,Er),e(Er,Xh),e(cs,Qh),e(J,Yh),e(J,ps),e(ps,Zh),e(ps,hs),e(hs,em),e(ps,tm),e(J,om),e(J,qn),e(qn,am),e(J,sm),e(J,pt),e(pt,Dn),e(Dn,ms),e(ms,rm),e(pt,nm),e(pt,Ln),e(Ln,fs),e(fs,im),e(pt,lm),e(pt,On),e(On,us),e(us,dm),e(pt,cm),e(pt,Sn),e(Sn,gs),e(gs,pm),e(J,hm),e(J,Ue),$(_s,Ue,null),e(Ue,mm),e(Ue,Qt),e(Qt,fm),e(Qt,Rn),e(Rn,um),e(Qt,gm),e(Qt,Un),e(Un,_m),e(Qt,vm),e(Ue,Tm),$(Co,Ue,null),e(Ue,bm),$(Ao,Ue,null),f(o,ol,m),f(o,Yt,m),e(Yt,zo),e(zo,Wn),$(vs,Wn,null),e(Yt,wm),e(Yt,Bn),e(Bn,ym),f(o,al,m),f(o,G,m),$(Ts,G,null),e(G,$m),e(G,Hn),e(Hn,km),e(G,Em),e(G,bs),e(bs,Im),e(bs,Ir),e(Ir,xm),e(bs,Vm),e(G,Fm),e(G,ws),e(ws,Pm),e(ws,ys),e(ys,Mm),e(ws,jm),e(G,Cm),e(G,Kn),e(Kn,Am),e(G,zm),e(G,ht),e(ht,Jn),e(Jn,$s),e($s,Nm),e(ht,qm),e(ht,Gn),e(Gn,ks),e(ks,Dm),e(ht,Lm),e(ht,Xn),e(Xn,Es),e(Es,Om),e(ht,Sm),e(ht,Qn),e(Qn,Is),e(Is,Rm),e(G,Um),e(G,We),$(xs,We,null),e(We,Wm),e(We,Zt),e(Zt,Bm),e(Zt,Yn),e(Yn,Hm),e(Zt,Km),e(Zt,Zn),e(Zn,Jm),e(Zt,Gm),e(We,Xm),$(No,We,null),e(We,Qm),$(qo,We,null),sl=!0},p(o,[m]){const Vs={};m&2&&(Vs.$$scope={dirty:m,ctx:o}),no.$set(Vs);const ei={};m&2&&(ei.$$scope={dirty:m,ctx:o}),mo.$set(ei);const ti={};m&2&&(ti.$$scope={dirty:m,ctx:o}),fo.$set(ti);const oi={};m&2&&(oi.$$scope={dirty:m,ctx:o}),go.$set(oi);const Fs={};m&2&&(Fs.$$scope={dirty:m,ctx:o}),_o.$set(Fs);const ai={};m&2&&(ai.$$scope={dirty:m,ctx:o}),vo.$set(ai);const si={};m&2&&(si.$$scope={dirty:m,ctx:o}),bo.$set(si);const ri={};m&2&&(ri.$$scope={dirty:m,ctx:o}),wo.$set(ri);const Ps={};m&2&&(Ps.$$scope={dirty:m,ctx:o}),yo.$set(Ps);const ni={};m&2&&(ni.$$scope={dirty:m,ctx:o}),ko.$set(ni);const ii={};m&2&&(ii.$$scope={dirty:m,ctx:o}),Eo.$set(ii);const li={};m&2&&(li.$$scope={dirty:m,ctx:o}),Io.$set(li);const di={};m&2&&(di.$$scope={dirty:m,ctx:o}),Vo.$set(di);const ci={};m&2&&(ci.$$scope={dirty:m,ctx:o}),Fo.$set(ci);const ae={};m&2&&(ae.$$scope={dirty:m,ctx:o}),Po.$set(ae);const Ms={};m&2&&(Ms.$$scope={dirty:m,ctx:o}),Mo.$set(Ms);const pi={};m&2&&(pi.$$scope={dirty:m,ctx:o}),Co.$set(pi);const hi={};m&2&&(hi.$$scope={dirty:m,ctx:o}),Ao.$set(hi);const js={};m&2&&(js.$$scope={dirty:m,ctx:o}),No.$set(js);const mi={};m&2&&(mi.$$scope={dirty:m,ctx:o}),qo.$set(mi)},i(o){sl||(k(l.$$.fragment,o),k(F.$$.fragment,o),k(ra.$$.fragment,o),k(na.$$.fragment,o),k(ha.$$.fragment,o),k(fa.$$.fragment,o),k(ka.$$.fragment,o),k(Ea.$$.fragment,o),k(no.$$.fragment,o),k(xa.$$.fragment,o),k(Va.$$.fragment,o),k(Fa.$$.fragment,o),k(Pa.$$.fragment,o),k(Ma.$$.fragment,o),k(ja.$$.fragment,o),k(Ca.$$.fragment,o),k(Aa.$$.fragment,o),k(qa.$$.fragment,o),k(mo.$$.fragment,o),k(fo.$$.fragment,o),k(Da.$$.fragment,o),k(La.$$.fragment,o),k(go.$$.fragment,o),k(Wa.$$.fragment,o),k(_o.$$.fragment,o),k(vo.$$.fragment,o),k(Ba.$$.fragment,o),k(Ha.$$.fragment,o),k(bo.$$.fragment,o),k(Ga.$$.fragment,o),k(wo.$$.fragment,o),k(yo.$$.fragment,o),k(Xa.$$.fragment,o),k(Qa.$$.fragment,o),k(ko.$$.fragment,o),k(ts.$$.fragment,o),k(Eo.$$.fragment,o),k(Io.$$.fragment,o),k(os.$$.fragment,o),k(as.$$.fragment,o),k(Vo.$$.fragment,o),k(Fo.$$.fragment,o),k(is.$$.fragment,o),k(Po.$$.fragment,o),k(Mo.$$.fragment,o),k(ls.$$.fragment,o),k(ds.$$.fragment,o),k(_s.$$.fragment,o),k(Co.$$.fragment,o),k(Ao.$$.fragment,o),k(vs.$$.fragment,o),k(Ts.$$.fragment,o),k(xs.$$.fragment,o),k(No.$$.fragment,o),k(qo.$$.fragment,o),sl=!0)},o(o){E(l.$$.fragment,o),E(F.$$.fragment,o),E(ra.$$.fragment,o),E(na.$$.fragment,o),E(ha.$$.fragment,o),E(fa.$$.fragment,o),E(ka.$$.fragment,o),E(Ea.$$.fragment,o),E(no.$$.fragment,o),E(xa.$$.fragment,o),E(Va.$$.fragment,o),E(Fa.$$.fragment,o),E(Pa.$$.fragment,o),E(Ma.$$.fragment,o),E(ja.$$.fragment,o),E(Ca.$$.fragment,o),E(Aa.$$.fragment,o),E(qa.$$.fragment,o),E(mo.$$.fragment,o),E(fo.$$.fragment,o),E(Da.$$.fragment,o),E(La.$$.fragment,o),E(go.$$.fragment,o),E(Wa.$$.fragment,o),E(_o.$$.fragment,o),E(vo.$$.fragment,o),E(Ba.$$.fragment,o),E(Ha.$$.fragment,o),E(bo.$$.fragment,o),E(Ga.$$.fragment,o),E(wo.$$.fragment,o),E(yo.$$.fragment,o),E(Xa.$$.fragment,o),E(Qa.$$.fragment,o),E(ko.$$.fragment,o),E(ts.$$.fragment,o),E(Eo.$$.fragment,o),E(Io.$$.fragment,o),E(os.$$.fragment,o),E(as.$$.fragment,o),E(Vo.$$.fragment,o),E(Fo.$$.fragment,o),E(is.$$.fragment,o),E(Po.$$.fragment,o),E(Mo.$$.fragment,o),E(ls.$$.fragment,o),E(ds.$$.fragment,o),E(_s.$$.fragment,o),E(Co.$$.fragment,o),E(Ao.$$.fragment,o),E(vs.$$.fragment,o),E(Ts.$$.fragment,o),E(xs.$$.fragment,o),E(No.$$.fragment,o),E(qo.$$.fragment,o),sl=!1},d(o){t(c),o&&t(T),o&&t(g),I(l),o&&t(j),o&&t(z),I(F),o&&t(je),o&&t(W),o&&t(Ce),o&&t(Q),o&&t(Ae),o&&t(Y),o&&t(ve),o&&t(A),o&&t(ze),o&&t(C),o&&t(be),o&&t(we),o&&t(ui),o&&t(Zo),o&&t(gi),o&&t(zs),o&&t(_i),o&&t(Ne),o&&t(vi),o&&t(mt),o&&t(Ti),o&&t(eo),o&&t(bi),o&&t(Pt),I(ra),o&&t(wi),o&&t(Ws),o&&t(yi),I(na,o),o&&t($i),o&&t(qe),o&&t(ki),o&&t(Gs),o&&t(Ei),o&&t(Xs),o&&t(Ii),o&&t(Ys),o&&t(xi),o&&t(Ct),I(ha),o&&t(Vi),o&&t(Zs),o&&t(Fi),o&&t(ma),o&&t(Pi),I(fa,o),o&&t(Mi),o&&t(ye),o&&t(ji),o&&t(rr),o&&t(Ci),o&&t(nr),o&&t(Ai),o&&t(lr),o&&t(zi),o&&t(dr),o&&t(Ni),o&&t(pr),o&&t(qi),o&&t(ut),o&&t(Di),o&&t(At),I(ka),o&&t(Li),o&&t(Me),I(Ea),I(no),o&&t(Oi),o&&t(qt),I(xa),o&&t(Si),o&&t(Dt),I(Va),I(Fa),o&&t(Ri),o&&t(Lt),I(Pa),o&&t(Ui),o&&t(dt),I(Ma),I(ja),o&&t(Wi),o&&t(Ot),I(Ca),o&&t(Bi),o&&t(ct),I(Aa),I(qa),I(mo),I(fo),o&&t(Hi),o&&t(Rt),I(Da),o&&t(Ki),o&&t(ge),I(La),I(go),I(Wa),I(_o),I(vo),o&&t(Ji),o&&t(Wt),I(Ba),o&&t(Gi),o&&t(_e),I(Ha),I(bo),I(Ga),I(wo),I(yo),o&&t(Xi),o&&t(Ht),I(Xa),o&&t(Qi),o&&t(oe),I(Qa),I(ko),I(ts),I(Eo),I(Io),o&&t(Yi),o&&t(Jt),I(os),o&&t(Zi),o&&t(K),I(as),I(Vo),I(Fo),I(is),I(Po),I(Mo),o&&t(el),o&&t(Xt),I(ls),o&&t(tl),o&&t(J),I(ds),I(_s),I(Co),I(Ao),o&&t(ol),o&&t(Yt),I(vs),o&&t(al),o&&t(G),I(Ts),I(xs),I(No),I(qo)}}}const j_={local:"vision-transformer-vit",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"resources",title:"Resources"},{local:"transformers.ViTConfig",title:"ViTConfig"},{local:"transformers.ViTFeatureExtractor",title:"ViTFeatureExtractor"},{local:"transformers.ViTImageProcessor",title:"ViTImageProcessor"},{local:"transformers.ViTModel",title:"ViTModel"},{local:"transformers.ViTForMaskedImageModeling",title:"ViTForMaskedImageModeling"},{local:"transformers.ViTForImageClassification",title:"ViTForImageClassification"},{local:"transformers.TFViTModel",title:"TFViTModel"},{local:"transformers.TFViTForImageClassification",title:"TFViTForImageClassification"},{local:"transformers.FlaxViTModel",title:"FlaxVitModel"},{local:"transformers.FlaxViTForImageClassification",title:"FlaxViTForImageClassification"}],title:"Vision Transformer (ViT)"};function C_(V){return c_(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class S_ extends r_{constructor(c){super();n_(this,c,C_,M_,i_,{})}}export{S_ as default,j_ as metadata};
