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