import{S as op,i as sp,s as ap,e as a,k as p,w as v,t as i,M as rp,c as r,d as o,m as h,a as n,x as w,h as l,b as c,G as e,g as _,y as $,q as y,o as k,B as D,v as np,L as Ae}from"../../chunks/vendor-hf-doc-builder.js";import{T as re}from"../../chunks/Tip-hf-doc-builder.js";import{D as M}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ze}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as z}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ce}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ip}from"../../chunks/PipelineTag-hf-doc-builder.js";function lp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i(`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),g=a("a"),f=i("Github Issue"),T=i("."),this.h()},l(s){d=r(s,"P",{});var m=n(d);b=l(m,`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),g=r(m,"A",{href:!0,rel:!0});var F=n(g);f=l(F,"Github Issue"),F.forEach(o),T=l(m,"."),m.forEach(o),this.h()},h(){c(g,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),c(g,"rel","nofollow")},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function dp(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import DeiTConfig, DeiTModel

# Initializing a DeiT deit-base-distilled-patch16-224 style configuration
configuration = DeiTConfig()

# Initializing a model (with random weights) from the deit-base-distilled-patch16-224 style configuration
model = DeiTModel(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> DeiTConfig, DeiTModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a DeiT deit-base-distilled-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = DeiTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the deit-base-distilled-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTModel(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(){d=a("p"),b=i("Example:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Example:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function cp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function mp(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, DeiTModel
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = DeiTModel.from_pretrained("facebook/deit-base-distilled-patch16-224")

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, DeiTModel
<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;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTModel.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-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>    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">198</span>, <span class="hljs-number">768</span>]`}}),{c(){d=a("p"),b=i("Example:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Example:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function pp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Note that we provide a script to pre-train this model on custom data in our "),g=a("a"),f=i(`examples
directory`),T=i("."),this.h()},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Note that we provide a script to pre-train this model on custom data in our "),g=r(m,"A",{href:!0,rel:!0});var F=n(g);f=l(F,`examples
directory`),F.forEach(o),T=l(m,"."),m.forEach(o),this.h()},h(){c(g,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(g,"rel","nofollow")},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function hp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function fp(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, DeiTForMaskedImageModeling
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("facebook/deit-base-distilled-patch16-224")
model = DeiTForMaskedImageModeling.from_pretrained("facebook/deit-base-distilled-patch16-224")

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, DeiTForMaskedImageModeling
<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;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&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(){d=a("p"),b=i("Examples:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Examples:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function gp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function up(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, DeiTForImageClassification
import torch
from PIL import Image
import requests

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

# note: we are loading a DeiTForImageClassificationWithTeacher from the hub here,
# so the head will be randomly initialized, hence the predictions will be random
image_processor = AutoImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = DeiTForImageClassification.from_pretrained("facebook/deit-base-distilled-patch16-224")

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DeiTForImageClassification
<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>torch.manual_seed(<span class="hljs-number">3</span>)
<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><span class="hljs-comment"># note: we are loading a DeiTForImageClassificationWithTeacher from the hub here,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># so the head will be randomly initialized, hence the predictions will be random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&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 = logits.argmax(-<span class="hljs-number">1</span>).item()
<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])
Predicted <span class="hljs-keyword">class</span>: magpie`}}),{c(){d=a("p"),b=i("Examples:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Examples:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function _p(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function Tp(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, DeiTForImageClassificationWithTeacher
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = DeiTForImageClassificationWithTeacher.from_pretrained("facebook/deit-base-distilled-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, DeiTForImageClassificationWithTeacher
<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;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-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])
tabby, tabby cat`}}),{c(){d=a("p"),b=i("Example:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Example:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function bp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function vp(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, TFDeiTModel
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = TFDeiTModel.from_pretrained("facebook/deit-base-distilled-patch16-224")

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, TFDeiTModel
<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;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTModel.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-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>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">198</span>, <span class="hljs-number">768</span>]`}}),{c(){d=a("p"),b=i("Example:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Example:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function wp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function $p(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, TFDeiTForMaskedImageModeling
import tensorflow as tf
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("facebook/deit-base-distilled-patch16-224")
model = TFDeiTForMaskedImageModeling.from_pretrained("facebook/deit-base-distilled-patch16-224")

num_patches = (model.config.image_size // model.config.patch_size) ** 2
pixel_values = image_processor(images=image, return_tensors="tf").pixel_values
# create random boolean mask of shape (batch_size, num_patches)
bool_masked_pos = tf.cast(tf.random.uniform((1, num_patches), minval=0, maxval=2, dtype=tf.int32), tf.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, TFDeiTForMaskedImageModeling
<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> 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;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&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;tf&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 = tf.cast(tf.random.uniform((<span class="hljs-number">1</span>, num_patches), minval=<span class="hljs-number">0</span>, maxval=<span class="hljs-number">2</span>, dtype=tf.int32), tf.<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(){d=a("p"),b=i("Examples:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Examples:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function yp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function kp(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, TFDeiTForImageClassification
import tensorflow as tf
from PIL import Image
import requests

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

# note: we are loading a TFDeiTForImageClassificationWithTeacher from the hub here,
# so the head will be randomly initialized, hence the predictions will be random
image_processor = AutoImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = TFDeiTForImageClassification.from_pretrained("facebook/deit-base-distilled-patch16-224")

inputs = image_processor(images=image, return_tensors="tf")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = tf.math.argmax(logits, axis=-1)[0]
print("Predicted class:", model.config.id2label[int(predicted_class_idx)])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFDeiTForImageClassification
<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> 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>tf.keras.utils.set_random_seed(<span class="hljs-number">3</span>)
<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><span class="hljs-comment"># note: we are loading a TFDeiTForImageClassificationWithTeacher from the hub here,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># so the head will be randomly initialized, hence the predictions will be random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=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>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 = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</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[<span class="hljs-built_in">int</span>(predicted_class_idx)])
Predicted <span class="hljs-keyword">class</span>: little blue heron, Egretta caerulea`}}),{c(){d=a("p"),b=i("Examples:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Examples:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function Dp(I){let d,b,g,f,T;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=i("Module"),T=i(`
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(s){d=r(s,"P",{});var m=n(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=n(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(s,m){_(s,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(s){s&&o(d)}}}function Ip(I){let d,b,g,f,T;return f=new ze({props:{code:`from transformers import AutoImageProcessor, TFDeiTForImageClassificationWithTeacher
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("facebook/deit-base-distilled-patch16-224")
model = TFDeiTForImageClassificationWithTeacher.from_pretrained("facebook/deit-base-distilled-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, TFDeiTForImageClassificationWithTeacher
<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;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-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])
tabby, tabby cat`}}),{c(){d=a("p"),b=i("Example:"),g=p(),v(f.$$.fragment)},l(s){d=r(s,"P",{});var m=n(d);b=l(m,"Example:"),m.forEach(o),g=h(s),w(f.$$.fragment,s)},m(s,m){_(s,d,m),e(d,b),_(s,g,m),$(f,s,m),T=!0},p:Ae,i(s){T||(y(f.$$.fragment,s),T=!0)},o(s){k(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(g),D(f,s)}}}function Fp(I){let d,b,g,f,T,s,m,F,Kr,Va,qe,Ra,ne,Ne,Ms,Mt,Yr,xs,Xr,Ha,L,Qr,xt,Zr,en,Wo,tn,on,jt,sn,an,Ua,Lo,rn,Ba,So,js,nn,Ja,Vo,ln,Ga,A,Ps,dn,cn,ie,mn,Ro,pn,hn,Ho,fn,gn,un,Es,_n,Tn,Cs,bn,vn,x,wn,Uo,$n,yn,Bo,kn,Dn,As,In,Fn,zs,Mn,xn,qs,jn,Pn,Ns,En,Cn,Jo,An,zn,Ka,oe,qn,Pt,Nn,On,Et,Wn,Ln,Ya,le,Oe,Os,Ct,Sn,Ws,Vn,Xa,Go,Rn,Qa,At,Za,Ko,se,Yo,Hn,Un,zt,Bn,Jn,qt,Gn,Kn,er,Xo,Yn,tr,Qo,We,Zo,Xn,Qn,Nt,Zn,ei,or,es,ti,sr,de,Le,Ls,Ot,oi,Ss,si,ar,q,Wt,ai,ce,ri,ts,ni,ii,Lt,li,di,ci,me,mi,os,pi,hi,ss,fi,gi,ui,Se,rr,pe,Ve,Vs,St,_i,Rs,Ti,nr,he,Vt,bi,Re,Rt,vi,Hs,wi,ir,fe,He,Us,Ht,$i,Bs,yi,lr,X,Ut,ki,Js,Di,Ii,Ue,Bt,Fi,Gs,Mi,dr,ge,Be,Ks,Jt,xi,Ys,ji,cr,Q,Gt,Pi,Kt,Ei,Yt,Ci,Ai,zi,S,Xt,qi,ue,Ni,as,Oi,Wi,Xs,Li,Si,Vi,Je,Ri,Ge,mr,_e,Ke,Qs,Qt,Hi,Zs,Ui,pr,C,Zt,Bi,eo,Ji,to,Gi,Ki,Yi,Ye,Xi,oo,Qi,so,Zi,el,tl,V,ao,ol,Te,sl,rs,al,rl,ea,nl,il,ll,Xe,dl,Qe,hr,be,Ze,ta,ro,cl,oa,ml,fr,N,no,pl,sa,hl,fl,io,gl,lo,ul,_l,Tl,R,co,bl,ve,vl,ns,wl,$l,aa,yl,kl,Dl,et,Il,tt,gr,we,ot,ra,mo,Fl,na,Ml,ur,j,po,xl,ia,jl,Pl,la,El,Cl,da,Al,zl,ho,ql,fo,Nl,Ol,Wl,H,go,Ll,$e,Sl,is,Vl,Rl,ca,Hl,Ul,Bl,st,Jl,at,_r,ye,rt,ma,uo,Gl,pa,Kl,Tr,Z,_o,Yl,To,Xl,bo,Ql,Zl,ed,U,vo,td,ke,od,ls,sd,ad,ha,rd,nd,id,nt,ld,it,br,De,lt,fa,wo,dd,ga,cd,vr,ee,$o,md,Ie,pd,yo,hd,fd,ko,gd,ud,_d,B,Do,Td,Fe,bd,ds,vd,wd,ua,$d,yd,kd,dt,Dd,ct,wr,Me,mt,_a,Io,Id,Ta,Fd,$r,O,Fo,Md,ba,xd,jd,Mo,Pd,xo,Ed,Cd,Ad,J,jo,zd,xe,qd,cs,Nd,Od,va,Wd,Ld,Sd,pt,Vd,ht,yr,je,ft,wa,Po,Rd,$a,Hd,kr,P,Eo,Ud,ya,Bd,Jd,ka,Gd,Kd,Da,Yd,Xd,Co,Qd,Ao,Zd,ec,tc,G,zo,oc,Pe,sc,ms,ac,rc,Ia,nc,ic,lc,gt,dc,ut,Dr;return s=new z({}),qe=new re({props:{$$slots:{default:[lp]},$$scope:{ctx:I}}}),Mt=new z({}),Ct=new z({}),At=new ip({props:{pipeline:"image-classification"}}),Ot=new z({}),Wt=new M({props:{name:"class transformers.DeiTConfig",anchor:"transformers.DeiTConfig",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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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.DeiTConfig.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/deit/configuration_deit.py#L37"}}),Se=new Ce({props:{anchor:"transformers.DeiTConfig.example",$$slots:{default:[dp]},$$scope:{ctx:I}}}),St=new z({}),Vt=new M({props:{name:"class transformers.DeiTFeatureExtractor",anchor:"transformers.DeiTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/feature_extraction_deit.py#L26"}}),Rt=new M({props:{name:"__call__",anchor:"transformers.DeiTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L448"}}),Ht=new z({}),Ut=new M({props:{name:"class transformers.DeiTImageProcessor",anchor:"transformers.DeiTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = 3"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_rescale",val:": bool = True"},{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.DeiTImageProcessor.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</code>. Can be overridden by
<code>do_resize</code> in <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.DeiTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Size of the image after <code>resize</code>. Can be overridden by <code>size</code> in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.DeiTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in <code>preprocess</code>.`,name:"resample"},{anchor:"transformers.DeiTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the image
is padded with 0&#x2019;s and then center cropped. Can be overridden by <code>do_center_crop</code> in <code>preprocess</code>.`,name:"do_center_crop"},{anchor:"transformers.DeiTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size when applying center-cropping. Can be overridden by <code>crop_size</code> in <code>preprocess</code>.`,name:"crop_size"},{anchor:"transformers.DeiTImageProcessor.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.DeiTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.DeiTImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.DeiTImageProcessor.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.DeiTImageProcessor.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/deit/image_processing_deit.py#L46"}}),Bt=new M({props:{name:"preprocess",anchor:"transformers.DeiTImageProcessor.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:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:" = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": 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:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DeiTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.DeiTImageProcessor.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.DeiTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after <code>resize</code>.`,name:"size"},{anchor:"transformers.DeiTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
PILImageResampling filter to use if resizing the image Only has an effect if <code>do_resize</code> is set to
<code>True</code>.`,name:"resample"},{anchor:"transformers.DeiTImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.DeiTImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the image after center crop. If one edge the image is smaller than <code>crop_size</code>, it will be
padded with zeros and then cropped`,name:"crop_size"},{anchor:"transformers.DeiTImageProcessor.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.DeiTImageProcessor.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.DeiTImageProcessor.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.DeiTImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.DeiTImageProcessor.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.`,name:"image_std"},{anchor:"transformers.DeiTImageProcessor.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><code>None</code>: 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.DeiTImageProcessor.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>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/image_processing_deit.py#L208"}}),Jt=new z({}),Gt=new M({props:{name:"class transformers.DeiTModel",anchor:"transformers.DeiTModel",parameters:[{name:"config",val:": DeiTConfig"},{name:"add_pooling_layer",val:": bool = True"},{name:"use_mask_token",val:": bool = False"}],parametersDescription:[{anchor:"transformers.DeiTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_deit.py#L458"}}),Xt=new M({props:{name:"forward",anchor:"transformers.DeiTModel.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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTModel.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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTModel.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.DeiTModel.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.DeiTModel.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.DeiTModel.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/deit/modeling_deit.py#L483",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/deit#transformers.DeiTConfig"
>DeiTConfig</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>
`}}),Je=new re({props:{$$slots:{default:[cp]},$$scope:{ctx:I}}}),Ge=new Ce({props:{anchor:"transformers.DeiTModel.forward.example",$$slots:{default:[mp]},$$scope:{ctx:I}}}),Qt=new z({}),Zt=new M({props:{name:"class transformers.DeiTForMaskedImageModeling",anchor:"transformers.DeiTForMaskedImageModeling",parameters:[{name:"config",val:": DeiTConfig"}],parametersDescription:[{anchor:"transformers.DeiTForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_deit.py#L574"}}),Ye=new re({props:{$$slots:{default:[pp]},$$scope:{ctx:I}}}),ao=new M({props:{name:"forward",anchor:"transformers.DeiTForMaskedImageModeling.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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTForMaskedImageModeling.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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForMaskedImageModeling.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.DeiTForMaskedImageModeling.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.DeiTForMaskedImageModeling.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.DeiTForMaskedImageModeling.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.DeiTForMaskedImageModeling.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/deit/modeling_deit.py#L592",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/deit#transformers.DeiTConfig"
>DeiTConfig</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>
`}}),Xe=new re({props:{$$slots:{default:[hp]},$$scope:{ctx:I}}}),Qe=new Ce({props:{anchor:"transformers.DeiTForMaskedImageModeling.forward.example",$$slots:{default:[fp]},$$scope:{ctx:I}}}),ro=new z({}),no=new M({props:{name:"class transformers.DeiTForImageClassification",anchor:"transformers.DeiTForImageClassification",parameters:[{name:"config",val:": DeiTConfig"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_deit.py#L686"}}),co=new M({props:{name:"forward",anchor:"transformers.DeiTForImageClassification.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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassification.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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForImageClassification.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.DeiTForImageClassification.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.DeiTForImageClassification.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.DeiTForImageClassification.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.DeiTForImageClassification.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/deit/modeling_deit.py#L699",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/deit#transformers.DeiTConfig"
>DeiTConfig</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>
`}}),et=new re({props:{$$slots:{default:[gp]},$$scope:{ctx:I}}}),tt=new Ce({props:{anchor:"transformers.DeiTForImageClassification.forward.example",$$slots:{default:[up]},$$scope:{ctx:I}}}),mo=new z({}),po=new M({props:{name:"class transformers.DeiTForImageClassificationWithTeacher",anchor:"transformers.DeiTForImageClassificationWithTeacher",parameters:[{name:"config",val:": DeiTConfig"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_deit.py#L835"}}),go=new M({props:{name:"forward",anchor:"transformers.DeiTForImageClassificationWithTeacher.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = 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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassificationWithTeacher.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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.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.DeiTForImageClassificationWithTeacher.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.DeiTForImageClassificationWithTeacher.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.DeiTForImageClassificationWithTeacher.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/deit/modeling_deit.py#L853",returnDescription:`
<p>A <code>transformers.models.deit.modeling_deit.DeiTForImageClassificationWithTeacherOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores as the average of the cls_logits and distillation logits.</li>
<li><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).</li>
<li><strong>distillation_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</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>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deit.modeling_deit.DeiTForImageClassificationWithTeacherOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new re({props:{$$slots:{default:[_p]},$$scope:{ctx:I}}}),at=new Ce({props:{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.example",$$slots:{default:[Tp]},$$scope:{ctx:I}}}),uo=new z({}),_o=new M({props:{name:"class transformers.TFDeiTModel",anchor:"transformers.TFDeiTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_tf_deit.py#L640"}}),vo=new M({props:{name:"call",anchor:"transformers.TFDeiTModel.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTModel.call.head_mask",description:`<strong>head_mask</strong> (<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.TFDeiTModel.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.`,name:"output_attentions"},{anchor:"transformers.TFDeiTModel.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.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTModel.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.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L650",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/deit#transformers.DeiTConfig"
>DeiTConfig</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>
`}}),nt=new re({props:{$$slots:{default:[bp]},$$scope:{ctx:I}}}),it=new Ce({props:{anchor:"transformers.TFDeiTModel.call.example",$$slots:{default:[vp]},$$scope:{ctx:I}}}),wo=new z({}),$o=new M({props:{name:"class transformers.TFDeiTForMaskedImageModeling",anchor:"transformers.TFDeiTForMaskedImageModeling",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_tf_deit.py#L759"}}),Do=new M({props:{name:"call",anchor:"transformers.TFDeiTForMaskedImageModeling.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTForMaskedImageModeling.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.head_mask",description:`<strong>head_mask</strong> (<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.TFDeiTForMaskedImageModeling.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.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForMaskedImageModeling.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.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForMaskedImageModeling.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.`,name:"return_dict"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>tf.Tensor</code> of type bool and 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/deit/modeling_tf_deit.py#L766",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</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/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(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.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),dt=new re({props:{$$slots:{default:[wp]},$$scope:{ctx:I}}}),ct=new Ce({props:{anchor:"transformers.TFDeiTForMaskedImageModeling.call.example",$$slots:{default:[$p]},$$scope:{ctx:I}}}),Io=new z({}),Fo=new M({props:{name:"class transformers.TFDeiTForImageClassification",anchor:"transformers.TFDeiTForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_tf_deit.py#L880"}}),jo=new M({props:{name:"call",anchor:"transformers.TFDeiTForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForImageClassification.call.head_mask",description:`<strong>head_mask</strong> (<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.TFDeiTForImageClassification.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.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForImageClassification.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.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForImageClassification.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.`,name:"return_dict"},{anchor:"transformers.TFDeiTForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L894",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> 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/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</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>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, 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(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, 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><code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),pt=new re({props:{$$slots:{default:[yp]},$$scope:{ctx:I}}}),ht=new Ce({props:{anchor:"transformers.TFDeiTForImageClassification.call.example",$$slots:{default:[kp]},$$scope:{ctx:I}}}),Po=new z({}),Eo=new M({props:{name:"class transformers.TFDeiTForImageClassificationWithTeacher",anchor:"transformers.TFDeiTForImageClassificationWithTeacher",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</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/deit/modeling_tf_deit.py#L988"}}),zo=new M({props:{name:"call",anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.head_mask",description:`<strong>head_mask</strong> (<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.TFDeiTForImageClassificationWithTeacher.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.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.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.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.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.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L1007",returnDescription:`
<p>A <code>transformers.models.deit.modeling_tf_deit.TFDeiTForImageClassificationWithTeacherOutput</code> 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/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores as the average of the cls_logits and distillation logits.</li>
<li><strong>cls_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).</li>
<li><strong>distillation_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).</li>
<li><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>. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deit.modeling_tf_deit.TFDeiTForImageClassificationWithTeacherOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),gt=new re({props:{$$slots:{default:[Dp]},$$scope:{ctx:I}}}),ut=new Ce({props:{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.example",$$slots:{default:[Ip]},$$scope:{ctx:I}}}),{c(){d=a("meta"),b=p(),g=a("h1"),f=a("a"),T=a("span"),v(s.$$.fragment),m=p(),F=a("span"),Kr=i("DeiT"),Va=p(),v(qe.$$.fragment),Ra=p(),ne=a("h2"),Ne=a("a"),Ms=a("span"),v(Mt.$$.fragment),Yr=p(),xs=a("span"),Xr=i("Overview"),Ha=p(),L=a("p"),Qr=i("The DeiT model was proposed in "),xt=a("a"),Zr=i("Training data-efficient image transformers & distillation through attention"),en=i(` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),Wo=a("a"),tn=i("Vision Transformer (ViT)"),on=i(" introduced in "),jt=a("a"),sn=i("Dosovitskiy et al., 2020"),an=i(` has shown that one can match or even outperform existing convolutional neural
networks using a Transformer encoder (BERT-like). However, the ViT models introduced in that paper required training on
expensive infrastructure for multiple weeks, using external data. DeiT (data-efficient image transformers) are more
efficiently trained transformers for image classification, requiring far less data and far less computing resources
compared to the original ViT models.`),Ua=p(),Lo=a("p"),rn=i("The abstract from the paper is the following:"),Ba=p(),So=a("p"),js=a("em"),nn=i(`Recently, neural networks purely based on attention were shown to address image understanding tasks such as image
classification. However, these visual transformers are pre-trained with hundreds of millions of images using an
expensive infrastructure, thereby limiting their adoption. In this work, we produce a competitive convolution-free
transformer by training on Imagenet only. We train them on a single computer in less than 3 days. Our reference vision
transformer (86M parameters) achieves top-1 accuracy of 83.1% (single-crop evaluation) on ImageNet with no external
data. More importantly, we introduce a teacher-student strategy specific to transformers. It relies on a distillation
token ensuring that the student learns from the teacher through attention. We show the interest of this token-based
distillation, especially when using a convnet as a teacher. This leads us to report results competitive with convnets
for both Imagenet (where we obtain up to 85.2% accuracy) and when transferring to other tasks. We share our code and
models.`),Ja=p(),Vo=a("p"),ln=i("Tips:"),Ga=p(),A=a("ul"),Ps=a("li"),dn=i(`Compared to ViT, DeiT models use a so-called distillation token to effectively learn from a teacher (which, in the
DeiT paper, is a ResNet like-model). The distillation token is learned through backpropagation, by interacting with
the class ([CLS]) and patch tokens through the self-attention layers.`),cn=p(),ie=a("li"),mn=i(`There are 2 ways to fine-tune distilled models, either (1) in a classic way, by only placing a prediction head on top
of the final hidden state of the class token and not using the distillation signal, or (2) by placing both a
prediction head on top of the class token and on top of the distillation token. In that case, the [CLS] prediction
head is trained using regular cross-entropy between the prediction of the head and the ground-truth label, while the
distillation prediction head is trained using hard distillation (cross-entropy between the prediction of the
distillation head and the label predicted by the teacher). At inference time, one takes the average prediction
between both heads as final prediction. (2) is also called \u201Cfine-tuning with distillation\u201D, because one relies on a
teacher that has already been fine-tuned on the downstream dataset. In terms of models, (1) corresponds to
`),Ro=a("a"),pn=i("DeiTForImageClassification"),hn=i(` and (2) corresponds to
`),Ho=a("a"),fn=i("DeiTForImageClassificationWithTeacher"),gn=i("."),un=p(),Es=a("li"),_n=i(`Note that the authors also did try soft distillation for (2) (in which case the distillation prediction head is
trained using KL divergence to match the softmax output of the teacher), but hard distillation gave the best results.`),Tn=p(),Cs=a("li"),bn=i(`All released checkpoints were pre-trained and fine-tuned on ImageNet-1k only. No external data was used. This is in
contrast with the original ViT model, which used external data like the JFT-300M dataset/Imagenet-21k for
pre-training.`),vn=p(),x=a("li"),wn=i(`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),Uo=a("a"),$n=i("ViTModel"),yn=i(" or "),Bo=a("a"),kn=i("ViTForImageClassification"),Dn=i(`. Techniques like data
augmentation, optimization, and regularization were used in order to simulate training on a much larger dataset
(while only using ImageNet-1k for pre-training). There are 4 variants available (in 3 different sizes):
`),As=a("em"),In=i("facebook/deit-tiny-patch16-224"),Fn=i(", "),zs=a("em"),Mn=i("facebook/deit-small-patch16-224"),xn=i(", "),qs=a("em"),jn=i("facebook/deit-base-patch16-224"),Pn=i(` and
`),Ns=a("em"),En=i("facebook/deit-base-patch16-384"),Cn=i(". Note that one should use "),Jo=a("a"),An=i("DeiTImageProcessor"),zn=i(` in order to
prepare images for the model.`),Ka=p(),oe=a("p"),qn=i("This model was contributed by "),Pt=a("a"),Nn=i("nielsr"),On=i(". The TensorFlow version of this model was added by "),Et=a("a"),Wn=i("amyeroberts"),Ln=i("."),Ya=p(),le=a("h2"),Oe=a("a"),Os=a("span"),v(Ct.$$.fragment),Sn=p(),Ws=a("span"),Vn=i("Resources"),Xa=p(),Go=a("p"),Rn=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DeiT."),Qa=p(),v(At.$$.fragment),Za=p(),Ko=a("ul"),se=a("li"),Yo=a("a"),Hn=i("DeiTForImageClassification"),Un=i(" is supported by this "),zt=a("a"),Bn=i("example script"),Jn=i(" and "),qt=a("a"),Gn=i("notebook"),Kn=i("."),er=p(),Xo=a("p"),Yn=i("Besides that:"),tr=p(),Qo=a("ul"),We=a("li"),Zo=a("a"),Xn=i("DeiTForMaskedImageModeling"),Qn=i(" is supported by this "),Nt=a("a"),Zn=i("example script"),ei=i("."),or=p(),es=a("p"),ti=i("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."),sr=p(),de=a("h2"),Le=a("a"),Ls=a("span"),v(Ot.$$.fragment),oi=p(),Ss=a("span"),si=i("DeiTConfig"),ar=p(),q=a("div"),v(Wt.$$.fragment),ai=p(),ce=a("p"),ri=i("This is the configuration class to store the configuration of a "),ts=a("a"),ni=i("DeiTModel"),ii=i(`. It is used to instantiate an DeiT
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 DeiT
`),Lt=a("a"),li=i("facebook/deit-base-distilled-patch16-224"),di=i(`
architecture.`),ci=p(),me=a("p"),mi=i("Configuration objects inherit from "),os=a("a"),pi=i("PretrainedConfig"),hi=i(` and can be used to control the model outputs. Read the
documentation from `),ss=a("a"),fi=i("PretrainedConfig"),gi=i(" for more information."),ui=p(),v(Se.$$.fragment),rr=p(),pe=a("h2"),Ve=a("a"),Vs=a("span"),v(St.$$.fragment),_i=p(),Rs=a("span"),Ti=i("DeiTFeatureExtractor"),nr=p(),he=a("div"),v(Vt.$$.fragment),bi=p(),Re=a("div"),v(Rt.$$.fragment),vi=p(),Hs=a("p"),wi=i("Preprocess an image or a batch of images."),ir=p(),fe=a("h2"),He=a("a"),Us=a("span"),v(Ht.$$.fragment),$i=p(),Bs=a("span"),yi=i("DeiTImageProcessor"),lr=p(),X=a("div"),v(Ut.$$.fragment),ki=p(),Js=a("p"),Di=i("Constructs a DeiT image processor."),Ii=p(),Ue=a("div"),v(Bt.$$.fragment),Fi=p(),Gs=a("p"),Mi=i("Preprocess an image or batch of images."),dr=p(),ge=a("h2"),Be=a("a"),Ks=a("span"),v(Jt.$$.fragment),xi=p(),Ys=a("span"),ji=i("DeiTModel"),cr=p(),Q=a("div"),v(Gt.$$.fragment),Pi=p(),Kt=a("p"),Ei=i(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Yt=a("a"),Ci=i("torch.nn.Module"),Ai=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zi=p(),S=a("div"),v(Xt.$$.fragment),qi=p(),ue=a("p"),Ni=i("The "),as=a("a"),Oi=i("DeiTModel"),Wi=i(" forward method, overrides the "),Xs=a("code"),Li=i("__call__"),Si=i(" special method."),Vi=p(),v(Je.$$.fragment),Ri=p(),v(Ge.$$.fragment),mr=p(),_e=a("h2"),Ke=a("a"),Qs=a("span"),v(Qt.$$.fragment),Hi=p(),Zs=a("span"),Ui=i("DeiTForMaskedImageModeling"),pr=p(),C=a("div"),v(Zt.$$.fragment),Bi=p(),eo=a("p"),Ji=i("DeiT Model with a decoder on top for masked image modeling, as proposed in "),to=a("a"),Gi=i("SimMIM"),Ki=i("."),Yi=p(),v(Ye.$$.fragment),Xi=p(),oo=a("p"),Qi=i("This model is a PyTorch "),so=a("a"),Zi=i("torch.nn.Module"),el=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tl=p(),V=a("div"),v(ao.$$.fragment),ol=p(),Te=a("p"),sl=i("The "),rs=a("a"),al=i("DeiTForMaskedImageModeling"),rl=i(" forward method, overrides the "),ea=a("code"),nl=i("__call__"),il=i(" special method."),ll=p(),v(Xe.$$.fragment),dl=p(),v(Qe.$$.fragment),hr=p(),be=a("h2"),Ze=a("a"),ta=a("span"),v(ro.$$.fragment),cl=p(),oa=a("span"),ml=i("DeiTForImageClassification"),fr=p(),N=a("div"),v(no.$$.fragment),pl=p(),sa=a("p"),hl=i(`DeiT 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.`),fl=p(),io=a("p"),gl=i("This model is a PyTorch "),lo=a("a"),ul=i("torch.nn.Module"),_l=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tl=p(),R=a("div"),v(co.$$.fragment),bl=p(),ve=a("p"),vl=i("The "),ns=a("a"),wl=i("DeiTForImageClassification"),$l=i(" forward method, overrides the "),aa=a("code"),yl=i("__call__"),kl=i(" special method."),Dl=p(),v(et.$$.fragment),Il=p(),v(tt.$$.fragment),gr=p(),we=a("h2"),ot=a("a"),ra=a("span"),v(mo.$$.fragment),Fl=p(),na=a("span"),Ml=i("DeiTForImageClassificationWithTeacher"),ur=p(),j=a("div"),v(po.$$.fragment),xl=p(),ia=a("p"),jl=i(`DeiT Model transformer with image classification heads on top (a linear layer on top of the final hidden state of
the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`),Pl=p(),la=a("p"),El=i(".. warning::"),Cl=p(),da=a("p"),Al=i(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),zl=p(),ho=a("p"),ql=i("This model is a PyTorch "),fo=a("a"),Nl=i("torch.nn.Module"),Ol=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wl=p(),H=a("div"),v(go.$$.fragment),Ll=p(),$e=a("p"),Sl=i("The "),is=a("a"),Vl=i("DeiTForImageClassificationWithTeacher"),Rl=i(" forward method, overrides the "),ca=a("code"),Hl=i("__call__"),Ul=i(" special method."),Bl=p(),v(st.$$.fragment),Jl=p(),v(at.$$.fragment),_r=p(),ye=a("h2"),rt=a("a"),ma=a("span"),v(uo.$$.fragment),Gl=p(),pa=a("span"),Kl=i("TFDeiTModel"),Tr=p(),Z=a("div"),v(_o.$$.fragment),Yl=p(),To=a("p"),Xl=i(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),bo=a("a"),Ql=i("tf.keras.layers.Layer"),Zl=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ed=p(),U=a("div"),v(vo.$$.fragment),td=p(),ke=a("p"),od=i("The "),ls=a("a"),sd=i("TFDeiTModel"),ad=i(" forward method, overrides the "),ha=a("code"),rd=i("__call__"),nd=i(" special method."),id=p(),v(nt.$$.fragment),ld=p(),v(it.$$.fragment),br=p(),De=a("h2"),lt=a("a"),fa=a("span"),v(wo.$$.fragment),dd=p(),ga=a("span"),cd=i("TFDeiTForMaskedImageModeling"),vr=p(),ee=a("div"),v($o.$$.fragment),md=p(),Ie=a("p"),pd=i("DeiT Model with a decoder on top for masked image modeling, as proposed in "),yo=a("a"),hd=i("SimMIM"),fd=i(`.
This model is a TensorFlow
`),ko=a("a"),gd=i("tf.keras.layers.Layer"),ud=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),_d=p(),B=a("div"),v(Do.$$.fragment),Td=p(),Fe=a("p"),bd=i("The "),ds=a("a"),vd=i("TFDeiTForMaskedImageModeling"),wd=i(" forward method, overrides the "),ua=a("code"),$d=i("__call__"),yd=i(" special method."),kd=p(),v(dt.$$.fragment),Dd=p(),v(ct.$$.fragment),wr=p(),Me=a("h2"),mt=a("a"),_a=a("span"),v(Io.$$.fragment),Id=p(),Ta=a("span"),Fd=i("TFDeiTForImageClassification"),$r=p(),O=a("div"),v(Fo.$$.fragment),Md=p(),ba=a("p"),xd=i(`DeiT 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.`),jd=p(),Mo=a("p"),Pd=i(`This model is a TensorFlow
`),xo=a("a"),Ed=i("tf.keras.layers.Layer"),Cd=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Ad=p(),J=a("div"),v(jo.$$.fragment),zd=p(),xe=a("p"),qd=i("The "),cs=a("a"),Nd=i("TFDeiTForImageClassification"),Od=i(" forward method, overrides the "),va=a("code"),Wd=i("__call__"),Ld=i(" special method."),Sd=p(),v(pt.$$.fragment),Vd=p(),v(ht.$$.fragment),yr=p(),je=a("h2"),ft=a("a"),wa=a("span"),v(Po.$$.fragment),Rd=p(),$a=a("span"),Hd=i("TFDeiTForImageClassificationWithTeacher"),kr=p(),P=a("div"),v(Eo.$$.fragment),Ud=p(),ya=a("p"),Bd=i(`DeiT Model transformer with image classification heads on top (a linear layer on top of the final hidden state of
the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`),Jd=p(),ka=a("p"),Gd=i(".. warning::"),Kd=p(),Da=a("p"),Yd=i(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Xd=p(),Co=a("p"),Qd=i(`This model is a TensorFlow
`),Ao=a("a"),Zd=i("tf.keras.layers.Layer"),ec=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),tc=p(),G=a("div"),v(zo.$$.fragment),oc=p(),Pe=a("p"),sc=i("The "),ms=a("a"),ac=i("TFDeiTForImageClassificationWithTeacher"),rc=i(" forward method, overrides the "),Ia=a("code"),nc=i("__call__"),ic=i(" special method."),lc=p(),v(gt.$$.fragment),dc=p(),v(ut.$$.fragment),this.h()},l(t){const u=rp('[data-svelte="svelte-1phssyn"]',document.head);d=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=h(t),g=r(t,"H1",{class:!0});var qo=n(g);f=r(qo,"A",{id:!0,class:!0,href:!0});var Fa=n(f);T=r(Fa,"SPAN",{});var Ma=n(T);w(s.$$.fragment,Ma),Ma.forEach(o),Fa.forEach(o),m=h(qo),F=r(qo,"SPAN",{});var xa=n(F);Kr=l(xa,"DeiT"),xa.forEach(o),qo.forEach(o),Va=h(t),w(qe.$$.fragment,t),Ra=h(t),ne=r(t,"H2",{class:!0});var No=n(ne);Ne=r(No,"A",{id:!0,class:!0,href:!0});var ja=n(Ne);Ms=r(ja,"SPAN",{});var Pa=n(Ms);w(Mt.$$.fragment,Pa),Pa.forEach(o),ja.forEach(o),Yr=h(No),xs=r(No,"SPAN",{});var Ea=n(xs);Xr=l(Ea,"Overview"),Ea.forEach(o),No.forEach(o),Ha=h(t),L=r(t,"P",{});var te=n(L);Qr=l(te,"The DeiT model was proposed in "),xt=r(te,"A",{href:!0,rel:!0});var Ca=n(xt);Zr=l(Ca,"Training data-efficient image transformers & distillation through attention"),Ca.forEach(o),en=l(te,` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),Wo=r(te,"A",{href:!0});var Aa=n(Wo);tn=l(Aa,"Vision Transformer (ViT)"),Aa.forEach(o),on=l(te," introduced in "),jt=r(te,"A",{href:!0,rel:!0});var za=n(jt);sn=l(za,"Dosovitskiy et al., 2020"),za.forEach(o),an=l(te,` has shown that one can match or even outperform existing convolutional neural
networks using a Transformer encoder (BERT-like). However, the ViT models introduced in that paper required training on
expensive infrastructure for multiple weeks, using external data. DeiT (data-efficient image transformers) are more
efficiently trained transformers for image classification, requiring far less data and far less computing resources
compared to the original ViT models.`),te.forEach(o),Ua=h(t),Lo=r(t,"P",{});var qa=n(Lo);rn=l(qa,"The abstract from the paper is the following:"),qa.forEach(o),Ba=h(t),So=r(t,"P",{});var Na=n(So);js=r(Na,"EM",{});var Oa=n(js);nn=l(Oa,`Recently, neural networks purely based on attention were shown to address image understanding tasks such as image
classification. However, these visual transformers are pre-trained with hundreds of millions of images using an
expensive infrastructure, thereby limiting their adoption. In this work, we produce a competitive convolution-free
transformer by training on Imagenet only. We train them on a single computer in less than 3 days. Our reference vision
transformer (86M parameters) achieves top-1 accuracy of 83.1% (single-crop evaluation) on ImageNet with no external
data. More importantly, we introduce a teacher-student strategy specific to transformers. It relies on a distillation
token ensuring that the student learns from the teacher through attention. We show the interest of this token-based
distillation, especially when using a convnet as a teacher. This leads us to report results competitive with convnets
for both Imagenet (where we obtain up to 85.2% accuracy) and when transferring to other tasks. We share our code and
models.`),Oa.forEach(o),Na.forEach(o),Ja=h(t),Vo=r(t,"P",{});var Wa=n(Vo);ln=l(Wa,"Tips:"),Wa.forEach(o),Ga=h(t),A=r(t,"UL",{});var W=n(A);Ps=r(W,"LI",{});var La=n(Ps);dn=l(La,`Compared to ViT, DeiT models use a so-called distillation token to effectively learn from a teacher (which, in the
DeiT paper, is a ResNet like-model). The distillation token is learned through backpropagation, by interacting with
the class ([CLS]) and patch tokens through the self-attention layers.`),La.forEach(o),cn=h(W),ie=r(W,"LI",{});var Ee=n(ie);mn=l(Ee,`There are 2 ways to fine-tune distilled models, either (1) in a classic way, by only placing a prediction head on top
of the final hidden state of the class token and not using the distillation signal, or (2) by placing both a
prediction head on top of the class token and on top of the distillation token. In that case, the [CLS] prediction
head is trained using regular cross-entropy between the prediction of the head and the ground-truth label, while the
distillation prediction head is trained using hard distillation (cross-entropy between the prediction of the
distillation head and the label predicted by the teacher). At inference time, one takes the average prediction
between both heads as final prediction. (2) is also called \u201Cfine-tuning with distillation\u201D, because one relies on a
teacher that has already been fine-tuned on the downstream dataset. In terms of models, (1) corresponds to
`),Ro=r(Ee,"A",{href:!0});var cc=n(Ro);pn=l(cc,"DeiTForImageClassification"),cc.forEach(o),hn=l(Ee,` and (2) corresponds to
`),Ho=r(Ee,"A",{href:!0});var mc=n(Ho);fn=l(mc,"DeiTForImageClassificationWithTeacher"),mc.forEach(o),gn=l(Ee,"."),Ee.forEach(o),un=h(W),Es=r(W,"LI",{});var pc=n(Es);_n=l(pc,`Note that the authors also did try soft distillation for (2) (in which case the distillation prediction head is
trained using KL divergence to match the softmax output of the teacher), but hard distillation gave the best results.`),pc.forEach(o),Tn=h(W),Cs=r(W,"LI",{});var hc=n(Cs);bn=l(hc,`All released checkpoints were pre-trained and fine-tuned on ImageNet-1k only. No external data was used. This is in
contrast with the original ViT model, which used external data like the JFT-300M dataset/Imagenet-21k for
pre-training.`),hc.forEach(o),vn=h(W),x=r(W,"LI",{});var E=n(x);wn=l(E,`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),Uo=r(E,"A",{href:!0});var fc=n(Uo);$n=l(fc,"ViTModel"),fc.forEach(o),yn=l(E," or "),Bo=r(E,"A",{href:!0});var gc=n(Bo);kn=l(gc,"ViTForImageClassification"),gc.forEach(o),Dn=l(E,`. Techniques like data
augmentation, optimization, and regularization were used in order to simulate training on a much larger dataset
(while only using ImageNet-1k for pre-training). There are 4 variants available (in 3 different sizes):
`),As=r(E,"EM",{});var uc=n(As);In=l(uc,"facebook/deit-tiny-patch16-224"),uc.forEach(o),Fn=l(E,", "),zs=r(E,"EM",{});var _c=n(zs);Mn=l(_c,"facebook/deit-small-patch16-224"),_c.forEach(o),xn=l(E,", "),qs=r(E,"EM",{});var Tc=n(qs);jn=l(Tc,"facebook/deit-base-patch16-224"),Tc.forEach(o),Pn=l(E,` and
`),Ns=r(E,"EM",{});var bc=n(Ns);En=l(bc,"facebook/deit-base-patch16-384"),bc.forEach(o),Cn=l(E,". Note that one should use "),Jo=r(E,"A",{href:!0});var vc=n(Jo);An=l(vc,"DeiTImageProcessor"),vc.forEach(o),zn=l(E,` in order to
prepare images for the model.`),E.forEach(o),W.forEach(o),Ka=h(t),oe=r(t,"P",{});var ps=n(oe);qn=l(ps,"This model was contributed by "),Pt=r(ps,"A",{href:!0,rel:!0});var wc=n(Pt);Nn=l(wc,"nielsr"),wc.forEach(o),On=l(ps,". The TensorFlow version of this model was added by "),Et=r(ps,"A",{href:!0,rel:!0});var $c=n(Et);Wn=l($c,"amyeroberts"),$c.forEach(o),Ln=l(ps,"."),ps.forEach(o),Ya=h(t),le=r(t,"H2",{class:!0});var Ir=n(le);Oe=r(Ir,"A",{id:!0,class:!0,href:!0});var yc=n(Oe);Os=r(yc,"SPAN",{});var kc=n(Os);w(Ct.$$.fragment,kc),kc.forEach(o),yc.forEach(o),Sn=h(Ir),Ws=r(Ir,"SPAN",{});var Dc=n(Ws);Vn=l(Dc,"Resources"),Dc.forEach(o),Ir.forEach(o),Xa=h(t),Go=r(t,"P",{});var Ic=n(Go);Rn=l(Ic,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DeiT."),Ic.forEach(o),Qa=h(t),w(At.$$.fragment,t),Za=h(t),Ko=r(t,"UL",{});var Fc=n(Ko);se=r(Fc,"LI",{});var Oo=n(se);Yo=r(Oo,"A",{href:!0});var Mc=n(Yo);Hn=l(Mc,"DeiTForImageClassification"),Mc.forEach(o),Un=l(Oo," is supported by this "),zt=r(Oo,"A",{href:!0,rel:!0});var xc=n(zt);Bn=l(xc,"example script"),xc.forEach(o),Jn=l(Oo," and "),qt=r(Oo,"A",{href:!0,rel:!0});var jc=n(qt);Gn=l(jc,"notebook"),jc.forEach(o),Kn=l(Oo,"."),Oo.forEach(o),Fc.forEach(o),er=h(t),Xo=r(t,"P",{});var Pc=n(Xo);Yn=l(Pc,"Besides that:"),Pc.forEach(o),tr=h(t),Qo=r(t,"UL",{});var Ec=n(Qo);We=r(Ec,"LI",{});var Sa=n(We);Zo=r(Sa,"A",{href:!0});var Cc=n(Zo);Xn=l(Cc,"DeiTForMaskedImageModeling"),Cc.forEach(o),Qn=l(Sa," is supported by this "),Nt=r(Sa,"A",{href:!0,rel:!0});var Ac=n(Nt);Zn=l(Ac,"example script"),Ac.forEach(o),ei=l(Sa,"."),Sa.forEach(o),Ec.forEach(o),or=h(t),es=r(t,"P",{});var zc=n(es);ti=l(zc,"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."),zc.forEach(o),sr=h(t),de=r(t,"H2",{class:!0});var Fr=n(de);Le=r(Fr,"A",{id:!0,class:!0,href:!0});var qc=n(Le);Ls=r(qc,"SPAN",{});var Nc=n(Ls);w(Ot.$$.fragment,Nc),Nc.forEach(o),qc.forEach(o),oi=h(Fr),Ss=r(Fr,"SPAN",{});var Oc=n(Ss);si=l(Oc,"DeiTConfig"),Oc.forEach(o),Fr.forEach(o),ar=h(t),q=r(t,"DIV",{class:!0});var _t=n(q);w(Wt.$$.fragment,_t),ai=h(_t),ce=r(_t,"P",{});var hs=n(ce);ri=l(hs,"This is the configuration class to store the configuration of a "),ts=r(hs,"A",{href:!0});var Wc=n(ts);ni=l(Wc,"DeiTModel"),Wc.forEach(o),ii=l(hs,`. It is used to instantiate an DeiT
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 DeiT
`),Lt=r(hs,"A",{href:!0,rel:!0});var Lc=n(Lt);li=l(Lc,"facebook/deit-base-distilled-patch16-224"),Lc.forEach(o),di=l(hs,`
architecture.`),hs.forEach(o),ci=h(_t),me=r(_t,"P",{});var fs=n(me);mi=l(fs,"Configuration objects inherit from "),os=r(fs,"A",{href:!0});var Sc=n(os);pi=l(Sc,"PretrainedConfig"),Sc.forEach(o),hi=l(fs,` and can be used to control the model outputs. Read the
documentation from `),ss=r(fs,"A",{href:!0});var Vc=n(ss);fi=l(Vc,"PretrainedConfig"),Vc.forEach(o),gi=l(fs," for more information."),fs.forEach(o),ui=h(_t),w(Se.$$.fragment,_t),_t.forEach(o),rr=h(t),pe=r(t,"H2",{class:!0});var Mr=n(pe);Ve=r(Mr,"A",{id:!0,class:!0,href:!0});var Rc=n(Ve);Vs=r(Rc,"SPAN",{});var Hc=n(Vs);w(St.$$.fragment,Hc),Hc.forEach(o),Rc.forEach(o),_i=h(Mr),Rs=r(Mr,"SPAN",{});var Uc=n(Rs);Ti=l(Uc,"DeiTFeatureExtractor"),Uc.forEach(o),Mr.forEach(o),nr=h(t),he=r(t,"DIV",{class:!0});var xr=n(he);w(Vt.$$.fragment,xr),bi=h(xr),Re=r(xr,"DIV",{class:!0});var jr=n(Re);w(Rt.$$.fragment,jr),vi=h(jr),Hs=r(jr,"P",{});var Bc=n(Hs);wi=l(Bc,"Preprocess an image or a batch of images."),Bc.forEach(o),jr.forEach(o),xr.forEach(o),ir=h(t),fe=r(t,"H2",{class:!0});var Pr=n(fe);He=r(Pr,"A",{id:!0,class:!0,href:!0});var Jc=n(He);Us=r(Jc,"SPAN",{});var Gc=n(Us);w(Ht.$$.fragment,Gc),Gc.forEach(o),Jc.forEach(o),$i=h(Pr),Bs=r(Pr,"SPAN",{});var Kc=n(Bs);yi=l(Kc,"DeiTImageProcessor"),Kc.forEach(o),Pr.forEach(o),lr=h(t),X=r(t,"DIV",{class:!0});var gs=n(X);w(Ut.$$.fragment,gs),ki=h(gs),Js=r(gs,"P",{});var Yc=n(Js);Di=l(Yc,"Constructs a DeiT image processor."),Yc.forEach(o),Ii=h(gs),Ue=r(gs,"DIV",{class:!0});var Er=n(Ue);w(Bt.$$.fragment,Er),Fi=h(Er),Gs=r(Er,"P",{});var Xc=n(Gs);Mi=l(Xc,"Preprocess an image or batch of images."),Xc.forEach(o),Er.forEach(o),gs.forEach(o),dr=h(t),ge=r(t,"H2",{class:!0});var Cr=n(ge);Be=r(Cr,"A",{id:!0,class:!0,href:!0});var Qc=n(Be);Ks=r(Qc,"SPAN",{});var Zc=n(Ks);w(Jt.$$.fragment,Zc),Zc.forEach(o),Qc.forEach(o),xi=h(Cr),Ys=r(Cr,"SPAN",{});var em=n(Ys);ji=l(em,"DeiTModel"),em.forEach(o),Cr.forEach(o),cr=h(t),Q=r(t,"DIV",{class:!0});var us=n(Q);w(Gt.$$.fragment,us),Pi=h(us),Kt=r(us,"P",{});var Ar=n(Kt);Ei=l(Ar,`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Yt=r(Ar,"A",{href:!0,rel:!0});var tm=n(Yt);Ci=l(tm,"torch.nn.Module"),tm.forEach(o),Ai=l(Ar,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ar.forEach(o),zi=h(us),S=r(us,"DIV",{class:!0});var Tt=n(S);w(Xt.$$.fragment,Tt),qi=h(Tt),ue=r(Tt,"P",{});var _s=n(ue);Ni=l(_s,"The "),as=r(_s,"A",{href:!0});var om=n(as);Oi=l(om,"DeiTModel"),om.forEach(o),Wi=l(_s," forward method, overrides the "),Xs=r(_s,"CODE",{});var sm=n(Xs);Li=l(sm,"__call__"),sm.forEach(o),Si=l(_s," special method."),_s.forEach(o),Vi=h(Tt),w(Je.$$.fragment,Tt),Ri=h(Tt),w(Ge.$$.fragment,Tt),Tt.forEach(o),us.forEach(o),mr=h(t),_e=r(t,"H2",{class:!0});var zr=n(_e);Ke=r(zr,"A",{id:!0,class:!0,href:!0});var am=n(Ke);Qs=r(am,"SPAN",{});var rm=n(Qs);w(Qt.$$.fragment,rm),rm.forEach(o),am.forEach(o),Hi=h(zr),Zs=r(zr,"SPAN",{});var nm=n(Zs);Ui=l(nm,"DeiTForMaskedImageModeling"),nm.forEach(o),zr.forEach(o),pr=h(t),C=r(t,"DIV",{class:!0});var ae=n(C);w(Zt.$$.fragment,ae),Bi=h(ae),eo=r(ae,"P",{});var qr=n(eo);Ji=l(qr,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),to=r(qr,"A",{href:!0,rel:!0});var im=n(to);Gi=l(im,"SimMIM"),im.forEach(o),Ki=l(qr,"."),qr.forEach(o),Yi=h(ae),w(Ye.$$.fragment,ae),Xi=h(ae),oo=r(ae,"P",{});var Nr=n(oo);Qi=l(Nr,"This model is a PyTorch "),so=r(Nr,"A",{href:!0,rel:!0});var lm=n(so);Zi=l(lm,"torch.nn.Module"),lm.forEach(o),el=l(Nr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nr.forEach(o),tl=h(ae),V=r(ae,"DIV",{class:!0});var bt=n(V);w(ao.$$.fragment,bt),ol=h(bt),Te=r(bt,"P",{});var Ts=n(Te);sl=l(Ts,"The "),rs=r(Ts,"A",{href:!0});var dm=n(rs);al=l(dm,"DeiTForMaskedImageModeling"),dm.forEach(o),rl=l(Ts," forward method, overrides the "),ea=r(Ts,"CODE",{});var cm=n(ea);nl=l(cm,"__call__"),cm.forEach(o),il=l(Ts," special method."),Ts.forEach(o),ll=h(bt),w(Xe.$$.fragment,bt),dl=h(bt),w(Qe.$$.fragment,bt),bt.forEach(o),ae.forEach(o),hr=h(t),be=r(t,"H2",{class:!0});var Or=n(be);Ze=r(Or,"A",{id:!0,class:!0,href:!0});var mm=n(Ze);ta=r(mm,"SPAN",{});var pm=n(ta);w(ro.$$.fragment,pm),pm.forEach(o),mm.forEach(o),cl=h(Or),oa=r(Or,"SPAN",{});var hm=n(oa);ml=l(hm,"DeiTForImageClassification"),hm.forEach(o),Or.forEach(o),fr=h(t),N=r(t,"DIV",{class:!0});var vt=n(N);w(no.$$.fragment,vt),pl=h(vt),sa=r(vt,"P",{});var fm=n(sa);hl=l(fm,`DeiT 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.`),fm.forEach(o),fl=h(vt),io=r(vt,"P",{});var Wr=n(io);gl=l(Wr,"This model is a PyTorch "),lo=r(Wr,"A",{href:!0,rel:!0});var gm=n(lo);ul=l(gm,"torch.nn.Module"),gm.forEach(o),_l=l(Wr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wr.forEach(o),Tl=h(vt),R=r(vt,"DIV",{class:!0});var wt=n(R);w(co.$$.fragment,wt),bl=h(wt),ve=r(wt,"P",{});var bs=n(ve);vl=l(bs,"The "),ns=r(bs,"A",{href:!0});var um=n(ns);wl=l(um,"DeiTForImageClassification"),um.forEach(o),$l=l(bs," forward method, overrides the "),aa=r(bs,"CODE",{});var _m=n(aa);yl=l(_m,"__call__"),_m.forEach(o),kl=l(bs," special method."),bs.forEach(o),Dl=h(wt),w(et.$$.fragment,wt),Il=h(wt),w(tt.$$.fragment,wt),wt.forEach(o),vt.forEach(o),gr=h(t),we=r(t,"H2",{class:!0});var Lr=n(we);ot=r(Lr,"A",{id:!0,class:!0,href:!0});var Tm=n(ot);ra=r(Tm,"SPAN",{});var bm=n(ra);w(mo.$$.fragment,bm),bm.forEach(o),Tm.forEach(o),Fl=h(Lr),na=r(Lr,"SPAN",{});var vm=n(na);Ml=l(vm,"DeiTForImageClassificationWithTeacher"),vm.forEach(o),Lr.forEach(o),ur=h(t),j=r(t,"DIV",{class:!0});var K=n(j);w(po.$$.fragment,K),xl=h(K),ia=r(K,"P",{});var wm=n(ia);jl=l(wm,`DeiT Model transformer with image classification heads on top (a linear layer on top of the final hidden state of
the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`),wm.forEach(o),Pl=h(K),la=r(K,"P",{});var $m=n(la);El=l($m,".. warning::"),$m.forEach(o),Cl=h(K),da=r(K,"P",{});var ym=n(da);Al=l(ym,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),ym.forEach(o),zl=h(K),ho=r(K,"P",{});var Sr=n(ho);ql=l(Sr,"This model is a PyTorch "),fo=r(Sr,"A",{href:!0,rel:!0});var km=n(fo);Nl=l(km,"torch.nn.Module"),km.forEach(o),Ol=l(Sr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sr.forEach(o),Wl=h(K),H=r(K,"DIV",{class:!0});var $t=n(H);w(go.$$.fragment,$t),Ll=h($t),$e=r($t,"P",{});var vs=n($e);Sl=l(vs,"The "),is=r(vs,"A",{href:!0});var Dm=n(is);Vl=l(Dm,"DeiTForImageClassificationWithTeacher"),Dm.forEach(o),Rl=l(vs," forward method, overrides the "),ca=r(vs,"CODE",{});var Im=n(ca);Hl=l(Im,"__call__"),Im.forEach(o),Ul=l(vs," special method."),vs.forEach(o),Bl=h($t),w(st.$$.fragment,$t),Jl=h($t),w(at.$$.fragment,$t),$t.forEach(o),K.forEach(o),_r=h(t),ye=r(t,"H2",{class:!0});var Vr=n(ye);rt=r(Vr,"A",{id:!0,class:!0,href:!0});var Fm=n(rt);ma=r(Fm,"SPAN",{});var Mm=n(ma);w(uo.$$.fragment,Mm),Mm.forEach(o),Fm.forEach(o),Gl=h(Vr),pa=r(Vr,"SPAN",{});var xm=n(pa);Kl=l(xm,"TFDeiTModel"),xm.forEach(o),Vr.forEach(o),Tr=h(t),Z=r(t,"DIV",{class:!0});var ws=n(Z);w(_o.$$.fragment,ws),Yl=h(ws),To=r(ws,"P",{});var Rr=n(To);Xl=l(Rr,`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),bo=r(Rr,"A",{href:!0,rel:!0});var jm=n(bo);Ql=l(jm,"tf.keras.layers.Layer"),jm.forEach(o),Zl=l(Rr,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Rr.forEach(o),ed=h(ws),U=r(ws,"DIV",{class:!0});var yt=n(U);w(vo.$$.fragment,yt),td=h(yt),ke=r(yt,"P",{});var $s=n(ke);od=l($s,"The "),ls=r($s,"A",{href:!0});var Pm=n(ls);sd=l(Pm,"TFDeiTModel"),Pm.forEach(o),ad=l($s," forward method, overrides the "),ha=r($s,"CODE",{});var Em=n(ha);rd=l(Em,"__call__"),Em.forEach(o),nd=l($s," special method."),$s.forEach(o),id=h(yt),w(nt.$$.fragment,yt),ld=h(yt),w(it.$$.fragment,yt),yt.forEach(o),ws.forEach(o),br=h(t),De=r(t,"H2",{class:!0});var Hr=n(De);lt=r(Hr,"A",{id:!0,class:!0,href:!0});var Cm=n(lt);fa=r(Cm,"SPAN",{});var Am=n(fa);w(wo.$$.fragment,Am),Am.forEach(o),Cm.forEach(o),dd=h(Hr),ga=r(Hr,"SPAN",{});var zm=n(ga);cd=l(zm,"TFDeiTForMaskedImageModeling"),zm.forEach(o),Hr.forEach(o),vr=h(t),ee=r(t,"DIV",{class:!0});var ys=n(ee);w($o.$$.fragment,ys),md=h(ys),Ie=r(ys,"P",{});var ks=n(Ie);pd=l(ks,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),yo=r(ks,"A",{href:!0,rel:!0});var qm=n(yo);hd=l(qm,"SimMIM"),qm.forEach(o),fd=l(ks,`.
This model is a TensorFlow
`),ko=r(ks,"A",{href:!0,rel:!0});var Nm=n(ko);gd=l(Nm,"tf.keras.layers.Layer"),Nm.forEach(o),ud=l(ks,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ks.forEach(o),_d=h(ys),B=r(ys,"DIV",{class:!0});var kt=n(B);w(Do.$$.fragment,kt),Td=h(kt),Fe=r(kt,"P",{});var Ds=n(Fe);bd=l(Ds,"The "),ds=r(Ds,"A",{href:!0});var Om=n(ds);vd=l(Om,"TFDeiTForMaskedImageModeling"),Om.forEach(o),wd=l(Ds," forward method, overrides the "),ua=r(Ds,"CODE",{});var Wm=n(ua);$d=l(Wm,"__call__"),Wm.forEach(o),yd=l(Ds," special method."),Ds.forEach(o),kd=h(kt),w(dt.$$.fragment,kt),Dd=h(kt),w(ct.$$.fragment,kt),kt.forEach(o),ys.forEach(o),wr=h(t),Me=r(t,"H2",{class:!0});var Ur=n(Me);mt=r(Ur,"A",{id:!0,class:!0,href:!0});var Lm=n(mt);_a=r(Lm,"SPAN",{});var Sm=n(_a);w(Io.$$.fragment,Sm),Sm.forEach(o),Lm.forEach(o),Id=h(Ur),Ta=r(Ur,"SPAN",{});var Vm=n(Ta);Fd=l(Vm,"TFDeiTForImageClassification"),Vm.forEach(o),Ur.forEach(o),$r=h(t),O=r(t,"DIV",{class:!0});var Dt=n(O);w(Fo.$$.fragment,Dt),Md=h(Dt),ba=r(Dt,"P",{});var Rm=n(ba);xd=l(Rm,`DeiT 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.`),Rm.forEach(o),jd=h(Dt),Mo=r(Dt,"P",{});var Br=n(Mo);Pd=l(Br,`This model is a TensorFlow
`),xo=r(Br,"A",{href:!0,rel:!0});var Hm=n(xo);Ed=l(Hm,"tf.keras.layers.Layer"),Hm.forEach(o),Cd=l(Br,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Br.forEach(o),Ad=h(Dt),J=r(Dt,"DIV",{class:!0});var It=n(J);w(jo.$$.fragment,It),zd=h(It),xe=r(It,"P",{});var Is=n(xe);qd=l(Is,"The "),cs=r(Is,"A",{href:!0});var Um=n(cs);Nd=l(Um,"TFDeiTForImageClassification"),Um.forEach(o),Od=l(Is," forward method, overrides the "),va=r(Is,"CODE",{});var Bm=n(va);Wd=l(Bm,"__call__"),Bm.forEach(o),Ld=l(Is," special method."),Is.forEach(o),Sd=h(It),w(pt.$$.fragment,It),Vd=h(It),w(ht.$$.fragment,It),It.forEach(o),Dt.forEach(o),yr=h(t),je=r(t,"H2",{class:!0});var Jr=n(je);ft=r(Jr,"A",{id:!0,class:!0,href:!0});var Jm=n(ft);wa=r(Jm,"SPAN",{});var Gm=n(wa);w(Po.$$.fragment,Gm),Gm.forEach(o),Jm.forEach(o),Rd=h(Jr),$a=r(Jr,"SPAN",{});var Km=n($a);Hd=l(Km,"TFDeiTForImageClassificationWithTeacher"),Km.forEach(o),Jr.forEach(o),kr=h(t),P=r(t,"DIV",{class:!0});var Y=n(P);w(Eo.$$.fragment,Y),Ud=h(Y),ya=r(Y,"P",{});var Ym=n(ya);Bd=l(Ym,`DeiT Model transformer with image classification heads on top (a linear layer on top of the final hidden state of
the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`),Ym.forEach(o),Jd=h(Y),ka=r(Y,"P",{});var Xm=n(ka);Gd=l(Xm,".. warning::"),Xm.forEach(o),Kd=h(Y),Da=r(Y,"P",{});var Qm=n(Da);Yd=l(Qm,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Qm.forEach(o),Xd=h(Y),Co=r(Y,"P",{});var Gr=n(Co);Qd=l(Gr,`This model is a TensorFlow
`),Ao=r(Gr,"A",{href:!0,rel:!0});var Zm=n(Ao);Zd=l(Zm,"tf.keras.layers.Layer"),Zm.forEach(o),ec=l(Gr,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Gr.forEach(o),tc=h(Y),G=r(Y,"DIV",{class:!0});var Ft=n(G);w(zo.$$.fragment,Ft),oc=h(Ft),Pe=r(Ft,"P",{});var Fs=n(Pe);sc=l(Fs,"The "),ms=r(Fs,"A",{href:!0});var ep=n(ms);ac=l(ep,"TFDeiTForImageClassificationWithTeacher"),ep.forEach(o),rc=l(Fs," forward method, overrides the "),Ia=r(Fs,"CODE",{});var tp=n(Ia);nc=l(tp,"__call__"),tp.forEach(o),ic=l(Fs," special method."),Fs.forEach(o),lc=h(Ft),w(gt.$$.fragment,Ft),dc=h(Ft),w(ut.$$.fragment,Ft),Ft.forEach(o),Y.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Mp)),c(f,"id","deit"),c(f,"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"),c(f,"href","#deit"),c(g,"class","relative group"),c(Ne,"id","overview"),c(Ne,"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"),c(Ne,"href","#overview"),c(ne,"class","relative group"),c(xt,"href","https://arxiv.org/abs/2012.12877"),c(xt,"rel","nofollow"),c(Wo,"href","vit"),c(jt,"href","https://arxiv.org/abs/2010.11929"),c(jt,"rel","nofollow"),c(Ro,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassification"),c(Ho,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),c(Uo,"href","/docs/transformers/main/en/model_doc/vit#transformers.ViTModel"),c(Bo,"href","/docs/transformers/main/en/model_doc/vit#transformers.ViTForImageClassification"),c(Jo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTImageProcessor"),c(Pt,"href","https://huggingface.co/nielsr"),c(Pt,"rel","nofollow"),c(Et,"href","https://huggingface.co/amyeroberts"),c(Et,"rel","nofollow"),c(Oe,"id","resources"),c(Oe,"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"),c(Oe,"href","#resources"),c(le,"class","relative group"),c(Yo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassification"),c(zt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(zt,"rel","nofollow"),c(qt,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(qt,"rel","nofollow"),c(Zo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForMaskedImageModeling"),c(Nt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(Nt,"rel","nofollow"),c(Le,"id","transformers.DeiTConfig"),c(Le,"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"),c(Le,"href","#transformers.DeiTConfig"),c(de,"class","relative group"),c(ts,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTModel"),c(Lt,"href","https://huggingface.co/facebook/deit-base-distilled-patch16-224"),c(Lt,"rel","nofollow"),c(os,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(ss,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ve,"id","transformers.DeiTFeatureExtractor"),c(Ve,"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"),c(Ve,"href","#transformers.DeiTFeatureExtractor"),c(pe,"class","relative group"),c(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(He,"id","transformers.DeiTImageProcessor"),c(He,"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"),c(He,"href","#transformers.DeiTImageProcessor"),c(fe,"class","relative group"),c(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Be,"id","transformers.DeiTModel"),c(Be,"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"),c(Be,"href","#transformers.DeiTModel"),c(ge,"class","relative group"),c(Yt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Yt,"rel","nofollow"),c(as,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTModel"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ke,"id","transformers.DeiTForMaskedImageModeling"),c(Ke,"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"),c(Ke,"href","#transformers.DeiTForMaskedImageModeling"),c(_e,"class","relative group"),c(to,"href","https://arxiv.org/abs/2111.09886"),c(to,"rel","nofollow"),c(so,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(so,"rel","nofollow"),c(rs,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForMaskedImageModeling"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ze,"id","transformers.DeiTForImageClassification"),c(Ze,"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"),c(Ze,"href","#transformers.DeiTForImageClassification"),c(be,"class","relative group"),c(lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(lo,"rel","nofollow"),c(ns,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassification"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ot,"id","transformers.DeiTForImageClassificationWithTeacher"),c(ot,"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"),c(ot,"href","#transformers.DeiTForImageClassificationWithTeacher"),c(we,"class","relative group"),c(fo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(fo,"rel","nofollow"),c(is,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),c(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(rt,"id","transformers.TFDeiTModel"),c(rt,"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"),c(rt,"href","#transformers.TFDeiTModel"),c(ye,"class","relative group"),c(bo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(bo,"rel","nofollow"),c(ls,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTModel"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(lt,"id","transformers.TFDeiTForMaskedImageModeling"),c(lt,"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"),c(lt,"href","#transformers.TFDeiTForMaskedImageModeling"),c(De,"class","relative group"),c(yo,"href","https://arxiv.org/abs/2111.09886"),c(yo,"rel","nofollow"),c(ko,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(ko,"rel","nofollow"),c(ds,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTForMaskedImageModeling"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(mt,"id","transformers.TFDeiTForImageClassification"),c(mt,"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"),c(mt,"href","#transformers.TFDeiTForImageClassification"),c(Me,"class","relative group"),c(xo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(xo,"rel","nofollow"),c(cs,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTForImageClassification"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ft,"id","transformers.TFDeiTForImageClassificationWithTeacher"),c(ft,"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"),c(ft,"href","#transformers.TFDeiTForImageClassificationWithTeacher"),c(je,"class","relative group"),c(Ao,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(Ao,"rel","nofollow"),c(ms,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTForImageClassificationWithTeacher"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,d),_(t,b,u),_(t,g,u),e(g,f),e(f,T),$(s,T,null),e(g,m),e(g,F),e(F,Kr),_(t,Va,u),$(qe,t,u),_(t,Ra,u),_(t,ne,u),e(ne,Ne),e(Ne,Ms),$(Mt,Ms,null),e(ne,Yr),e(ne,xs),e(xs,Xr),_(t,Ha,u),_(t,L,u),e(L,Qr),e(L,xt),e(xt,Zr),e(L,en),e(L,Wo),e(Wo,tn),e(L,on),e(L,jt),e(jt,sn),e(L,an),_(t,Ua,u),_(t,Lo,u),e(Lo,rn),_(t,Ba,u),_(t,So,u),e(So,js),e(js,nn),_(t,Ja,u),_(t,Vo,u),e(Vo,ln),_(t,Ga,u),_(t,A,u),e(A,Ps),e(Ps,dn),e(A,cn),e(A,ie),e(ie,mn),e(ie,Ro),e(Ro,pn),e(ie,hn),e(ie,Ho),e(Ho,fn),e(ie,gn),e(A,un),e(A,Es),e(Es,_n),e(A,Tn),e(A,Cs),e(Cs,bn),e(A,vn),e(A,x),e(x,wn),e(x,Uo),e(Uo,$n),e(x,yn),e(x,Bo),e(Bo,kn),e(x,Dn),e(x,As),e(As,In),e(x,Fn),e(x,zs),e(zs,Mn),e(x,xn),e(x,qs),e(qs,jn),e(x,Pn),e(x,Ns),e(Ns,En),e(x,Cn),e(x,Jo),e(Jo,An),e(x,zn),_(t,Ka,u),_(t,oe,u),e(oe,qn),e(oe,Pt),e(Pt,Nn),e(oe,On),e(oe,Et),e(Et,Wn),e(oe,Ln),_(t,Ya,u),_(t,le,u),e(le,Oe),e(Oe,Os),$(Ct,Os,null),e(le,Sn),e(le,Ws),e(Ws,Vn),_(t,Xa,u),_(t,Go,u),e(Go,Rn),_(t,Qa,u),$(At,t,u),_(t,Za,u),_(t,Ko,u),e(Ko,se),e(se,Yo),e(Yo,Hn),e(se,Un),e(se,zt),e(zt,Bn),e(se,Jn),e(se,qt),e(qt,Gn),e(se,Kn),_(t,er,u),_(t,Xo,u),e(Xo,Yn),_(t,tr,u),_(t,Qo,u),e(Qo,We),e(We,Zo),e(Zo,Xn),e(We,Qn),e(We,Nt),e(Nt,Zn),e(We,ei),_(t,or,u),_(t,es,u),e(es,ti),_(t,sr,u),_(t,de,u),e(de,Le),e(Le,Ls),$(Ot,Ls,null),e(de,oi),e(de,Ss),e(Ss,si),_(t,ar,u),_(t,q,u),$(Wt,q,null),e(q,ai),e(q,ce),e(ce,ri),e(ce,ts),e(ts,ni),e(ce,ii),e(ce,Lt),e(Lt,li),e(ce,di),e(q,ci),e(q,me),e(me,mi),e(me,os),e(os,pi),e(me,hi),e(me,ss),e(ss,fi),e(me,gi),e(q,ui),$(Se,q,null),_(t,rr,u),_(t,pe,u),e(pe,Ve),e(Ve,Vs),$(St,Vs,null),e(pe,_i),e(pe,Rs),e(Rs,Ti),_(t,nr,u),_(t,he,u),$(Vt,he,null),e(he,bi),e(he,Re),$(Rt,Re,null),e(Re,vi),e(Re,Hs),e(Hs,wi),_(t,ir,u),_(t,fe,u),e(fe,He),e(He,Us),$(Ht,Us,null),e(fe,$i),e(fe,Bs),e(Bs,yi),_(t,lr,u),_(t,X,u),$(Ut,X,null),e(X,ki),e(X,Js),e(Js,Di),e(X,Ii),e(X,Ue),$(Bt,Ue,null),e(Ue,Fi),e(Ue,Gs),e(Gs,Mi),_(t,dr,u),_(t,ge,u),e(ge,Be),e(Be,Ks),$(Jt,Ks,null),e(ge,xi),e(ge,Ys),e(Ys,ji),_(t,cr,u),_(t,Q,u),$(Gt,Q,null),e(Q,Pi),e(Q,Kt),e(Kt,Ei),e(Kt,Yt),e(Yt,Ci),e(Kt,Ai),e(Q,zi),e(Q,S),$(Xt,S,null),e(S,qi),e(S,ue),e(ue,Ni),e(ue,as),e(as,Oi),e(ue,Wi),e(ue,Xs),e(Xs,Li),e(ue,Si),e(S,Vi),$(Je,S,null),e(S,Ri),$(Ge,S,null),_(t,mr,u),_(t,_e,u),e(_e,Ke),e(Ke,Qs),$(Qt,Qs,null),e(_e,Hi),e(_e,Zs),e(Zs,Ui),_(t,pr,u),_(t,C,u),$(Zt,C,null),e(C,Bi),e(C,eo),e(eo,Ji),e(eo,to),e(to,Gi),e(eo,Ki),e(C,Yi),$(Ye,C,null),e(C,Xi),e(C,oo),e(oo,Qi),e(oo,so),e(so,Zi),e(oo,el),e(C,tl),e(C,V),$(ao,V,null),e(V,ol),e(V,Te),e(Te,sl),e(Te,rs),e(rs,al),e(Te,rl),e(Te,ea),e(ea,nl),e(Te,il),e(V,ll),$(Xe,V,null),e(V,dl),$(Qe,V,null),_(t,hr,u),_(t,be,u),e(be,Ze),e(Ze,ta),$(ro,ta,null),e(be,cl),e(be,oa),e(oa,ml),_(t,fr,u),_(t,N,u),$(no,N,null),e(N,pl),e(N,sa),e(sa,hl),e(N,fl),e(N,io),e(io,gl),e(io,lo),e(lo,ul),e(io,_l),e(N,Tl),e(N,R),$(co,R,null),e(R,bl),e(R,ve),e(ve,vl),e(ve,ns),e(ns,wl),e(ve,$l),e(ve,aa),e(aa,yl),e(ve,kl),e(R,Dl),$(et,R,null),e(R,Il),$(tt,R,null),_(t,gr,u),_(t,we,u),e(we,ot),e(ot,ra),$(mo,ra,null),e(we,Fl),e(we,na),e(na,Ml),_(t,ur,u),_(t,j,u),$(po,j,null),e(j,xl),e(j,ia),e(ia,jl),e(j,Pl),e(j,la),e(la,El),e(j,Cl),e(j,da),e(da,Al),e(j,zl),e(j,ho),e(ho,ql),e(ho,fo),e(fo,Nl),e(ho,Ol),e(j,Wl),e(j,H),$(go,H,null),e(H,Ll),e(H,$e),e($e,Sl),e($e,is),e(is,Vl),e($e,Rl),e($e,ca),e(ca,Hl),e($e,Ul),e(H,Bl),$(st,H,null),e(H,Jl),$(at,H,null),_(t,_r,u),_(t,ye,u),e(ye,rt),e(rt,ma),$(uo,ma,null),e(ye,Gl),e(ye,pa),e(pa,Kl),_(t,Tr,u),_(t,Z,u),$(_o,Z,null),e(Z,Yl),e(Z,To),e(To,Xl),e(To,bo),e(bo,Ql),e(To,Zl),e(Z,ed),e(Z,U),$(vo,U,null),e(U,td),e(U,ke),e(ke,od),e(ke,ls),e(ls,sd),e(ke,ad),e(ke,ha),e(ha,rd),e(ke,nd),e(U,id),$(nt,U,null),e(U,ld),$(it,U,null),_(t,br,u),_(t,De,u),e(De,lt),e(lt,fa),$(wo,fa,null),e(De,dd),e(De,ga),e(ga,cd),_(t,vr,u),_(t,ee,u),$($o,ee,null),e(ee,md),e(ee,Ie),e(Ie,pd),e(Ie,yo),e(yo,hd),e(Ie,fd),e(Ie,ko),e(ko,gd),e(Ie,ud),e(ee,_d),e(ee,B),$(Do,B,null),e(B,Td),e(B,Fe),e(Fe,bd),e(Fe,ds),e(ds,vd),e(Fe,wd),e(Fe,ua),e(ua,$d),e(Fe,yd),e(B,kd),$(dt,B,null),e(B,Dd),$(ct,B,null),_(t,wr,u),_(t,Me,u),e(Me,mt),e(mt,_a),$(Io,_a,null),e(Me,Id),e(Me,Ta),e(Ta,Fd),_(t,$r,u),_(t,O,u),$(Fo,O,null),e(O,Md),e(O,ba),e(ba,xd),e(O,jd),e(O,Mo),e(Mo,Pd),e(Mo,xo),e(xo,Ed),e(Mo,Cd),e(O,Ad),e(O,J),$(jo,J,null),e(J,zd),e(J,xe),e(xe,qd),e(xe,cs),e(cs,Nd),e(xe,Od),e(xe,va),e(va,Wd),e(xe,Ld),e(J,Sd),$(pt,J,null),e(J,Vd),$(ht,J,null),_(t,yr,u),_(t,je,u),e(je,ft),e(ft,wa),$(Po,wa,null),e(je,Rd),e(je,$a),e($a,Hd),_(t,kr,u),_(t,P,u),$(Eo,P,null),e(P,Ud),e(P,ya),e(ya,Bd),e(P,Jd),e(P,ka),e(ka,Gd),e(P,Kd),e(P,Da),e(Da,Yd),e(P,Xd),e(P,Co),e(Co,Qd),e(Co,Ao),e(Ao,Zd),e(Co,ec),e(P,tc),e(P,G),$(zo,G,null),e(G,oc),e(G,Pe),e(Pe,sc),e(Pe,ms),e(ms,ac),e(Pe,rc),e(Pe,Ia),e(Ia,nc),e(Pe,ic),e(G,lc),$(gt,G,null),e(G,dc),$(ut,G,null),Dr=!0},p(t,[u]){const qo={};u&2&&(qo.$$scope={dirty:u,ctx:t}),qe.$set(qo);const Fa={};u&2&&(Fa.$$scope={dirty:u,ctx:t}),Se.$set(Fa);const Ma={};u&2&&(Ma.$$scope={dirty:u,ctx:t}),Je.$set(Ma);const xa={};u&2&&(xa.$$scope={dirty:u,ctx:t}),Ge.$set(xa);const No={};u&2&&(No.$$scope={dirty:u,ctx:t}),Ye.$set(No);const ja={};u&2&&(ja.$$scope={dirty:u,ctx:t}),Xe.$set(ja);const Pa={};u&2&&(Pa.$$scope={dirty:u,ctx:t}),Qe.$set(Pa);const Ea={};u&2&&(Ea.$$scope={dirty:u,ctx:t}),et.$set(Ea);const te={};u&2&&(te.$$scope={dirty:u,ctx:t}),tt.$set(te);const Ca={};u&2&&(Ca.$$scope={dirty:u,ctx:t}),st.$set(Ca);const Aa={};u&2&&(Aa.$$scope={dirty:u,ctx:t}),at.$set(Aa);const za={};u&2&&(za.$$scope={dirty:u,ctx:t}),nt.$set(za);const qa={};u&2&&(qa.$$scope={dirty:u,ctx:t}),it.$set(qa);const Na={};u&2&&(Na.$$scope={dirty:u,ctx:t}),dt.$set(Na);const Oa={};u&2&&(Oa.$$scope={dirty:u,ctx:t}),ct.$set(Oa);const Wa={};u&2&&(Wa.$$scope={dirty:u,ctx:t}),pt.$set(Wa);const W={};u&2&&(W.$$scope={dirty:u,ctx:t}),ht.$set(W);const La={};u&2&&(La.$$scope={dirty:u,ctx:t}),gt.$set(La);const Ee={};u&2&&(Ee.$$scope={dirty:u,ctx:t}),ut.$set(Ee)},i(t){Dr||(y(s.$$.fragment,t),y(qe.$$.fragment,t),y(Mt.$$.fragment,t),y(Ct.$$.fragment,t),y(At.$$.fragment,t),y(Ot.$$.fragment,t),y(Wt.$$.fragment,t),y(Se.$$.fragment,t),y(St.$$.fragment,t),y(Vt.$$.fragment,t),y(Rt.$$.fragment,t),y(Ht.$$.fragment,t),y(Ut.$$.fragment,t),y(Bt.$$.fragment,t),y(Jt.$$.fragment,t),y(Gt.$$.fragment,t),y(Xt.$$.fragment,t),y(Je.$$.fragment,t),y(Ge.$$.fragment,t),y(Qt.$$.fragment,t),y(Zt.$$.fragment,t),y(Ye.$$.fragment,t),y(ao.$$.fragment,t),y(Xe.$$.fragment,t),y(Qe.$$.fragment,t),y(ro.$$.fragment,t),y(no.$$.fragment,t),y(co.$$.fragment,t),y(et.$$.fragment,t),y(tt.$$.fragment,t),y(mo.$$.fragment,t),y(po.$$.fragment,t),y(go.$$.fragment,t),y(st.$$.fragment,t),y(at.$$.fragment,t),y(uo.$$.fragment,t),y(_o.$$.fragment,t),y(vo.$$.fragment,t),y(nt.$$.fragment,t),y(it.$$.fragment,t),y(wo.$$.fragment,t),y($o.$$.fragment,t),y(Do.$$.fragment,t),y(dt.$$.fragment,t),y(ct.$$.fragment,t),y(Io.$$.fragment,t),y(Fo.$$.fragment,t),y(jo.$$.fragment,t),y(pt.$$.fragment,t),y(ht.$$.fragment,t),y(Po.$$.fragment,t),y(Eo.$$.fragment,t),y(zo.$$.fragment,t),y(gt.$$.fragment,t),y(ut.$$.fragment,t),Dr=!0)},o(t){k(s.$$.fragment,t),k(qe.$$.fragment,t),k(Mt.$$.fragment,t),k(Ct.$$.fragment,t),k(At.$$.fragment,t),k(Ot.$$.fragment,t),k(Wt.$$.fragment,t),k(Se.$$.fragment,t),k(St.$$.fragment,t),k(Vt.$$.fragment,t),k(Rt.$$.fragment,t),k(Ht.$$.fragment,t),k(Ut.$$.fragment,t),k(Bt.$$.fragment,t),k(Jt.$$.fragment,t),k(Gt.$$.fragment,t),k(Xt.$$.fragment,t),k(Je.$$.fragment,t),k(Ge.$$.fragment,t),k(Qt.$$.fragment,t),k(Zt.$$.fragment,t),k(Ye.$$.fragment,t),k(ao.$$.fragment,t),k(Xe.$$.fragment,t),k(Qe.$$.fragment,t),k(ro.$$.fragment,t),k(no.$$.fragment,t),k(co.$$.fragment,t),k(et.$$.fragment,t),k(tt.$$.fragment,t),k(mo.$$.fragment,t),k(po.$$.fragment,t),k(go.$$.fragment,t),k(st.$$.fragment,t),k(at.$$.fragment,t),k(uo.$$.fragment,t),k(_o.$$.fragment,t),k(vo.$$.fragment,t),k(nt.$$.fragment,t),k(it.$$.fragment,t),k(wo.$$.fragment,t),k($o.$$.fragment,t),k(Do.$$.fragment,t),k(dt.$$.fragment,t),k(ct.$$.fragment,t),k(Io.$$.fragment,t),k(Fo.$$.fragment,t),k(jo.$$.fragment,t),k(pt.$$.fragment,t),k(ht.$$.fragment,t),k(Po.$$.fragment,t),k(Eo.$$.fragment,t),k(zo.$$.fragment,t),k(gt.$$.fragment,t),k(ut.$$.fragment,t),Dr=!1},d(t){o(d),t&&o(b),t&&o(g),D(s),t&&o(Va),D(qe,t),t&&o(Ra),t&&o(ne),D(Mt),t&&o(Ha),t&&o(L),t&&o(Ua),t&&o(Lo),t&&o(Ba),t&&o(So),t&&o(Ja),t&&o(Vo),t&&o(Ga),t&&o(A),t&&o(Ka),t&&o(oe),t&&o(Ya),t&&o(le),D(Ct),t&&o(Xa),t&&o(Go),t&&o(Qa),D(At,t),t&&o(Za),t&&o(Ko),t&&o(er),t&&o(Xo),t&&o(tr),t&&o(Qo),t&&o(or),t&&o(es),t&&o(sr),t&&o(de),D(Ot),t&&o(ar),t&&o(q),D(Wt),D(Se),t&&o(rr),t&&o(pe),D(St),t&&o(nr),t&&o(he),D(Vt),D(Rt),t&&o(ir),t&&o(fe),D(Ht),t&&o(lr),t&&o(X),D(Ut),D(Bt),t&&o(dr),t&&o(ge),D(Jt),t&&o(cr),t&&o(Q),D(Gt),D(Xt),D(Je),D(Ge),t&&o(mr),t&&o(_e),D(Qt),t&&o(pr),t&&o(C),D(Zt),D(Ye),D(ao),D(Xe),D(Qe),t&&o(hr),t&&o(be),D(ro),t&&o(fr),t&&o(N),D(no),D(co),D(et),D(tt),t&&o(gr),t&&o(we),D(mo),t&&o(ur),t&&o(j),D(po),D(go),D(st),D(at),t&&o(_r),t&&o(ye),D(uo),t&&o(Tr),t&&o(Z),D(_o),D(vo),D(nt),D(it),t&&o(br),t&&o(De),D(wo),t&&o(vr),t&&o(ee),D($o),D(Do),D(dt),D(ct),t&&o(wr),t&&o(Me),D(Io),t&&o($r),t&&o(O),D(Fo),D(jo),D(pt),D(ht),t&&o(yr),t&&o(je),D(Po),t&&o(kr),t&&o(P),D(Eo),D(zo),D(gt),D(ut)}}}const Mp={local:"deit",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.DeiTConfig",title:"DeiTConfig"},{local:"transformers.DeiTFeatureExtractor",title:"DeiTFeatureExtractor"},{local:"transformers.DeiTImageProcessor",title:"DeiTImageProcessor"},{local:"transformers.DeiTModel",title:"DeiTModel"},{local:"transformers.DeiTForMaskedImageModeling",title:"DeiTForMaskedImageModeling"},{local:"transformers.DeiTForImageClassification",title:"DeiTForImageClassification"},{local:"transformers.DeiTForImageClassificationWithTeacher",title:"DeiTForImageClassificationWithTeacher"},{local:"transformers.TFDeiTModel",title:"TFDeiTModel"},{local:"transformers.TFDeiTForMaskedImageModeling",title:"TFDeiTForMaskedImageModeling"},{local:"transformers.TFDeiTForImageClassification",title:"TFDeiTForImageClassification"},{local:"transformers.TFDeiTForImageClassificationWithTeacher",title:"TFDeiTForImageClassificationWithTeacher"}],title:"DeiT"};function xp(I){return np(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Np extends op{constructor(d){super();sp(this,d,xp,Fp,ap,{})}}export{Np as default,Mp as metadata};
