import{S as am,i as rm,s as nm,e as a,k as f,w as v,t as i,M as im,c as r,d as o,m as g,a as n,x as w,h as l,b as m,G as e,g as T,y as $,q as y,o as D,B as k,v as lm,L as Ce}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 Ee}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as W}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as je}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function dm(I){let d,b,h,p,_;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 `),h=a("a"),p=i("Github Issue"),_=i("."),this.h()},l(s){d=r(s,"P",{});var c=n(d);b=l(c,`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 `),h=r(c,"A",{href:!0,rel:!0});var F=n(h);p=l(F,"Github Issue"),F.forEach(o),_=l(c,"."),c.forEach(o),this.h()},h(){m(h,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),m(h,"rel","nofollow")},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function cm(I){let d,b,h,p,_;return p=new Ee({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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Example:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function mm(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function pm(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, DeiTModel
import torch
from datasets import load_dataset

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

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

inputs = feature_extractor(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> DeiTImageProcessor, 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>feature_extractor = DeiTImageProcessor.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 = feature_extractor(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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Example:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function hm(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Note that we provide a script to pre-train this model on custom data in our "),h=a("a"),p=i(`examples
directory`),_=i("."),this.h()},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Note that we provide a script to pre-train this model on custom data in our "),h=r(c,"A",{href:!0,rel:!0});var F=n(h);p=l(F,`examples
directory`),F.forEach(o),_=l(c,"."),c.forEach(o),this.h()},h(){m(h,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),m(h,"rel","nofollow")},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function fm(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function gm(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, 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 = DeiTImageProcessor.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> DeiTImageProcessor, 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 = DeiTImageProcessor.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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Examples:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function um(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function _m(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, 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 = DeiTImageProcessor.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> DeiTImageProcessor, 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 = DeiTImageProcessor.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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Examples:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function Tm(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function bm(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, DeiTForImageClassificationWithTeacher
import torch
from datasets import load_dataset

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

feature_extractor = DeiTImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = DeiTForImageClassificationWithTeacher.from_pretrained("facebook/deit-base-distilled-patch16-224")

inputs = feature_extractor(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> DeiTImageProcessor, 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>feature_extractor = DeiTImageProcessor.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 = feature_extractor(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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Example:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function vm(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function wm(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, TFDeiTModel
from datasets import load_dataset

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

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

inputs = feature_extractor(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> DeiTImageProcessor, 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>feature_extractor = DeiTImageProcessor.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 = feature_extractor(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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Example:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function $m(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function ym(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, 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 = DeiTImageProcessor.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> DeiTImageProcessor, 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 = DeiTImageProcessor.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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Examples:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function Dm(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function km(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, 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 = DeiTImageProcessor.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> DeiTImageProcessor, 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 = DeiTImageProcessor.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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Examples:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function Im(I){let d,b,h,p,_;return{c(){d=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),p=i("Module"),_=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 c=n(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(c,"CODE",{});var F=n(h);p=l(F,"Module"),F.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(s,c){T(s,d,c),e(d,b),e(d,h),e(h,p),e(d,_)},d(s){s&&o(d)}}}function Fm(I){let d,b,h,p,_;return p=new Ee({props:{code:`from transformers import DeiTImageProcessor, TFDeiTForImageClassificationWithTeacher
import tensorflow as tf
from datasets import load_dataset

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

feature_extractor = DeiTImageProcessor.from_pretrained("facebook/deit-base-distilled-patch16-224")
model = TFDeiTForImageClassificationWithTeacher.from_pretrained("facebook/deit-base-distilled-patch16-224")

inputs = feature_extractor(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> DeiTImageProcessor, 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>feature_extractor = DeiTImageProcessor.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 = feature_extractor(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:"),h=f(),v(p.$$.fragment)},l(s){d=r(s,"P",{});var c=n(d);b=l(c,"Example:"),c.forEach(o),h=g(s),w(p.$$.fragment,s)},m(s,c){T(s,d,c),e(d,b),T(s,h,c),$(p,s,c),_=!0},p:Ce,i(s){_||(y(p.$$.fragment,s),_=!0)},o(s){D(p.$$.fragment,s),_=!1},d(s){s&&o(d),s&&o(h),k(p,s)}}}function Mm(I){let d,b,h,p,_,s,c,F,$r,Da,ze,ka,ne,qe,ps,Dt,yr,hs,Dr,Ia,L,kr,kt,Ir,Fr,xo,Mr,xr,It,Pr,jr,Fa,Po,Cr,Ma,jo,fs,Er,xa,Co,zr,Pa,z,gs,qr,Nr,ie,Ar,Eo,Or,Wr,zo,Lr,Sr,Rr,us,Vr,Ur,_s,Hr,Br,x,Gr,qo,Jr,Kr,No,Yr,Xr,Ts,Qr,Zr,bs,en,tn,vs,on,sn,ws,an,rn,Ao,nn,ln,ja,se,dn,Ft,cn,mn,Mt,pn,hn,Ca,le,Ne,$s,xt,fn,ys,gn,Ea,q,Pt,un,de,_n,Oo,Tn,bn,jt,vn,wn,$n,ce,yn,Wo,Dn,kn,Lo,In,Fn,Mn,Ae,za,me,Oe,Ds,Ct,xn,ks,Pn,qa,X,Et,jn,Is,Cn,En,We,zt,zn,Fs,qn,Na,pe,Le,Ms,qt,Nn,xs,An,Aa,Q,Nt,On,Ps,Wn,Ln,Se,At,Sn,js,Rn,Oa,he,Re,Cs,Ot,Vn,Es,Un,Wa,Z,Wt,Hn,Lt,Bn,St,Gn,Jn,Kn,S,Rt,Yn,fe,Xn,So,Qn,Zn,zs,ei,ti,oi,Ve,si,Ue,La,ge,He,qs,Vt,ai,Ns,ri,Sa,E,Ut,ni,Ht,ii,Bt,li,di,ci,Be,mi,Gt,pi,Jt,hi,fi,gi,R,Kt,ui,ue,_i,Ro,Ti,bi,As,vi,wi,$i,Ge,yi,Je,Ra,_e,Ke,Os,Yt,Di,Ws,ki,Va,N,Xt,Ii,Ls,Fi,Mi,Qt,xi,Zt,Pi,ji,Ci,V,eo,Ei,Te,zi,Vo,qi,Ni,Ss,Ai,Oi,Wi,Ye,Li,Xe,Ua,be,Qe,Rs,to,Si,Vs,Ri,Ha,P,oo,Vi,Us,Ui,Hi,Hs,Bi,Gi,Bs,Ji,Ki,so,Yi,ao,Xi,Qi,Zi,U,ro,el,ve,tl,Uo,ol,sl,Gs,al,rl,nl,Ze,il,et,Ba,we,tt,Js,no,ll,Ks,dl,Ga,ee,io,cl,lo,ml,co,pl,hl,fl,H,mo,gl,$e,ul,Ho,_l,Tl,Ys,bl,vl,wl,ot,$l,st,Ja,ye,at,Xs,po,yl,Qs,Dl,Ka,te,ho,kl,De,Il,fo,Fl,Ml,go,xl,Pl,jl,B,uo,Cl,ke,El,Bo,zl,ql,Zs,Nl,Al,Ol,rt,Wl,nt,Ya,Ie,it,ea,_o,Ll,ta,Sl,Xa,A,To,Rl,oa,Vl,Ul,bo,Hl,vo,Bl,Gl,Jl,G,wo,Kl,Fe,Yl,Go,Xl,Ql,sa,Zl,ed,td,lt,od,dt,Qa,Me,ct,aa,$o,sd,ra,ad,Za,j,yo,rd,na,nd,id,ia,ld,dd,la,cd,md,Do,pd,ko,hd,fd,gd,J,Io,ud,xe,_d,Jo,Td,bd,da,vd,wd,$d,mt,yd,pt,er;return s=new W({}),ze=new re({props:{$$slots:{default:[dm]},$$scope:{ctx:I}}}),Dt=new W({}),xt=new W({}),Pt=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:"is_encoder_decoder",val:" = False"},{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/v4.25.1/src/transformers/models/deit/configuration_deit.py#L37"}}),Ae=new je({props:{anchor:"transformers.DeiTConfig.example",$$slots:{default:[cm]},$$scope:{ctx:I}}}),Ct=new W({}),Et=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 = <Resampling.BICUBIC: 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/v4.25.1/src/transformers/models/deit/image_processing_deit.py#L46"}}),zt=new M({props:{name:"__call__",anchor:"transformers.DeiTImageProcessor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/image_processing_utils.py#L435"}}),qt=new W({}),Nt=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 = <Resampling.BICUBIC: 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/v4.25.1/src/transformers/models/deit/image_processing_deit.py#L46"}}),At=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/v4.25.1/src/transformers/models/deit/image_processing_deit.py#L208"}}),Ot=new W({}),Wt=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_deit.py#L460"}}),Rt=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_deit.py#L485",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new re({props:{$$slots:{default:[mm]},$$scope:{ctx:I}}}),Ue=new je({props:{anchor:"transformers.DeiTModel.forward.example",$$slots:{default:[pm]},$$scope:{ctx:I}}}),Vt=new W({}),Ut=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_deit.py#L577"}}),Be=new re({props:{$$slots:{default:[hm]},$$scope:{ctx:I}}}),Kt=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/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/v4.25.1/src/transformers/models/deit/modeling_deit.py#L595",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new re({props:{$$slots:{default:[fm]},$$scope:{ctx:I}}}),Je=new je({props:{anchor:"transformers.DeiTForMaskedImageModeling.forward.example",$$slots:{default:[gm]},$$scope:{ctx:I}}}),Yt=new W({}),Xt=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_deit.py#L689"}}),eo=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/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/v4.25.1/src/transformers/models/deit/modeling_deit.py#L702",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ye=new re({props:{$$slots:{default:[um]},$$scope:{ctx:I}}}),Xe=new je({props:{anchor:"transformers.DeiTForImageClassification.forward.example",$$slots:{default:[_m]},$$scope:{ctx:I}}}),to=new W({}),oo=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_deit.py#L838"}}),ro=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_deit.py#L856",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/v4.25.1/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>
`}}),Ze=new re({props:{$$slots:{default:[Tm]},$$scope:{ctx:I}}}),et=new je({props:{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.example",$$slots:{default:[bm]},$$scope:{ctx:I}}}),no=new W({}),io=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L641"}}),mo=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L651",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ot=new re({props:{$$slots:{default:[vm]},$$scope:{ctx:I}}}),st=new je({props:{anchor:"transformers.TFDeiTModel.call.example",$$slots:{default:[wm]},$$scope:{ctx:I}}}),po=new W({}),ho=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L761"}}),uo=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/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/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L768",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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/v4.25.1/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/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),rt=new re({props:{$$slots:{default:[$m]},$$scope:{ctx:I}}}),nt=new je({props:{anchor:"transformers.TFDeiTForMaskedImageModeling.call.example",$$slots:{default:[ym]},$$scope:{ctx:I}}}),_o=new W({}),To=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L882"}}),wo=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/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/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L896",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/v4.25.1/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>
`}}),lt=new re({props:{$$slots:{default:[Dm]},$$scope:{ctx:I}}}),dt=new je({props:{anchor:"transformers.TFDeiTForImageClassification.call.example",$$slots:{default:[km]},$$scope:{ctx:I}}}),$o=new W({}),yo=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/v4.25.1/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/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L990"}}),Io=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/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor">DeiTImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/deit/modeling_tf_deit.py#L1009",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/v4.25.1/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>
`}}),mt=new re({props:{$$slots:{default:[Im]},$$scope:{ctx:I}}}),pt=new je({props:{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.example",$$slots:{default:[Fm]},$$scope:{ctx:I}}}),{c(){d=a("meta"),b=f(),h=a("h1"),p=a("a"),_=a("span"),v(s.$$.fragment),c=f(),F=a("span"),$r=i("DeiT"),Da=f(),v(ze.$$.fragment),ka=f(),ne=a("h2"),qe=a("a"),ps=a("span"),v(Dt.$$.fragment),yr=f(),hs=a("span"),Dr=i("Overview"),Ia=f(),L=a("p"),kr=i("The DeiT model was proposed in "),kt=a("a"),Ir=i("Training data-efficient image transformers & distillation through attention"),Fr=i(` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),xo=a("a"),Mr=i("Vision Transformer (ViT)"),xr=i(" introduced in "),It=a("a"),Pr=i("Dosovitskiy et al., 2020"),jr=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.`),Fa=f(),Po=a("p"),Cr=i("The abstract from the paper is the following:"),Ma=f(),jo=a("p"),fs=a("em"),Er=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.`),xa=f(),Co=a("p"),zr=i("Tips:"),Pa=f(),z=a("ul"),gs=a("li"),qr=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.`),Nr=f(),ie=a("li"),Ar=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
`),Eo=a("a"),Or=i("DeiTForImageClassification"),Wr=i(` and (2) corresponds to
`),zo=a("a"),Lr=i("DeiTForImageClassificationWithTeacher"),Sr=i("."),Rr=f(),us=a("li"),Vr=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.`),Ur=f(),_s=a("li"),Hr=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.`),Br=f(),x=a("li"),Gr=i(`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),qo=a("a"),Jr=i("ViTModel"),Kr=i(" or "),No=a("a"),Yr=i("ViTForImageClassification"),Xr=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):
`),Ts=a("em"),Qr=i("facebook/deit-tiny-patch16-224"),Zr=i(", "),bs=a("em"),en=i("facebook/deit-small-patch16-224"),tn=i(", "),vs=a("em"),on=i("facebook/deit-base-patch16-224"),sn=i(` and
`),ws=a("em"),an=i("facebook/deit-base-patch16-384"),rn=i(". Note that one should use "),Ao=a("a"),nn=i("DeiTImageProcessor"),ln=i(` in order to
prepare images for the model.`),ja=f(),se=a("p"),dn=i("This model was contributed by "),Ft=a("a"),cn=i("nielsr"),mn=i(". The TensorFlow version of this model was added by "),Mt=a("a"),pn=i("amyeroberts"),hn=i("."),Ca=f(),le=a("h2"),Ne=a("a"),$s=a("span"),v(xt.$$.fragment),fn=f(),ys=a("span"),gn=i("DeiTConfig"),Ea=f(),q=a("div"),v(Pt.$$.fragment),un=f(),de=a("p"),_n=i("This is the configuration class to store the configuration of a "),Oo=a("a"),Tn=i("DeiTModel"),bn=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
`),jt=a("a"),vn=i("facebook/deit-base-distilled-patch16-224"),wn=i(`
architecture.`),$n=f(),ce=a("p"),yn=i("Configuration objects inherit from "),Wo=a("a"),Dn=i("PretrainedConfig"),kn=i(` and can be used to control the model outputs. Read the
documentation from `),Lo=a("a"),In=i("PretrainedConfig"),Fn=i(" for more information."),Mn=f(),v(Ae.$$.fragment),za=f(),me=a("h2"),Oe=a("a"),Ds=a("span"),v(Ct.$$.fragment),xn=f(),ks=a("span"),Pn=i("DeiTFeatureExtractor"),qa=f(),X=a("div"),v(Et.$$.fragment),jn=f(),Is=a("p"),Cn=i("Constructs a DeiT image processor."),En=f(),We=a("div"),v(zt.$$.fragment),zn=f(),Fs=a("p"),qn=i("Preprocess an image or a batch of images."),Na=f(),pe=a("h2"),Le=a("a"),Ms=a("span"),v(qt.$$.fragment),Nn=f(),xs=a("span"),An=i("DeiTImageProcessor"),Aa=f(),Q=a("div"),v(Nt.$$.fragment),On=f(),Ps=a("p"),Wn=i("Constructs a DeiT image processor."),Ln=f(),Se=a("div"),v(At.$$.fragment),Sn=f(),js=a("p"),Rn=i("Preprocess an image or batch of images."),Oa=f(),he=a("h2"),Re=a("a"),Cs=a("span"),v(Ot.$$.fragment),Vn=f(),Es=a("span"),Un=i("DeiTModel"),Wa=f(),Z=a("div"),v(Wt.$$.fragment),Hn=f(),Lt=a("p"),Bn=i(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),St=a("a"),Gn=i("torch.nn.Module"),Jn=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kn=f(),S=a("div"),v(Rt.$$.fragment),Yn=f(),fe=a("p"),Xn=i("The "),So=a("a"),Qn=i("DeiTModel"),Zn=i(" forward method, overrides the "),zs=a("code"),ei=i("__call__"),ti=i(" special method."),oi=f(),v(Ve.$$.fragment),si=f(),v(Ue.$$.fragment),La=f(),ge=a("h2"),He=a("a"),qs=a("span"),v(Vt.$$.fragment),ai=f(),Ns=a("span"),ri=i("DeiTForMaskedImageModeling"),Sa=f(),E=a("div"),v(Ut.$$.fragment),ni=f(),Ht=a("p"),ii=i("DeiT Model with a decoder on top for masked image modeling, as proposed in "),Bt=a("a"),li=i("SimMIM"),di=i("."),ci=f(),v(Be.$$.fragment),mi=f(),Gt=a("p"),pi=i("This model is a PyTorch "),Jt=a("a"),hi=i("torch.nn.Module"),fi=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gi=f(),R=a("div"),v(Kt.$$.fragment),ui=f(),ue=a("p"),_i=i("The "),Ro=a("a"),Ti=i("DeiTForMaskedImageModeling"),bi=i(" forward method, overrides the "),As=a("code"),vi=i("__call__"),wi=i(" special method."),$i=f(),v(Ge.$$.fragment),yi=f(),v(Je.$$.fragment),Ra=f(),_e=a("h2"),Ke=a("a"),Os=a("span"),v(Yt.$$.fragment),Di=f(),Ws=a("span"),ki=i("DeiTForImageClassification"),Va=f(),N=a("div"),v(Xt.$$.fragment),Ii=f(),Ls=a("p"),Fi=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.`),Mi=f(),Qt=a("p"),xi=i("This model is a PyTorch "),Zt=a("a"),Pi=i("torch.nn.Module"),ji=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ci=f(),V=a("div"),v(eo.$$.fragment),Ei=f(),Te=a("p"),zi=i("The "),Vo=a("a"),qi=i("DeiTForImageClassification"),Ni=i(" forward method, overrides the "),Ss=a("code"),Ai=i("__call__"),Oi=i(" special method."),Wi=f(),v(Ye.$$.fragment),Li=f(),v(Xe.$$.fragment),Ua=f(),be=a("h2"),Qe=a("a"),Rs=a("span"),v(to.$$.fragment),Si=f(),Vs=a("span"),Ri=i("DeiTForImageClassificationWithTeacher"),Ha=f(),P=a("div"),v(oo.$$.fragment),Vi=f(),Us=a("p"),Ui=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.`),Hi=f(),Hs=a("p"),Bi=i(".. warning::"),Gi=f(),Bs=a("p"),Ji=i(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Ki=f(),so=a("p"),Yi=i("This model is a PyTorch "),ao=a("a"),Xi=i("torch.nn.Module"),Qi=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=f(),U=a("div"),v(ro.$$.fragment),el=f(),ve=a("p"),tl=i("The "),Uo=a("a"),ol=i("DeiTForImageClassificationWithTeacher"),sl=i(" forward method, overrides the "),Gs=a("code"),al=i("__call__"),rl=i(" special method."),nl=f(),v(Ze.$$.fragment),il=f(),v(et.$$.fragment),Ba=f(),we=a("h2"),tt=a("a"),Js=a("span"),v(no.$$.fragment),ll=f(),Ks=a("span"),dl=i("TFDeiTModel"),Ga=f(),ee=a("div"),v(io.$$.fragment),cl=f(),lo=a("p"),ml=i(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),co=a("a"),pl=i("tf.keras.layers.Layer"),hl=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),fl=f(),H=a("div"),v(mo.$$.fragment),gl=f(),$e=a("p"),ul=i("The "),Ho=a("a"),_l=i("TFDeiTModel"),Tl=i(" forward method, overrides the "),Ys=a("code"),bl=i("__call__"),vl=i(" special method."),wl=f(),v(ot.$$.fragment),$l=f(),v(st.$$.fragment),Ja=f(),ye=a("h2"),at=a("a"),Xs=a("span"),v(po.$$.fragment),yl=f(),Qs=a("span"),Dl=i("TFDeiTForMaskedImageModeling"),Ka=f(),te=a("div"),v(ho.$$.fragment),kl=f(),De=a("p"),Il=i("DeiT Model with a decoder on top for masked image modeling, as proposed in "),fo=a("a"),Fl=i("SimMIM"),Ml=i(`.
This model is a TensorFlow
`),go=a("a"),xl=i("tf.keras.layers.Layer"),Pl=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),jl=f(),B=a("div"),v(uo.$$.fragment),Cl=f(),ke=a("p"),El=i("The "),Bo=a("a"),zl=i("TFDeiTForMaskedImageModeling"),ql=i(" forward method, overrides the "),Zs=a("code"),Nl=i("__call__"),Al=i(" special method."),Ol=f(),v(rt.$$.fragment),Wl=f(),v(nt.$$.fragment),Ya=f(),Ie=a("h2"),it=a("a"),ea=a("span"),v(_o.$$.fragment),Ll=f(),ta=a("span"),Sl=i("TFDeiTForImageClassification"),Xa=f(),A=a("div"),v(To.$$.fragment),Rl=f(),oa=a("p"),Vl=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.`),Ul=f(),bo=a("p"),Hl=i(`This model is a TensorFlow
`),vo=a("a"),Bl=i("tf.keras.layers.Layer"),Gl=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Jl=f(),G=a("div"),v(wo.$$.fragment),Kl=f(),Fe=a("p"),Yl=i("The "),Go=a("a"),Xl=i("TFDeiTForImageClassification"),Ql=i(" forward method, overrides the "),sa=a("code"),Zl=i("__call__"),ed=i(" special method."),td=f(),v(lt.$$.fragment),od=f(),v(dt.$$.fragment),Qa=f(),Me=a("h2"),ct=a("a"),aa=a("span"),v($o.$$.fragment),sd=f(),ra=a("span"),ad=i("TFDeiTForImageClassificationWithTeacher"),Za=f(),j=a("div"),v(yo.$$.fragment),rd=f(),na=a("p"),nd=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.`),id=f(),ia=a("p"),ld=i(".. warning::"),dd=f(),la=a("p"),cd=i(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),md=f(),Do=a("p"),pd=i(`This model is a TensorFlow
`),ko=a("a"),hd=i("tf.keras.layers.Layer"),fd=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),gd=f(),J=a("div"),v(Io.$$.fragment),ud=f(),xe=a("p"),_d=i("The "),Jo=a("a"),Td=i("TFDeiTForImageClassificationWithTeacher"),bd=i(" forward method, overrides the "),da=a("code"),vd=i("__call__"),wd=i(" special method."),$d=f(),v(mt.$$.fragment),yd=f(),v(pt.$$.fragment),this.h()},l(t){const u=im('[data-svelte="svelte-1phssyn"]',document.head);d=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=g(t),h=r(t,"H1",{class:!0});var Fo=n(h);p=r(Fo,"A",{id:!0,class:!0,href:!0});var ca=n(p);_=r(ca,"SPAN",{});var ma=n(_);w(s.$$.fragment,ma),ma.forEach(o),ca.forEach(o),c=g(Fo),F=r(Fo,"SPAN",{});var pa=n(F);$r=l(pa,"DeiT"),pa.forEach(o),Fo.forEach(o),Da=g(t),w(ze.$$.fragment,t),ka=g(t),ne=r(t,"H2",{class:!0});var Mo=n(ne);qe=r(Mo,"A",{id:!0,class:!0,href:!0});var ha=n(qe);ps=r(ha,"SPAN",{});var fa=n(ps);w(Dt.$$.fragment,fa),fa.forEach(o),ha.forEach(o),yr=g(Mo),hs=r(Mo,"SPAN",{});var ga=n(hs);Dr=l(ga,"Overview"),ga.forEach(o),Mo.forEach(o),Ia=g(t),L=r(t,"P",{});var oe=n(L);kr=l(oe,"The DeiT model was proposed in "),kt=r(oe,"A",{href:!0,rel:!0});var ua=n(kt);Ir=l(ua,"Training data-efficient image transformers & distillation through attention"),ua.forEach(o),Fr=l(oe,` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),xo=r(oe,"A",{href:!0});var _a=n(xo);Mr=l(_a,"Vision Transformer (ViT)"),_a.forEach(o),xr=l(oe," introduced in "),It=r(oe,"A",{href:!0,rel:!0});var Ta=n(It);Pr=l(Ta,"Dosovitskiy et al., 2020"),Ta.forEach(o),jr=l(oe,` 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.`),oe.forEach(o),Fa=g(t),Po=r(t,"P",{});var ba=n(Po);Cr=l(ba,"The abstract from the paper is the following:"),ba.forEach(o),Ma=g(t),jo=r(t,"P",{});var va=n(jo);fs=r(va,"EM",{});var wa=n(fs);Er=l(wa,`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.`),wa.forEach(o),va.forEach(o),xa=g(t),Co=r(t,"P",{});var $a=n(Co);zr=l($a,"Tips:"),$a.forEach(o),Pa=g(t),z=r(t,"UL",{});var O=n(z);gs=r(O,"LI",{});var ya=n(gs);qr=l(ya,`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.`),ya.forEach(o),Nr=g(O),ie=r(O,"LI",{});var Pe=n(ie);Ar=l(Pe,`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
`),Eo=r(Pe,"A",{href:!0});var Dd=n(Eo);Or=l(Dd,"DeiTForImageClassification"),Dd.forEach(o),Wr=l(Pe,` and (2) corresponds to
`),zo=r(Pe,"A",{href:!0});var kd=n(zo);Lr=l(kd,"DeiTForImageClassificationWithTeacher"),kd.forEach(o),Sr=l(Pe,"."),Pe.forEach(o),Rr=g(O),us=r(O,"LI",{});var Id=n(us);Vr=l(Id,`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.`),Id.forEach(o),Ur=g(O),_s=r(O,"LI",{});var Fd=n(_s);Hr=l(Fd,`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.`),Fd.forEach(o),Br=g(O),x=r(O,"LI",{});var C=n(x);Gr=l(C,`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),qo=r(C,"A",{href:!0});var Md=n(qo);Jr=l(Md,"ViTModel"),Md.forEach(o),Kr=l(C," or "),No=r(C,"A",{href:!0});var xd=n(No);Yr=l(xd,"ViTForImageClassification"),xd.forEach(o),Xr=l(C,`. 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):
`),Ts=r(C,"EM",{});var Pd=n(Ts);Qr=l(Pd,"facebook/deit-tiny-patch16-224"),Pd.forEach(o),Zr=l(C,", "),bs=r(C,"EM",{});var jd=n(bs);en=l(jd,"facebook/deit-small-patch16-224"),jd.forEach(o),tn=l(C,", "),vs=r(C,"EM",{});var Cd=n(vs);on=l(Cd,"facebook/deit-base-patch16-224"),Cd.forEach(o),sn=l(C,` and
`),ws=r(C,"EM",{});var Ed=n(ws);an=l(Ed,"facebook/deit-base-patch16-384"),Ed.forEach(o),rn=l(C,". Note that one should use "),Ao=r(C,"A",{href:!0});var zd=n(Ao);nn=l(zd,"DeiTImageProcessor"),zd.forEach(o),ln=l(C,` in order to
prepare images for the model.`),C.forEach(o),O.forEach(o),ja=g(t),se=r(t,"P",{});var Ko=n(se);dn=l(Ko,"This model was contributed by "),Ft=r(Ko,"A",{href:!0,rel:!0});var qd=n(Ft);cn=l(qd,"nielsr"),qd.forEach(o),mn=l(Ko,". The TensorFlow version of this model was added by "),Mt=r(Ko,"A",{href:!0,rel:!0});var Nd=n(Mt);pn=l(Nd,"amyeroberts"),Nd.forEach(o),hn=l(Ko,"."),Ko.forEach(o),Ca=g(t),le=r(t,"H2",{class:!0});var tr=n(le);Ne=r(tr,"A",{id:!0,class:!0,href:!0});var Ad=n(Ne);$s=r(Ad,"SPAN",{});var Od=n($s);w(xt.$$.fragment,Od),Od.forEach(o),Ad.forEach(o),fn=g(tr),ys=r(tr,"SPAN",{});var Wd=n(ys);gn=l(Wd,"DeiTConfig"),Wd.forEach(o),tr.forEach(o),Ea=g(t),q=r(t,"DIV",{class:!0});var ht=n(q);w(Pt.$$.fragment,ht),un=g(ht),de=r(ht,"P",{});var Yo=n(de);_n=l(Yo,"This is the configuration class to store the configuration of a "),Oo=r(Yo,"A",{href:!0});var Ld=n(Oo);Tn=l(Ld,"DeiTModel"),Ld.forEach(o),bn=l(Yo,`. 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
`),jt=r(Yo,"A",{href:!0,rel:!0});var Sd=n(jt);vn=l(Sd,"facebook/deit-base-distilled-patch16-224"),Sd.forEach(o),wn=l(Yo,`
architecture.`),Yo.forEach(o),$n=g(ht),ce=r(ht,"P",{});var Xo=n(ce);yn=l(Xo,"Configuration objects inherit from "),Wo=r(Xo,"A",{href:!0});var Rd=n(Wo);Dn=l(Rd,"PretrainedConfig"),Rd.forEach(o),kn=l(Xo,` and can be used to control the model outputs. Read the
documentation from `),Lo=r(Xo,"A",{href:!0});var Vd=n(Lo);In=l(Vd,"PretrainedConfig"),Vd.forEach(o),Fn=l(Xo," for more information."),Xo.forEach(o),Mn=g(ht),w(Ae.$$.fragment,ht),ht.forEach(o),za=g(t),me=r(t,"H2",{class:!0});var or=n(me);Oe=r(or,"A",{id:!0,class:!0,href:!0});var Ud=n(Oe);Ds=r(Ud,"SPAN",{});var Hd=n(Ds);w(Ct.$$.fragment,Hd),Hd.forEach(o),Ud.forEach(o),xn=g(or),ks=r(or,"SPAN",{});var Bd=n(ks);Pn=l(Bd,"DeiTFeatureExtractor"),Bd.forEach(o),or.forEach(o),qa=g(t),X=r(t,"DIV",{class:!0});var Qo=n(X);w(Et.$$.fragment,Qo),jn=g(Qo),Is=r(Qo,"P",{});var Gd=n(Is);Cn=l(Gd,"Constructs a DeiT image processor."),Gd.forEach(o),En=g(Qo),We=r(Qo,"DIV",{class:!0});var sr=n(We);w(zt.$$.fragment,sr),zn=g(sr),Fs=r(sr,"P",{});var Jd=n(Fs);qn=l(Jd,"Preprocess an image or a batch of images."),Jd.forEach(o),sr.forEach(o),Qo.forEach(o),Na=g(t),pe=r(t,"H2",{class:!0});var ar=n(pe);Le=r(ar,"A",{id:!0,class:!0,href:!0});var Kd=n(Le);Ms=r(Kd,"SPAN",{});var Yd=n(Ms);w(qt.$$.fragment,Yd),Yd.forEach(o),Kd.forEach(o),Nn=g(ar),xs=r(ar,"SPAN",{});var Xd=n(xs);An=l(Xd,"DeiTImageProcessor"),Xd.forEach(o),ar.forEach(o),Aa=g(t),Q=r(t,"DIV",{class:!0});var Zo=n(Q);w(Nt.$$.fragment,Zo),On=g(Zo),Ps=r(Zo,"P",{});var Qd=n(Ps);Wn=l(Qd,"Constructs a DeiT image processor."),Qd.forEach(o),Ln=g(Zo),Se=r(Zo,"DIV",{class:!0});var rr=n(Se);w(At.$$.fragment,rr),Sn=g(rr),js=r(rr,"P",{});var Zd=n(js);Rn=l(Zd,"Preprocess an image or batch of images."),Zd.forEach(o),rr.forEach(o),Zo.forEach(o),Oa=g(t),he=r(t,"H2",{class:!0});var nr=n(he);Re=r(nr,"A",{id:!0,class:!0,href:!0});var ec=n(Re);Cs=r(ec,"SPAN",{});var tc=n(Cs);w(Ot.$$.fragment,tc),tc.forEach(o),ec.forEach(o),Vn=g(nr),Es=r(nr,"SPAN",{});var oc=n(Es);Un=l(oc,"DeiTModel"),oc.forEach(o),nr.forEach(o),Wa=g(t),Z=r(t,"DIV",{class:!0});var es=n(Z);w(Wt.$$.fragment,es),Hn=g(es),Lt=r(es,"P",{});var ir=n(Lt);Bn=l(ir,`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),St=r(ir,"A",{href:!0,rel:!0});var sc=n(St);Gn=l(sc,"torch.nn.Module"),sc.forEach(o),Jn=l(ir,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ir.forEach(o),Kn=g(es),S=r(es,"DIV",{class:!0});var ft=n(S);w(Rt.$$.fragment,ft),Yn=g(ft),fe=r(ft,"P",{});var ts=n(fe);Xn=l(ts,"The "),So=r(ts,"A",{href:!0});var ac=n(So);Qn=l(ac,"DeiTModel"),ac.forEach(o),Zn=l(ts," forward method, overrides the "),zs=r(ts,"CODE",{});var rc=n(zs);ei=l(rc,"__call__"),rc.forEach(o),ti=l(ts," special method."),ts.forEach(o),oi=g(ft),w(Ve.$$.fragment,ft),si=g(ft),w(Ue.$$.fragment,ft),ft.forEach(o),es.forEach(o),La=g(t),ge=r(t,"H2",{class:!0});var lr=n(ge);He=r(lr,"A",{id:!0,class:!0,href:!0});var nc=n(He);qs=r(nc,"SPAN",{});var ic=n(qs);w(Vt.$$.fragment,ic),ic.forEach(o),nc.forEach(o),ai=g(lr),Ns=r(lr,"SPAN",{});var lc=n(Ns);ri=l(lc,"DeiTForMaskedImageModeling"),lc.forEach(o),lr.forEach(o),Sa=g(t),E=r(t,"DIV",{class:!0});var ae=n(E);w(Ut.$$.fragment,ae),ni=g(ae),Ht=r(ae,"P",{});var dr=n(Ht);ii=l(dr,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),Bt=r(dr,"A",{href:!0,rel:!0});var dc=n(Bt);li=l(dc,"SimMIM"),dc.forEach(o),di=l(dr,"."),dr.forEach(o),ci=g(ae),w(Be.$$.fragment,ae),mi=g(ae),Gt=r(ae,"P",{});var cr=n(Gt);pi=l(cr,"This model is a PyTorch "),Jt=r(cr,"A",{href:!0,rel:!0});var cc=n(Jt);hi=l(cc,"torch.nn.Module"),cc.forEach(o),fi=l(cr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),cr.forEach(o),gi=g(ae),R=r(ae,"DIV",{class:!0});var gt=n(R);w(Kt.$$.fragment,gt),ui=g(gt),ue=r(gt,"P",{});var os=n(ue);_i=l(os,"The "),Ro=r(os,"A",{href:!0});var mc=n(Ro);Ti=l(mc,"DeiTForMaskedImageModeling"),mc.forEach(o),bi=l(os," forward method, overrides the "),As=r(os,"CODE",{});var pc=n(As);vi=l(pc,"__call__"),pc.forEach(o),wi=l(os," special method."),os.forEach(o),$i=g(gt),w(Ge.$$.fragment,gt),yi=g(gt),w(Je.$$.fragment,gt),gt.forEach(o),ae.forEach(o),Ra=g(t),_e=r(t,"H2",{class:!0});var mr=n(_e);Ke=r(mr,"A",{id:!0,class:!0,href:!0});var hc=n(Ke);Os=r(hc,"SPAN",{});var fc=n(Os);w(Yt.$$.fragment,fc),fc.forEach(o),hc.forEach(o),Di=g(mr),Ws=r(mr,"SPAN",{});var gc=n(Ws);ki=l(gc,"DeiTForImageClassification"),gc.forEach(o),mr.forEach(o),Va=g(t),N=r(t,"DIV",{class:!0});var ut=n(N);w(Xt.$$.fragment,ut),Ii=g(ut),Ls=r(ut,"P",{});var uc=n(Ls);Fi=l(uc,`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.`),uc.forEach(o),Mi=g(ut),Qt=r(ut,"P",{});var pr=n(Qt);xi=l(pr,"This model is a PyTorch "),Zt=r(pr,"A",{href:!0,rel:!0});var _c=n(Zt);Pi=l(_c,"torch.nn.Module"),_c.forEach(o),ji=l(pr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pr.forEach(o),Ci=g(ut),V=r(ut,"DIV",{class:!0});var _t=n(V);w(eo.$$.fragment,_t),Ei=g(_t),Te=r(_t,"P",{});var ss=n(Te);zi=l(ss,"The "),Vo=r(ss,"A",{href:!0});var Tc=n(Vo);qi=l(Tc,"DeiTForImageClassification"),Tc.forEach(o),Ni=l(ss," forward method, overrides the "),Ss=r(ss,"CODE",{});var bc=n(Ss);Ai=l(bc,"__call__"),bc.forEach(o),Oi=l(ss," special method."),ss.forEach(o),Wi=g(_t),w(Ye.$$.fragment,_t),Li=g(_t),w(Xe.$$.fragment,_t),_t.forEach(o),ut.forEach(o),Ua=g(t),be=r(t,"H2",{class:!0});var hr=n(be);Qe=r(hr,"A",{id:!0,class:!0,href:!0});var vc=n(Qe);Rs=r(vc,"SPAN",{});var wc=n(Rs);w(to.$$.fragment,wc),wc.forEach(o),vc.forEach(o),Si=g(hr),Vs=r(hr,"SPAN",{});var $c=n(Vs);Ri=l($c,"DeiTForImageClassificationWithTeacher"),$c.forEach(o),hr.forEach(o),Ha=g(t),P=r(t,"DIV",{class:!0});var K=n(P);w(oo.$$.fragment,K),Vi=g(K),Us=r(K,"P",{});var yc=n(Us);Ui=l(yc,`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.`),yc.forEach(o),Hi=g(K),Hs=r(K,"P",{});var Dc=n(Hs);Bi=l(Dc,".. warning::"),Dc.forEach(o),Gi=g(K),Bs=r(K,"P",{});var kc=n(Bs);Ji=l(kc,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),kc.forEach(o),Ki=g(K),so=r(K,"P",{});var fr=n(so);Yi=l(fr,"This model is a PyTorch "),ao=r(fr,"A",{href:!0,rel:!0});var Ic=n(ao);Xi=l(Ic,"torch.nn.Module"),Ic.forEach(o),Qi=l(fr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fr.forEach(o),Zi=g(K),U=r(K,"DIV",{class:!0});var Tt=n(U);w(ro.$$.fragment,Tt),el=g(Tt),ve=r(Tt,"P",{});var as=n(ve);tl=l(as,"The "),Uo=r(as,"A",{href:!0});var Fc=n(Uo);ol=l(Fc,"DeiTForImageClassificationWithTeacher"),Fc.forEach(o),sl=l(as," forward method, overrides the "),Gs=r(as,"CODE",{});var Mc=n(Gs);al=l(Mc,"__call__"),Mc.forEach(o),rl=l(as," special method."),as.forEach(o),nl=g(Tt),w(Ze.$$.fragment,Tt),il=g(Tt),w(et.$$.fragment,Tt),Tt.forEach(o),K.forEach(o),Ba=g(t),we=r(t,"H2",{class:!0});var gr=n(we);tt=r(gr,"A",{id:!0,class:!0,href:!0});var xc=n(tt);Js=r(xc,"SPAN",{});var Pc=n(Js);w(no.$$.fragment,Pc),Pc.forEach(o),xc.forEach(o),ll=g(gr),Ks=r(gr,"SPAN",{});var jc=n(Ks);dl=l(jc,"TFDeiTModel"),jc.forEach(o),gr.forEach(o),Ga=g(t),ee=r(t,"DIV",{class:!0});var rs=n(ee);w(io.$$.fragment,rs),cl=g(rs),lo=r(rs,"P",{});var ur=n(lo);ml=l(ur,`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),co=r(ur,"A",{href:!0,rel:!0});var Cc=n(co);pl=l(Cc,"tf.keras.layers.Layer"),Cc.forEach(o),hl=l(ur,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ur.forEach(o),fl=g(rs),H=r(rs,"DIV",{class:!0});var bt=n(H);w(mo.$$.fragment,bt),gl=g(bt),$e=r(bt,"P",{});var ns=n($e);ul=l(ns,"The "),Ho=r(ns,"A",{href:!0});var Ec=n(Ho);_l=l(Ec,"TFDeiTModel"),Ec.forEach(o),Tl=l(ns," forward method, overrides the "),Ys=r(ns,"CODE",{});var zc=n(Ys);bl=l(zc,"__call__"),zc.forEach(o),vl=l(ns," special method."),ns.forEach(o),wl=g(bt),w(ot.$$.fragment,bt),$l=g(bt),w(st.$$.fragment,bt),bt.forEach(o),rs.forEach(o),Ja=g(t),ye=r(t,"H2",{class:!0});var _r=n(ye);at=r(_r,"A",{id:!0,class:!0,href:!0});var qc=n(at);Xs=r(qc,"SPAN",{});var Nc=n(Xs);w(po.$$.fragment,Nc),Nc.forEach(o),qc.forEach(o),yl=g(_r),Qs=r(_r,"SPAN",{});var Ac=n(Qs);Dl=l(Ac,"TFDeiTForMaskedImageModeling"),Ac.forEach(o),_r.forEach(o),Ka=g(t),te=r(t,"DIV",{class:!0});var is=n(te);w(ho.$$.fragment,is),kl=g(is),De=r(is,"P",{});var ls=n(De);Il=l(ls,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),fo=r(ls,"A",{href:!0,rel:!0});var Oc=n(fo);Fl=l(Oc,"SimMIM"),Oc.forEach(o),Ml=l(ls,`.
This model is a TensorFlow
`),go=r(ls,"A",{href:!0,rel:!0});var Wc=n(go);xl=l(Wc,"tf.keras.layers.Layer"),Wc.forEach(o),Pl=l(ls,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ls.forEach(o),jl=g(is),B=r(is,"DIV",{class:!0});var vt=n(B);w(uo.$$.fragment,vt),Cl=g(vt),ke=r(vt,"P",{});var ds=n(ke);El=l(ds,"The "),Bo=r(ds,"A",{href:!0});var Lc=n(Bo);zl=l(Lc,"TFDeiTForMaskedImageModeling"),Lc.forEach(o),ql=l(ds," forward method, overrides the "),Zs=r(ds,"CODE",{});var Sc=n(Zs);Nl=l(Sc,"__call__"),Sc.forEach(o),Al=l(ds," special method."),ds.forEach(o),Ol=g(vt),w(rt.$$.fragment,vt),Wl=g(vt),w(nt.$$.fragment,vt),vt.forEach(o),is.forEach(o),Ya=g(t),Ie=r(t,"H2",{class:!0});var Tr=n(Ie);it=r(Tr,"A",{id:!0,class:!0,href:!0});var Rc=n(it);ea=r(Rc,"SPAN",{});var Vc=n(ea);w(_o.$$.fragment,Vc),Vc.forEach(o),Rc.forEach(o),Ll=g(Tr),ta=r(Tr,"SPAN",{});var Uc=n(ta);Sl=l(Uc,"TFDeiTForImageClassification"),Uc.forEach(o),Tr.forEach(o),Xa=g(t),A=r(t,"DIV",{class:!0});var wt=n(A);w(To.$$.fragment,wt),Rl=g(wt),oa=r(wt,"P",{});var Hc=n(oa);Vl=l(Hc,`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.`),Hc.forEach(o),Ul=g(wt),bo=r(wt,"P",{});var br=n(bo);Hl=l(br,`This model is a TensorFlow
`),vo=r(br,"A",{href:!0,rel:!0});var Bc=n(vo);Bl=l(Bc,"tf.keras.layers.Layer"),Bc.forEach(o),Gl=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),Jl=g(wt),G=r(wt,"DIV",{class:!0});var $t=n(G);w(wo.$$.fragment,$t),Kl=g($t),Fe=r($t,"P",{});var cs=n(Fe);Yl=l(cs,"The "),Go=r(cs,"A",{href:!0});var Gc=n(Go);Xl=l(Gc,"TFDeiTForImageClassification"),Gc.forEach(o),Ql=l(cs," forward method, overrides the "),sa=r(cs,"CODE",{});var Jc=n(sa);Zl=l(Jc,"__call__"),Jc.forEach(o),ed=l(cs," special method."),cs.forEach(o),td=g($t),w(lt.$$.fragment,$t),od=g($t),w(dt.$$.fragment,$t),$t.forEach(o),wt.forEach(o),Qa=g(t),Me=r(t,"H2",{class:!0});var vr=n(Me);ct=r(vr,"A",{id:!0,class:!0,href:!0});var Kc=n(ct);aa=r(Kc,"SPAN",{});var Yc=n(aa);w($o.$$.fragment,Yc),Yc.forEach(o),Kc.forEach(o),sd=g(vr),ra=r(vr,"SPAN",{});var Xc=n(ra);ad=l(Xc,"TFDeiTForImageClassificationWithTeacher"),Xc.forEach(o),vr.forEach(o),Za=g(t),j=r(t,"DIV",{class:!0});var Y=n(j);w(yo.$$.fragment,Y),rd=g(Y),na=r(Y,"P",{});var Qc=n(na);nd=l(Qc,`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.`),Qc.forEach(o),id=g(Y),ia=r(Y,"P",{});var Zc=n(ia);ld=l(Zc,".. warning::"),Zc.forEach(o),dd=g(Y),la=r(Y,"P",{});var em=n(la);cd=l(em,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),em.forEach(o),md=g(Y),Do=r(Y,"P",{});var wr=n(Do);pd=l(wr,`This model is a TensorFlow
`),ko=r(wr,"A",{href:!0,rel:!0});var tm=n(ko);hd=l(tm,"tf.keras.layers.Layer"),tm.forEach(o),fd=l(wr,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),wr.forEach(o),gd=g(Y),J=r(Y,"DIV",{class:!0});var yt=n(J);w(Io.$$.fragment,yt),ud=g(yt),xe=r(yt,"P",{});var ms=n(xe);_d=l(ms,"The "),Jo=r(ms,"A",{href:!0});var om=n(Jo);Td=l(om,"TFDeiTForImageClassificationWithTeacher"),om.forEach(o),bd=l(ms," forward method, overrides the "),da=r(ms,"CODE",{});var sm=n(da);vd=l(sm,"__call__"),sm.forEach(o),wd=l(ms," special method."),ms.forEach(o),$d=g(yt),w(mt.$$.fragment,yt),yd=g(yt),w(pt.$$.fragment,yt),yt.forEach(o),Y.forEach(o),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(xm)),m(p,"id","deit"),m(p,"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"),m(p,"href","#deit"),m(h,"class","relative group"),m(qe,"id","overview"),m(qe,"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"),m(qe,"href","#overview"),m(ne,"class","relative group"),m(kt,"href","https://arxiv.org/abs/2012.12877"),m(kt,"rel","nofollow"),m(xo,"href","vit"),m(It,"href","https://arxiv.org/abs/2010.11929"),m(It,"rel","nofollow"),m(Eo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTForImageClassification"),m(zo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),m(qo,"href","/docs/transformers/v4.25.1/en/model_doc/vit#transformers.ViTModel"),m(No,"href","/docs/transformers/v4.25.1/en/model_doc/vit#transformers.ViTForImageClassification"),m(Ao,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor"),m(Ft,"href","https://huggingface.co/nielsr"),m(Ft,"rel","nofollow"),m(Mt,"href","https://huggingface.co/amyeroberts"),m(Mt,"rel","nofollow"),m(Ne,"id","transformers.DeiTConfig"),m(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"),m(Ne,"href","#transformers.DeiTConfig"),m(le,"class","relative group"),m(Oo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTModel"),m(jt,"href","https://huggingface.co/facebook/deit-base-distilled-patch16-224"),m(jt,"rel","nofollow"),m(Wo,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),m(Lo,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),m(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Oe,"id","transformers.DeiTImageProcessor"),m(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"),m(Oe,"href","#transformers.DeiTImageProcessor"),m(me,"class","relative group"),m(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Le,"id","transformers.DeiTImageProcessor"),m(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"),m(Le,"href","#transformers.DeiTImageProcessor"),m(pe,"class","relative group"),m(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Re,"id","transformers.DeiTModel"),m(Re,"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"),m(Re,"href","#transformers.DeiTModel"),m(he,"class","relative group"),m(St,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(St,"rel","nofollow"),m(So,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTModel"),m(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(He,"id","transformers.DeiTForMaskedImageModeling"),m(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"),m(He,"href","#transformers.DeiTForMaskedImageModeling"),m(ge,"class","relative group"),m(Bt,"href","https://arxiv.org/abs/2111.09886"),m(Bt,"rel","nofollow"),m(Jt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Jt,"rel","nofollow"),m(Ro,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTForMaskedImageModeling"),m(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ke,"id","transformers.DeiTForImageClassification"),m(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"),m(Ke,"href","#transformers.DeiTForImageClassification"),m(_e,"class","relative group"),m(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Zt,"rel","nofollow"),m(Vo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTForImageClassification"),m(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Qe,"id","transformers.DeiTForImageClassificationWithTeacher"),m(Qe,"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"),m(Qe,"href","#transformers.DeiTForImageClassificationWithTeacher"),m(be,"class","relative group"),m(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(ao,"rel","nofollow"),m(Uo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),m(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(tt,"id","transformers.TFDeiTModel"),m(tt,"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"),m(tt,"href","#transformers.TFDeiTModel"),m(we,"class","relative group"),m(co,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),m(co,"rel","nofollow"),m(Ho,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.TFDeiTModel"),m(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(at,"id","transformers.TFDeiTForMaskedImageModeling"),m(at,"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"),m(at,"href","#transformers.TFDeiTForMaskedImageModeling"),m(ye,"class","relative group"),m(fo,"href","https://arxiv.org/abs/2111.09886"),m(fo,"rel","nofollow"),m(go,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),m(go,"rel","nofollow"),m(Bo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.TFDeiTForMaskedImageModeling"),m(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(it,"id","transformers.TFDeiTForImageClassification"),m(it,"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"),m(it,"href","#transformers.TFDeiTForImageClassification"),m(Ie,"class","relative group"),m(vo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),m(vo,"rel","nofollow"),m(Go,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.TFDeiTForImageClassification"),m(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ct,"id","transformers.TFDeiTForImageClassificationWithTeacher"),m(ct,"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"),m(ct,"href","#transformers.TFDeiTForImageClassificationWithTeacher"),m(Me,"class","relative group"),m(ko,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),m(ko,"rel","nofollow"),m(Jo,"href","/docs/transformers/v4.25.1/en/model_doc/deit#transformers.TFDeiTForImageClassificationWithTeacher"),m(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(j,"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(t,b,u),T(t,h,u),e(h,p),e(p,_),$(s,_,null),e(h,c),e(h,F),e(F,$r),T(t,Da,u),$(ze,t,u),T(t,ka,u),T(t,ne,u),e(ne,qe),e(qe,ps),$(Dt,ps,null),e(ne,yr),e(ne,hs),e(hs,Dr),T(t,Ia,u),T(t,L,u),e(L,kr),e(L,kt),e(kt,Ir),e(L,Fr),e(L,xo),e(xo,Mr),e(L,xr),e(L,It),e(It,Pr),e(L,jr),T(t,Fa,u),T(t,Po,u),e(Po,Cr),T(t,Ma,u),T(t,jo,u),e(jo,fs),e(fs,Er),T(t,xa,u),T(t,Co,u),e(Co,zr),T(t,Pa,u),T(t,z,u),e(z,gs),e(gs,qr),e(z,Nr),e(z,ie),e(ie,Ar),e(ie,Eo),e(Eo,Or),e(ie,Wr),e(ie,zo),e(zo,Lr),e(ie,Sr),e(z,Rr),e(z,us),e(us,Vr),e(z,Ur),e(z,_s),e(_s,Hr),e(z,Br),e(z,x),e(x,Gr),e(x,qo),e(qo,Jr),e(x,Kr),e(x,No),e(No,Yr),e(x,Xr),e(x,Ts),e(Ts,Qr),e(x,Zr),e(x,bs),e(bs,en),e(x,tn),e(x,vs),e(vs,on),e(x,sn),e(x,ws),e(ws,an),e(x,rn),e(x,Ao),e(Ao,nn),e(x,ln),T(t,ja,u),T(t,se,u),e(se,dn),e(se,Ft),e(Ft,cn),e(se,mn),e(se,Mt),e(Mt,pn),e(se,hn),T(t,Ca,u),T(t,le,u),e(le,Ne),e(Ne,$s),$(xt,$s,null),e(le,fn),e(le,ys),e(ys,gn),T(t,Ea,u),T(t,q,u),$(Pt,q,null),e(q,un),e(q,de),e(de,_n),e(de,Oo),e(Oo,Tn),e(de,bn),e(de,jt),e(jt,vn),e(de,wn),e(q,$n),e(q,ce),e(ce,yn),e(ce,Wo),e(Wo,Dn),e(ce,kn),e(ce,Lo),e(Lo,In),e(ce,Fn),e(q,Mn),$(Ae,q,null),T(t,za,u),T(t,me,u),e(me,Oe),e(Oe,Ds),$(Ct,Ds,null),e(me,xn),e(me,ks),e(ks,Pn),T(t,qa,u),T(t,X,u),$(Et,X,null),e(X,jn),e(X,Is),e(Is,Cn),e(X,En),e(X,We),$(zt,We,null),e(We,zn),e(We,Fs),e(Fs,qn),T(t,Na,u),T(t,pe,u),e(pe,Le),e(Le,Ms),$(qt,Ms,null),e(pe,Nn),e(pe,xs),e(xs,An),T(t,Aa,u),T(t,Q,u),$(Nt,Q,null),e(Q,On),e(Q,Ps),e(Ps,Wn),e(Q,Ln),e(Q,Se),$(At,Se,null),e(Se,Sn),e(Se,js),e(js,Rn),T(t,Oa,u),T(t,he,u),e(he,Re),e(Re,Cs),$(Ot,Cs,null),e(he,Vn),e(he,Es),e(Es,Un),T(t,Wa,u),T(t,Z,u),$(Wt,Z,null),e(Z,Hn),e(Z,Lt),e(Lt,Bn),e(Lt,St),e(St,Gn),e(Lt,Jn),e(Z,Kn),e(Z,S),$(Rt,S,null),e(S,Yn),e(S,fe),e(fe,Xn),e(fe,So),e(So,Qn),e(fe,Zn),e(fe,zs),e(zs,ei),e(fe,ti),e(S,oi),$(Ve,S,null),e(S,si),$(Ue,S,null),T(t,La,u),T(t,ge,u),e(ge,He),e(He,qs),$(Vt,qs,null),e(ge,ai),e(ge,Ns),e(Ns,ri),T(t,Sa,u),T(t,E,u),$(Ut,E,null),e(E,ni),e(E,Ht),e(Ht,ii),e(Ht,Bt),e(Bt,li),e(Ht,di),e(E,ci),$(Be,E,null),e(E,mi),e(E,Gt),e(Gt,pi),e(Gt,Jt),e(Jt,hi),e(Gt,fi),e(E,gi),e(E,R),$(Kt,R,null),e(R,ui),e(R,ue),e(ue,_i),e(ue,Ro),e(Ro,Ti),e(ue,bi),e(ue,As),e(As,vi),e(ue,wi),e(R,$i),$(Ge,R,null),e(R,yi),$(Je,R,null),T(t,Ra,u),T(t,_e,u),e(_e,Ke),e(Ke,Os),$(Yt,Os,null),e(_e,Di),e(_e,Ws),e(Ws,ki),T(t,Va,u),T(t,N,u),$(Xt,N,null),e(N,Ii),e(N,Ls),e(Ls,Fi),e(N,Mi),e(N,Qt),e(Qt,xi),e(Qt,Zt),e(Zt,Pi),e(Qt,ji),e(N,Ci),e(N,V),$(eo,V,null),e(V,Ei),e(V,Te),e(Te,zi),e(Te,Vo),e(Vo,qi),e(Te,Ni),e(Te,Ss),e(Ss,Ai),e(Te,Oi),e(V,Wi),$(Ye,V,null),e(V,Li),$(Xe,V,null),T(t,Ua,u),T(t,be,u),e(be,Qe),e(Qe,Rs),$(to,Rs,null),e(be,Si),e(be,Vs),e(Vs,Ri),T(t,Ha,u),T(t,P,u),$(oo,P,null),e(P,Vi),e(P,Us),e(Us,Ui),e(P,Hi),e(P,Hs),e(Hs,Bi),e(P,Gi),e(P,Bs),e(Bs,Ji),e(P,Ki),e(P,so),e(so,Yi),e(so,ao),e(ao,Xi),e(so,Qi),e(P,Zi),e(P,U),$(ro,U,null),e(U,el),e(U,ve),e(ve,tl),e(ve,Uo),e(Uo,ol),e(ve,sl),e(ve,Gs),e(Gs,al),e(ve,rl),e(U,nl),$(Ze,U,null),e(U,il),$(et,U,null),T(t,Ba,u),T(t,we,u),e(we,tt),e(tt,Js),$(no,Js,null),e(we,ll),e(we,Ks),e(Ks,dl),T(t,Ga,u),T(t,ee,u),$(io,ee,null),e(ee,cl),e(ee,lo),e(lo,ml),e(lo,co),e(co,pl),e(lo,hl),e(ee,fl),e(ee,H),$(mo,H,null),e(H,gl),e(H,$e),e($e,ul),e($e,Ho),e(Ho,_l),e($e,Tl),e($e,Ys),e(Ys,bl),e($e,vl),e(H,wl),$(ot,H,null),e(H,$l),$(st,H,null),T(t,Ja,u),T(t,ye,u),e(ye,at),e(at,Xs),$(po,Xs,null),e(ye,yl),e(ye,Qs),e(Qs,Dl),T(t,Ka,u),T(t,te,u),$(ho,te,null),e(te,kl),e(te,De),e(De,Il),e(De,fo),e(fo,Fl),e(De,Ml),e(De,go),e(go,xl),e(De,Pl),e(te,jl),e(te,B),$(uo,B,null),e(B,Cl),e(B,ke),e(ke,El),e(ke,Bo),e(Bo,zl),e(ke,ql),e(ke,Zs),e(Zs,Nl),e(ke,Al),e(B,Ol),$(rt,B,null),e(B,Wl),$(nt,B,null),T(t,Ya,u),T(t,Ie,u),e(Ie,it),e(it,ea),$(_o,ea,null),e(Ie,Ll),e(Ie,ta),e(ta,Sl),T(t,Xa,u),T(t,A,u),$(To,A,null),e(A,Rl),e(A,oa),e(oa,Vl),e(A,Ul),e(A,bo),e(bo,Hl),e(bo,vo),e(vo,Bl),e(bo,Gl),e(A,Jl),e(A,G),$(wo,G,null),e(G,Kl),e(G,Fe),e(Fe,Yl),e(Fe,Go),e(Go,Xl),e(Fe,Ql),e(Fe,sa),e(sa,Zl),e(Fe,ed),e(G,td),$(lt,G,null),e(G,od),$(dt,G,null),T(t,Qa,u),T(t,Me,u),e(Me,ct),e(ct,aa),$($o,aa,null),e(Me,sd),e(Me,ra),e(ra,ad),T(t,Za,u),T(t,j,u),$(yo,j,null),e(j,rd),e(j,na),e(na,nd),e(j,id),e(j,ia),e(ia,ld),e(j,dd),e(j,la),e(la,cd),e(j,md),e(j,Do),e(Do,pd),e(Do,ko),e(ko,hd),e(Do,fd),e(j,gd),e(j,J),$(Io,J,null),e(J,ud),e(J,xe),e(xe,_d),e(xe,Jo),e(Jo,Td),e(xe,bd),e(xe,da),e(da,vd),e(xe,wd),e(J,$d),$(mt,J,null),e(J,yd),$(pt,J,null),er=!0},p(t,[u]){const Fo={};u&2&&(Fo.$$scope={dirty:u,ctx:t}),ze.$set(Fo);const ca={};u&2&&(ca.$$scope={dirty:u,ctx:t}),Ae.$set(ca);const ma={};u&2&&(ma.$$scope={dirty:u,ctx:t}),Ve.$set(ma);const pa={};u&2&&(pa.$$scope={dirty:u,ctx:t}),Ue.$set(pa);const Mo={};u&2&&(Mo.$$scope={dirty:u,ctx:t}),Be.$set(Mo);const ha={};u&2&&(ha.$$scope={dirty:u,ctx:t}),Ge.$set(ha);const fa={};u&2&&(fa.$$scope={dirty:u,ctx:t}),Je.$set(fa);const ga={};u&2&&(ga.$$scope={dirty:u,ctx:t}),Ye.$set(ga);const oe={};u&2&&(oe.$$scope={dirty:u,ctx:t}),Xe.$set(oe);const ua={};u&2&&(ua.$$scope={dirty:u,ctx:t}),Ze.$set(ua);const _a={};u&2&&(_a.$$scope={dirty:u,ctx:t}),et.$set(_a);const Ta={};u&2&&(Ta.$$scope={dirty:u,ctx:t}),ot.$set(Ta);const ba={};u&2&&(ba.$$scope={dirty:u,ctx:t}),st.$set(ba);const va={};u&2&&(va.$$scope={dirty:u,ctx:t}),rt.$set(va);const wa={};u&2&&(wa.$$scope={dirty:u,ctx:t}),nt.$set(wa);const $a={};u&2&&($a.$$scope={dirty:u,ctx:t}),lt.$set($a);const O={};u&2&&(O.$$scope={dirty:u,ctx:t}),dt.$set(O);const ya={};u&2&&(ya.$$scope={dirty:u,ctx:t}),mt.$set(ya);const Pe={};u&2&&(Pe.$$scope={dirty:u,ctx:t}),pt.$set(Pe)},i(t){er||(y(s.$$.fragment,t),y(ze.$$.fragment,t),y(Dt.$$.fragment,t),y(xt.$$.fragment,t),y(Pt.$$.fragment,t),y(Ae.$$.fragment,t),y(Ct.$$.fragment,t),y(Et.$$.fragment,t),y(zt.$$.fragment,t),y(qt.$$.fragment,t),y(Nt.$$.fragment,t),y(At.$$.fragment,t),y(Ot.$$.fragment,t),y(Wt.$$.fragment,t),y(Rt.$$.fragment,t),y(Ve.$$.fragment,t),y(Ue.$$.fragment,t),y(Vt.$$.fragment,t),y(Ut.$$.fragment,t),y(Be.$$.fragment,t),y(Kt.$$.fragment,t),y(Ge.$$.fragment,t),y(Je.$$.fragment,t),y(Yt.$$.fragment,t),y(Xt.$$.fragment,t),y(eo.$$.fragment,t),y(Ye.$$.fragment,t),y(Xe.$$.fragment,t),y(to.$$.fragment,t),y(oo.$$.fragment,t),y(ro.$$.fragment,t),y(Ze.$$.fragment,t),y(et.$$.fragment,t),y(no.$$.fragment,t),y(io.$$.fragment,t),y(mo.$$.fragment,t),y(ot.$$.fragment,t),y(st.$$.fragment,t),y(po.$$.fragment,t),y(ho.$$.fragment,t),y(uo.$$.fragment,t),y(rt.$$.fragment,t),y(nt.$$.fragment,t),y(_o.$$.fragment,t),y(To.$$.fragment,t),y(wo.$$.fragment,t),y(lt.$$.fragment,t),y(dt.$$.fragment,t),y($o.$$.fragment,t),y(yo.$$.fragment,t),y(Io.$$.fragment,t),y(mt.$$.fragment,t),y(pt.$$.fragment,t),er=!0)},o(t){D(s.$$.fragment,t),D(ze.$$.fragment,t),D(Dt.$$.fragment,t),D(xt.$$.fragment,t),D(Pt.$$.fragment,t),D(Ae.$$.fragment,t),D(Ct.$$.fragment,t),D(Et.$$.fragment,t),D(zt.$$.fragment,t),D(qt.$$.fragment,t),D(Nt.$$.fragment,t),D(At.$$.fragment,t),D(Ot.$$.fragment,t),D(Wt.$$.fragment,t),D(Rt.$$.fragment,t),D(Ve.$$.fragment,t),D(Ue.$$.fragment,t),D(Vt.$$.fragment,t),D(Ut.$$.fragment,t),D(Be.$$.fragment,t),D(Kt.$$.fragment,t),D(Ge.$$.fragment,t),D(Je.$$.fragment,t),D(Yt.$$.fragment,t),D(Xt.$$.fragment,t),D(eo.$$.fragment,t),D(Ye.$$.fragment,t),D(Xe.$$.fragment,t),D(to.$$.fragment,t),D(oo.$$.fragment,t),D(ro.$$.fragment,t),D(Ze.$$.fragment,t),D(et.$$.fragment,t),D(no.$$.fragment,t),D(io.$$.fragment,t),D(mo.$$.fragment,t),D(ot.$$.fragment,t),D(st.$$.fragment,t),D(po.$$.fragment,t),D(ho.$$.fragment,t),D(uo.$$.fragment,t),D(rt.$$.fragment,t),D(nt.$$.fragment,t),D(_o.$$.fragment,t),D(To.$$.fragment,t),D(wo.$$.fragment,t),D(lt.$$.fragment,t),D(dt.$$.fragment,t),D($o.$$.fragment,t),D(yo.$$.fragment,t),D(Io.$$.fragment,t),D(mt.$$.fragment,t),D(pt.$$.fragment,t),er=!1},d(t){o(d),t&&o(b),t&&o(h),k(s),t&&o(Da),k(ze,t),t&&o(ka),t&&o(ne),k(Dt),t&&o(Ia),t&&o(L),t&&o(Fa),t&&o(Po),t&&o(Ma),t&&o(jo),t&&o(xa),t&&o(Co),t&&o(Pa),t&&o(z),t&&o(ja),t&&o(se),t&&o(Ca),t&&o(le),k(xt),t&&o(Ea),t&&o(q),k(Pt),k(Ae),t&&o(za),t&&o(me),k(Ct),t&&o(qa),t&&o(X),k(Et),k(zt),t&&o(Na),t&&o(pe),k(qt),t&&o(Aa),t&&o(Q),k(Nt),k(At),t&&o(Oa),t&&o(he),k(Ot),t&&o(Wa),t&&o(Z),k(Wt),k(Rt),k(Ve),k(Ue),t&&o(La),t&&o(ge),k(Vt),t&&o(Sa),t&&o(E),k(Ut),k(Be),k(Kt),k(Ge),k(Je),t&&o(Ra),t&&o(_e),k(Yt),t&&o(Va),t&&o(N),k(Xt),k(eo),k(Ye),k(Xe),t&&o(Ua),t&&o(be),k(to),t&&o(Ha),t&&o(P),k(oo),k(ro),k(Ze),k(et),t&&o(Ba),t&&o(we),k(no),t&&o(Ga),t&&o(ee),k(io),k(mo),k(ot),k(st),t&&o(Ja),t&&o(ye),k(po),t&&o(Ka),t&&o(te),k(ho),k(uo),k(rt),k(nt),t&&o(Ya),t&&o(Ie),k(_o),t&&o(Xa),t&&o(A),k(To),k(wo),k(lt),k(dt),t&&o(Qa),t&&o(Me),k($o),t&&o(Za),t&&o(j),k(yo),k(Io),k(mt),k(pt)}}}const xm={local:"deit",sections:[{local:"overview",title:"Overview"},{local:"transformers.DeiTConfig",title:"DeiTConfig"},{local:"transformers.DeiTImageProcessor",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 Pm(I){return lm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Am extends am{constructor(d){super();rm(this,d,Pm,Mm,nm,{})}}export{Am as default,xm as metadata};
