import{S as dh,i as ch,s as mh,e as s,k as h,w as y,t as i,M as hh,c as n,d as o,m as p,a as r,x as w,h as l,b as c,G as e,g as _,y as v,q as M,o as $,B as I,v as ph,L as Ze}from"../../chunks/vendor-hf-doc-builder.js";import{T as ne}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ue}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ce}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as fh}from"../../chunks/PipelineTag-hf-doc-builder.js";function gh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i(`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),g=s("a"),f=i("Github Issue"),T=i("."),this.h()},l(a){d=n(a,"P",{});var m=r(d);b=l(m,`This is a recently introduced model so the API hasn\u2019t been tested extensively. There may be some bugs or slight
breaking changes to fix it in the future. If you see something strange, file a `),g=n(m,"A",{href:!0,rel:!0});var F=r(g);f=l(F,"Github Issue"),F.forEach(o),T=l(m,"."),m.forEach(o),this.h()},h(){c(g,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),c(g,"rel","nofollow")},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function uh(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERlaVRDb25maWclMkMlMjBEZWlUTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRGVpVCUyMGRlaXQtYmFzZS1kaXN0aWxsZWQtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwRGVpVENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBEZWlUTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",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=s("p"),b=i("Example:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Example:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function _h(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function Th(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERlaVRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwRGVpVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRlaXQtYmFzZS1kaXN0aWxsZWQtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DeiTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTModel.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">198</span>, <span class="hljs-number">768</span>]`}}),{c(){d=s("p"),b=i("Example:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Example:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function bh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Note that we provide a script to pre-train this model on custom data in our "),g=s("a"),f=i(`examples
directory`),T=i("."),this.h()},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Note that we provide a script to pre-train this model on custom data in our "),g=n(m,"A",{href:!0,rel:!0});var F=r(g);f=l(F,`examples
directory`),F.forEach(o),T=l(m,"."),m.forEach(o),this.h()},h(){c(g,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(g,"rel","nofollow")},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function yh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function wh(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERlaVRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZGVpdC1iYXNlLWRpc3RpbGxlZC1wYXRjaDE2LTIyNCUyMiklMEFtb2RlbCUyMCUzRCUyMERlaVRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRlaXQtYmFzZS1kaXN0aWxsZWQtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBbnVtX3BhdGNoZXMlMjAlM0QlMjAobW9kZWwuY29uZmlnLmltYWdlX3NpemUlMjAlMkYlMkYlMjBtb2RlbC5jb25maWcucGF0Y2hfc2l6ZSklMjAqKiUyMDIlMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEElMjMlMjBjcmVhdGUlMjByYW5kb20lMjBib29sZWFuJTIwbWFzayUyMG9mJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9wYXRjaGVzKSUwQWJvb2xfbWFza2VkX3BvcyUyMCUzRCUyMHRvcmNoLnJhbmRpbnQobG93JTNEMCUyQyUyMGhpZ2glM0QyJTJDJTIwc2l6ZSUzRCgxJTJDJTIwbnVtX3BhdGNoZXMpKS5ib29sKCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwocGl4ZWxfdmFsdWVzJTJDJTIwYm9vbF9tYXNrZWRfcG9zJTNEYm9vbF9tYXNrZWRfcG9zKSUwQWxvc3MlMkMlMjByZWNvbnN0cnVjdGVkX3BpeGVsX3ZhbHVlcyUyMCUzRCUyMG91dHB1dHMubG9zcyUyQyUyMG91dHB1dHMucmVjb25zdHJ1Y3Rpb24lMEFsaXN0KHJlY29uc3RydWN0ZWRfcGl4ZWxfdmFsdWVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DeiTForMaskedImageModeling
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create random boolean mask of shape (batch_size, num_patches)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = torch.randint(low=<span class="hljs-number">0</span>, high=<span class="hljs-number">2</span>, size=(<span class="hljs-number">1</span>, num_patches)).<span class="hljs-built_in">bool</span>()

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss, reconstructed_pixel_values = outputs.loss, outputs.reconstruction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(reconstructed_pixel_values.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>]`}}),{c(){d=s("p"),b=i("Examples:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Examples:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function vh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function Mh(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMERlaVRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXRvcmNoLm1hbnVhbF9zZWVkKDMpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMG5vdGUlM0ElMjB3ZSUyMGFyZSUyMGxvYWRpbmclMjBhJTIwRGVpVEZvckltYWdlQ2xhc3NpZmljYXRpb25XaXRoVGVhY2hlciUyMGZyb20lMjB0aGUlMjBodWIlMjBoZXJlJTJDJTBBJTIzJTIwc28lMjB0aGUlMjBoZWFkJTIwd2lsbCUyMGJlJTIwcmFuZG9tbHklMjBpbml0aWFsaXplZCUyQyUyMGhlbmNlJTIwdGhlJTIwcHJlZGljdGlvbnMlMjB3aWxsJTIwYmUlMjByYW5kb20lMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZGVpdC1iYXNlLWRpc3RpbGxlZC1wYXRjaDE2LTIyNCUyMiklMEFtb2RlbCUyMCUzRCUyMERlaVRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRlaXQtYmFzZS1kaXN0aWxsZWQtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2NsYXNzX2lkeCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KCUyMlByZWRpY3RlZCUyMGNsYXNzJTNBJTIyJTJDJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2NsYXNzX2lkeCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, DeiTForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">3</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># note: we are loading a DeiTForImageClassificationWithTeacher from the hub here,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># so the head will be randomly initialized, hence the predictions will be random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DeiTForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){d=s("p"),b=i("Example:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Example:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function kh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function Fh(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRGVpVE1vZGVsJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZEZWlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZGVpdC1iYXNlLWRpc3RpbGxlZC1wYXRjaDE2LTIyNCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFDeiTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTModel.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">198</span>, <span class="hljs-number">768</span>]`}}),{c(){d=s("p"),b=i("Example:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Example:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function jh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function Dh(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRGVpVEZvck1hc2tlZEltYWdlTW9kZWxpbmclMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZEZWlURm9yTWFza2VkSW1hZ2VNb2RlbGluZy5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQSUwQW51bV9wYXRjaGVzJTIwJTNEJTIwKG1vZGVsLmNvbmZpZy5pbWFnZV9zaXplJTIwJTJGJTJGJTIwbW9kZWwuY29uZmlnLnBhdGNoX3NpemUpJTIwKiolMjAyJTBBcGl4ZWxfdmFsdWVzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMikucGl4ZWxfdmFsdWVzJTBBJTIzJTIwY3JlYXRlJTIwcmFuZG9tJTIwYm9vbGVhbiUyMG1hc2slMjBvZiUyMHNoYXBlJTIwKGJhdGNoX3NpemUlMkMlMjBudW1fcGF0Y2hlcyklMEFib29sX21hc2tlZF9wb3MlMjAlM0QlMjB0Zi5jYXN0KHRmLnJhbmRvbS51bmlmb3JtKCgxJTJDJTIwbnVtX3BhdGNoZXMpJTJDJTIwbWludmFsJTNEMCUyQyUyMG1heHZhbCUzRDIlMkMlMjBkdHlwZSUzRHRmLmludDMyKSUyQyUyMHRmLmJvb2wpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKHBpeGVsX3ZhbHVlcyUyQyUyMGJvb2xfbWFza2VkX3BvcyUzRGJvb2xfbWFza2VkX3BvcyklMEFsb3NzJTJDJTIwcmVjb25zdHJ1Y3RlZF9waXhlbF92YWx1ZXMlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMkMlMjBvdXRwdXRzLnJlY29uc3RydWN0aW9uJTBBbGlzdChyZWNvbnN0cnVjdGVkX3BpeGVsX3ZhbHVlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFDeiTForMaskedImageModeling
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create random boolean mask of shape (batch_size, num_patches)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = tf.cast(tf.random.uniform((<span class="hljs-number">1</span>, num_patches), minval=<span class="hljs-number">0</span>, maxval=<span class="hljs-number">2</span>, dtype=tf.int32), tf.<span class="hljs-built_in">bool</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss, reconstructed_pixel_values = outputs.loss, outputs.reconstruction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(reconstructed_pixel_values.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>]`}}),{c(){d=s("p"),b=i("Examples:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Examples:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function Wh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function Jh(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRGVpVEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdGYua2VyYXMudXRpbHMuc2V0X3JhbmRvbV9zZWVkKDMpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMG5vdGUlM0ElMjB3ZSUyMGFyZSUyMGxvYWRpbmclMjBhJTIwVEZEZWlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyJTIwZnJvbSUyMHRoZSUyMGh1YiUyMGhlcmUlMkMlMEElMjMlMjBzbyUyMHRoZSUyMGhlYWQlMjB3aWxsJTIwYmUlMjByYW5kb21seSUyMGluaXRpYWxpemVkJTJDJTIwaGVuY2UlMjB0aGUlMjBwcmVkaWN0aW9ucyUyMHdpbGwlMjBiZSUyMHJhbmRvbSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZEZWlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9jbGFzc19pZHglMjAlM0QlMjB0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpJTVCMCU1RCUwQXByaW50KCUyMlByZWRpY3RlZCUyMGNsYXNzJTNBJTIyJTJDJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCaW50KHByZWRpY3RlZF9jbGFzc19pZHgpJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFDeiTForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>tf.keras.utils.set_random_seed(<span class="hljs-number">3</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># note: we are loading a TFDeiTForImageClassificationWithTeacher from the hub here,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># so the head will be randomly initialized, hence the predictions will be random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[<span class="hljs-built_in">int</span>(predicted_class_idx)])
Predicted <span class="hljs-keyword">class</span>: little blue heron, Egretta caerulea`}}),{c(){d=s("p"),b=i("Examples:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Examples:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function Eh(k){let d,b,g,f,T;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var F=r(g);f=l(F,"Module"),F.forEach(o),T=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,d,m),e(d,b),e(d,g),e(g,f),e(d,T)},d(a){a&&o(d)}}}function Ch(k){let d,b,g,f,T;return f=new Ue({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRGVpVEZvckltYWdlQ2xhc3NpZmljYXRpb25XaXRoVGVhY2hlciUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkZWl0LWJhc2UtZGlzdGlsbGVkLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZEZWlURm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRlaXQtYmFzZS1kaXN0aWxsZWQtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFDeiTForImageClassificationWithTeacher
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDeiTForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">&quot;facebook/deit-base-distilled-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){d=s("p"),b=i("Example:"),g=h(),y(f.$$.fragment)},l(a){d=n(a,"P",{});var m=r(d);b=l(m,"Example:"),m.forEach(o),g=p(a),w(f.$$.fragment,a)},m(a,m){_(a,d,m),e(d,b),_(a,g,m),v(f,a,m),T=!0},p:Ze,i(a){T||(M(f.$$.fragment,a),T=!0)},o(a){$(f.$$.fragment,a),T=!1},d(a){a&&o(d),a&&o(g),I(f,a)}}}function Zh(k){let d,b,g,f,T,a,m,F,Kn,Xs,Ne,Ys,re,xe,Wa,Dt,er,Ja,tr,As,R,or,Wt,ar,sr,Ro,nr,rr,Jt,ir,lr,Ss,Bo,dr,qs,Vo,Ea,cr,Ls,Po,mr,Qs,Z,Ca,hr,pr,ie,fr,Xo,gr,ur,Yo,_r,Tr,br,Za,yr,wr,Ua,vr,Mr,D,$r,Ao,Ir,kr,So,Fr,jr,Na,Dr,Wr,xa,Jr,Er,za,Cr,Zr,Ga,Ur,Nr,qo,xr,zr,Hs,oe,Gr,Et,Rr,Br,Ct,Vr,Pr,Os,le,ze,Ra,Zt,Xr,Ba,Yr,Ks,Lo,Ar,en,Ut,tn,Ge,ae,Qo,Sr,qr,Nt,Lr,Qr,xt,Hr,Or,Kr,Ho,ei,Oo,ti,on,Ko,oi,an,ea,Re,ta,ai,si,zt,ni,ri,sn,oa,ii,nn,de,Be,Va,Gt,li,Pa,di,rn,N,Rt,ci,ce,mi,aa,hi,pi,Bt,fi,gi,ui,me,_i,sa,Ti,bi,na,yi,wi,vi,Ve,ln,he,Pe,Xa,Vt,Mi,Ya,$i,dn,pe,Pt,Ii,Xe,Xt,ki,Aa,Fi,cn,fe,Ye,Sa,Yt,ji,qa,Di,mn,H,At,Wi,La,Ji,Ei,Ae,St,Ci,Qa,Zi,hn,ge,Se,Ha,qt,Ui,Oa,Ni,pn,O,Lt,xi,Qt,zi,Ht,Gi,Ri,Bi,B,Ot,Vi,ue,Pi,ra,Xi,Yi,Ka,Ai,Si,qi,qe,Li,Le,fn,_e,Qe,es,Kt,Qi,ts,Hi,gn,C,eo,Oi,to,Ki,oo,el,tl,ol,He,al,ao,sl,so,nl,rl,il,V,no,ll,Te,dl,ia,cl,ml,os,hl,pl,fl,Oe,gl,Ke,un,be,et,as,ro,ul,ss,_l,_n,x,io,Tl,ns,bl,yl,lo,wl,co,vl,Ml,$l,P,mo,Il,ye,kl,la,Fl,jl,rs,Dl,Wl,Jl,tt,El,ot,Tn,we,at,is,ho,Cl,ls,Zl,bn,W,po,Ul,ds,Nl,xl,cs,zl,Gl,ms,Rl,Bl,fo,Vl,go,Pl,Xl,Yl,X,uo,Al,ve,Sl,da,ql,Ll,hs,Ql,Hl,Ol,st,Kl,nt,yn,Me,rt,ps,_o,ed,fs,td,wn,K,To,od,bo,ad,yo,sd,nd,rd,Y,wo,id,$e,ld,ca,dd,cd,gs,md,hd,pd,it,fd,lt,vn,Ie,dt,us,vo,gd,_s,ud,Mn,ee,Mo,_d,ke,Td,$o,bd,yd,Io,wd,vd,Md,A,ko,$d,Fe,Id,ma,kd,Fd,Ts,jd,Dd,Wd,ct,Jd,mt,$n,je,ht,bs,Fo,Ed,ys,Cd,In,z,jo,Zd,ws,Ud,Nd,Do,xd,Wo,zd,Gd,Rd,S,Jo,Bd,De,Vd,ha,Pd,Xd,vs,Yd,Ad,Sd,pt,qd,ft,kn,We,gt,Ms,Eo,Ld,$s,Qd,Fn,J,Co,Hd,Is,Od,Kd,ks,ec,tc,Fs,oc,ac,Zo,sc,Uo,nc,rc,ic,q,No,lc,Je,dc,pa,cc,mc,js,hc,pc,fc,ut,gc,_t,jn;return a=new U({}),Ne=new ne({props:{$$slots:{default:[gh]},$$scope:{ctx:k}}}),Dt=new U({}),Zt=new U({}),Ut=new fh({props:{pipeline:"image-classification"}}),Gt=new U({}),Rt=new j({props:{name:"class transformers.DeiTConfig",anchor:"transformers.DeiTConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"encoder_stride",val:" = 16"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DeiTConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.DeiTConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.DeiTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.DeiTConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.DeiTConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.DeiTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.DeiTConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.DeiTConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.DeiTConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.DeiTConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>224</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.DeiTConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>16</code>) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.DeiTConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>3</code>) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.DeiTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.DeiTConfig.encoder_stride",description:`<strong>encoder_stride</strong> (<code>int</code>, <code>optional</code>, defaults to 16) &#x2014;
Factor to increase the spatial resolution by in the decoder head for masked image modeling.`,name:"encoder_stride"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/configuration_deit.py#L37"}}),Ve=new Ce({props:{anchor:"transformers.DeiTConfig.example",$$slots:{default:[uh]},$$scope:{ctx:k}}}),Vt=new U({}),Pt=new j({props:{name:"class transformers.DeiTFeatureExtractor",anchor:"transformers.DeiTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/feature_extraction_deit.py#L26"}}),Xt=new j({props:{name:"__call__",anchor:"transformers.DeiTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L516"}}),Yt=new U({}),At=new j({props:{name:"class transformers.DeiTImageProcessor",anchor:"transformers.DeiTImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = 3"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_rescale",val:": bool = True"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DeiTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.DeiTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Size of the image after <code>resize</code>. Can be overridden by <code>size</code> in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.DeiTImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in <code>preprocess</code>.`,name:"resample"},{anchor:"transformers.DeiTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the image
is padded with 0&#x2019;s and then center cropped. Can be overridden by <code>do_center_crop</code> in <code>preprocess</code>.`,name:"do_center_crop"},{anchor:"transformers.DeiTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size when applying center-cropping. Can be overridden by <code>crop_size</code> in <code>preprocess</code>.`,name:"crop_size"},{anchor:"transformers.DeiTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.DeiTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.DeiTImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.DeiTImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.DeiTImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/image_processing_deit.py#L43"}}),St=new j({props:{name:"preprocess",anchor:"transformers.DeiTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:" = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DeiTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.DeiTImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.DeiTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after <code>resize</code>.`,name:"size"},{anchor:"transformers.DeiTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
PILImageResampling filter to use if resizing the image Only has an effect if <code>do_resize</code> is set to
<code>True</code>.`,name:"resample"},{anchor:"transformers.DeiTImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.DeiTImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the image after center crop. If one edge the image is smaller than <code>crop_size</code>, it will be
padded with zeros and then cropped`,name:"crop_size"},{anchor:"transformers.DeiTImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.DeiTImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.DeiTImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.DeiTImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.DeiTImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.DeiTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li><code>None</code>: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DeiTImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/image_processing_deit.py#L144"}}),qt=new U({}),Lt=new j({props:{name:"class transformers.DeiTModel",anchor:"transformers.DeiTModel",parameters:[{name:"config",val:": DeiTConfig"},{name:"add_pooling_layer",val:": bool = True"},{name:"use_mask_token",val:": bool = False"}],parametersDescription:[{anchor:"transformers.DeiTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L461"}}),Ot=new j({props:{name:"forward",anchor:"transformers.DeiTModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DeiTModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L486",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new ne({props:{$$slots:{default:[_h]},$$scope:{ctx:k}}}),Le=new Ce({props:{anchor:"transformers.DeiTModel.forward.example",$$slots:{default:[Th]},$$scope:{ctx:k}}}),Kt=new U({}),eo=new j({props:{name:"class transformers.DeiTForMaskedImageModeling",anchor:"transformers.DeiTForMaskedImageModeling",parameters:[{name:"config",val:": DeiTConfig"}],parametersDescription:[{anchor:"transformers.DeiTForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L581"}}),He=new ne({props:{$$slots:{default:[bh]},$$scope:{ctx:k}}}),no=new j({props:{name:"forward",anchor:"transformers.DeiTForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTForMaskedImageModeling.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L599",returnDescription:`
<p>A <code>transformers.modeling_outputs.MaskedImageModelingOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>bool_masked_pos</code> is provided) \u2014 Reconstruction loss.</li>
<li><strong>reconstruction</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Reconstructed / completed images.</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or</li>
<li><strong>when</strong> <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when</li>
<li><strong><code>config.output_attentions=True</code>):</strong>
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.MaskedImageModelingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oe=new ne({props:{$$slots:{default:[yh]},$$scope:{ctx:k}}}),Ke=new Ce({props:{anchor:"transformers.DeiTForMaskedImageModeling.forward.example",$$slots:{default:[wh]},$$scope:{ctx:k}}}),ro=new U({}),io=new j({props:{name:"class transformers.DeiTForImageClassification",anchor:"transformers.DeiTForImageClassification",parameters:[{name:"config",val:": DeiTConfig"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L693"}}),mo=new j({props:{name:"forward",anchor:"transformers.DeiTForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DeiTForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L706",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),tt=new ne({props:{$$slots:{default:[vh]},$$scope:{ctx:k}}}),ot=new Ce({props:{anchor:"transformers.DeiTForImageClassification.forward.example",$$slots:{default:[Mh]},$$scope:{ctx:k}}}),ho=new U({}),po=new j({props:{name:"class transformers.DeiTForImageClassificationWithTeacher",anchor:"transformers.DeiTForImageClassificationWithTeacher",parameters:[{name:"config",val:": DeiTConfig"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L843"}}),uo=new j({props:{name:"forward",anchor:"transformers.DeiTForImageClassificationWithTeacher.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py#L861",returnDescription:`
<p>A <code>transformers.models.deit.modeling_deit.DeiTForImageClassificationWithTeacherOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores as the average of the cls_logits and distillation logits.</li>
<li><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).</li>
<li><strong>distillation_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deit.modeling_deit.DeiTForImageClassificationWithTeacherOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new ne({props:{$$slots:{default:[$h]},$$scope:{ctx:k}}}),nt=new Ce({props:{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.example",$$slots:{default:[Ih]},$$scope:{ctx:k}}}),_o=new U({}),To=new j({props:{name:"class transformers.TFDeiTModel",anchor:"transformers.TFDeiTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L610"}}),wo=new j({props:{name:"call",anchor:"transformers.TFDeiTModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"bool_masked_pos",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L620",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),it=new ne({props:{$$slots:{default:[kh]},$$scope:{ctx:k}}}),lt=new Ce({props:{anchor:"transformers.TFDeiTModel.call.example",$$slots:{default:[Fh]},$$scope:{ctx:k}}}),vo=new U({}),Mo=new j({props:{name:"class transformers.TFDeiTForMaskedImageModeling",anchor:"transformers.TFDeiTForMaskedImageModeling",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L718"}}),ko=new j({props:{name:"call",anchor:"transformers.TFDeiTForMaskedImageModeling.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"bool_masked_pos",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTForMaskedImageModeling.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>tf.Tensor</code> of type bool and shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L725",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFMaskedImageModelingOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>bool_masked_pos</code> is provided) \u2014 Reconstruction loss.</li>
<li><strong>reconstruction</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Reconstructed / completed images.</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</li>
<li><strong><code>config.output_hidden_states=True</code>):</strong>
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.</li>
<li><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when</li>
<li><strong><code>config.output_attentions=True</code>):</strong>
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFMaskedImageModelingOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),ct=new ne({props:{$$slots:{default:[jh]},$$scope:{ctx:k}}}),mt=new Ce({props:{anchor:"transformers.TFDeiTForMaskedImageModeling.call.example",$$slots:{default:[Dh]},$$scope:{ctx:k}}}),Fo=new U({}),jo=new j({props:{name:"class transformers.TFDeiTForImageClassification",anchor:"transformers.TFDeiTForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L833"}}),Jo=new j({props:{name:"call",anchor:"transformers.TFDeiTForImageClassification.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForImageClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFDeiTForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L847",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),pt=new ne({props:{$$slots:{default:[Wh]},$$scope:{ctx:k}}}),ft=new Ce({props:{anchor:"transformers.TFDeiTForImageClassification.call.example",$$slots:{default:[Jh]},$$scope:{ctx:k}}}),Eo=new U({}),Co=new j({props:{name:"class transformers.TFDeiTForImageClassificationWithTeacher",anchor:"transformers.TFDeiTForImageClassificationWithTeacher",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L935"}}),No=new j({props:{name:"call",anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_tf_deit.py#L954",returnDescription:`
<p>A <code>transformers.models.deit.modeling_tf_deit.TFDeiTForImageClassificationWithTeacherOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores as the average of the cls_logits and distillation logits.</li>
<li><strong>cls_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).</li>
<li><strong>distillation_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deit.modeling_tf_deit.TFDeiTForImageClassificationWithTeacherOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),ut=new ne({props:{$$slots:{default:[Eh]},$$scope:{ctx:k}}}),_t=new Ce({props:{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.example",$$slots:{default:[Ch]},$$scope:{ctx:k}}}),{c(){d=s("meta"),b=h(),g=s("h1"),f=s("a"),T=s("span"),y(a.$$.fragment),m=h(),F=s("span"),Kn=i("DeiT"),Xs=h(),y(Ne.$$.fragment),Ys=h(),re=s("h2"),xe=s("a"),Wa=s("span"),y(Dt.$$.fragment),er=h(),Ja=s("span"),tr=i("Overview"),As=h(),R=s("p"),or=i("The DeiT model was proposed in "),Wt=s("a"),ar=i("Training data-efficient image transformers & distillation through attention"),sr=i(` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),Ro=s("a"),nr=i("Vision Transformer (ViT)"),rr=i(" introduced in "),Jt=s("a"),ir=i("Dosovitskiy et al., 2020"),lr=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.`),Ss=h(),Bo=s("p"),dr=i("The abstract from the paper is the following:"),qs=h(),Vo=s("p"),Ea=s("em"),cr=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.`),Ls=h(),Po=s("p"),mr=i("Tips:"),Qs=h(),Z=s("ul"),Ca=s("li"),hr=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.`),pr=h(),ie=s("li"),fr=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
`),Xo=s("a"),gr=i("DeiTForImageClassification"),ur=i(` and (2) corresponds to
`),Yo=s("a"),_r=i("DeiTForImageClassificationWithTeacher"),Tr=i("."),br=h(),Za=s("li"),yr=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.`),wr=h(),Ua=s("li"),vr=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.`),Mr=h(),D=s("li"),$r=i(`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),Ao=s("a"),Ir=i("ViTModel"),kr=i(" or "),So=s("a"),Fr=i("ViTForImageClassification"),jr=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):
`),Na=s("em"),Dr=i("facebook/deit-tiny-patch16-224"),Wr=i(", "),xa=s("em"),Jr=i("facebook/deit-small-patch16-224"),Er=i(", "),za=s("em"),Cr=i("facebook/deit-base-patch16-224"),Zr=i(` and
`),Ga=s("em"),Ur=i("facebook/deit-base-patch16-384"),Nr=i(". Note that one should use "),qo=s("a"),xr=i("DeiTImageProcessor"),zr=i(` in order to
prepare images for the model.`),Hs=h(),oe=s("p"),Gr=i("This model was contributed by "),Et=s("a"),Rr=i("nielsr"),Br=i(". The TensorFlow version of this model was added by "),Ct=s("a"),Vr=i("amyeroberts"),Pr=i("."),Os=h(),le=s("h2"),ze=s("a"),Ra=s("span"),y(Zt.$$.fragment),Xr=h(),Ba=s("span"),Yr=i("Resources"),Ks=h(),Lo=s("p"),Ar=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DeiT."),en=h(),y(Ut.$$.fragment),tn=h(),Ge=s("ul"),ae=s("li"),Qo=s("a"),Sr=i("DeiTForImageClassification"),qr=i(" is supported by this "),Nt=s("a"),Lr=i("example script"),Qr=i(" and "),xt=s("a"),Hr=i("notebook"),Or=i("."),Kr=h(),Ho=s("li"),ei=i("See also: "),Oo=s("a"),ti=i("Image classification task guide"),on=h(),Ko=s("p"),oi=i("Besides that:"),an=h(),ea=s("ul"),Re=s("li"),ta=s("a"),ai=i("DeiTForMaskedImageModeling"),si=i(" is supported by this "),zt=s("a"),ni=i("example script"),ri=i("."),sn=h(),oa=s("p"),ii=i("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),nn=h(),de=s("h2"),Be=s("a"),Va=s("span"),y(Gt.$$.fragment),li=h(),Pa=s("span"),di=i("DeiTConfig"),rn=h(),N=s("div"),y(Rt.$$.fragment),ci=h(),ce=s("p"),mi=i("This is the configuration class to store the configuration of a "),aa=s("a"),hi=i("DeiTModel"),pi=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
`),Bt=s("a"),fi=i("facebook/deit-base-distilled-patch16-224"),gi=i(`
architecture.`),ui=h(),me=s("p"),_i=i("Configuration objects inherit from "),sa=s("a"),Ti=i("PretrainedConfig"),bi=i(` and can be used to control the model outputs. Read the
documentation from `),na=s("a"),yi=i("PretrainedConfig"),wi=i(" for more information."),vi=h(),y(Ve.$$.fragment),ln=h(),he=s("h2"),Pe=s("a"),Xa=s("span"),y(Vt.$$.fragment),Mi=h(),Ya=s("span"),$i=i("DeiTFeatureExtractor"),dn=h(),pe=s("div"),y(Pt.$$.fragment),Ii=h(),Xe=s("div"),y(Xt.$$.fragment),ki=h(),Aa=s("p"),Fi=i("Preprocess an image or a batch of images."),cn=h(),fe=s("h2"),Ye=s("a"),Sa=s("span"),y(Yt.$$.fragment),ji=h(),qa=s("span"),Di=i("DeiTImageProcessor"),mn=h(),H=s("div"),y(At.$$.fragment),Wi=h(),La=s("p"),Ji=i("Constructs a DeiT image processor."),Ei=h(),Ae=s("div"),y(St.$$.fragment),Ci=h(),Qa=s("p"),Zi=i("Preprocess an image or batch of images."),hn=h(),ge=s("h2"),Se=s("a"),Ha=s("span"),y(qt.$$.fragment),Ui=h(),Oa=s("span"),Ni=i("DeiTModel"),pn=h(),O=s("div"),y(Lt.$$.fragment),xi=h(),Qt=s("p"),zi=i(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ht=s("a"),Gi=i("torch.nn.Module"),Ri=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bi=h(),B=s("div"),y(Ot.$$.fragment),Vi=h(),ue=s("p"),Pi=i("The "),ra=s("a"),Xi=i("DeiTModel"),Yi=i(" forward method, overrides the "),Ka=s("code"),Ai=i("__call__"),Si=i(" special method."),qi=h(),y(qe.$$.fragment),Li=h(),y(Le.$$.fragment),fn=h(),_e=s("h2"),Qe=s("a"),es=s("span"),y(Kt.$$.fragment),Qi=h(),ts=s("span"),Hi=i("DeiTForMaskedImageModeling"),gn=h(),C=s("div"),y(eo.$$.fragment),Oi=h(),to=s("p"),Ki=i("DeiT Model with a decoder on top for masked image modeling, as proposed in "),oo=s("a"),el=i("SimMIM"),tl=i("."),ol=h(),y(He.$$.fragment),al=h(),ao=s("p"),sl=i("This model is a PyTorch "),so=s("a"),nl=i("torch.nn.Module"),rl=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),il=h(),V=s("div"),y(no.$$.fragment),ll=h(),Te=s("p"),dl=i("The "),ia=s("a"),cl=i("DeiTForMaskedImageModeling"),ml=i(" forward method, overrides the "),os=s("code"),hl=i("__call__"),pl=i(" special method."),fl=h(),y(Oe.$$.fragment),gl=h(),y(Ke.$$.fragment),un=h(),be=s("h2"),et=s("a"),as=s("span"),y(ro.$$.fragment),ul=h(),ss=s("span"),_l=i("DeiTForImageClassification"),_n=h(),x=s("div"),y(io.$$.fragment),Tl=h(),ns=s("p"),bl=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.`),yl=h(),lo=s("p"),wl=i("This model is a PyTorch "),co=s("a"),vl=i("torch.nn.Module"),Ml=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$l=h(),P=s("div"),y(mo.$$.fragment),Il=h(),ye=s("p"),kl=i("The "),la=s("a"),Fl=i("DeiTForImageClassification"),jl=i(" forward method, overrides the "),rs=s("code"),Dl=i("__call__"),Wl=i(" special method."),Jl=h(),y(tt.$$.fragment),El=h(),y(ot.$$.fragment),Tn=h(),we=s("h2"),at=s("a"),is=s("span"),y(ho.$$.fragment),Cl=h(),ls=s("span"),Zl=i("DeiTForImageClassificationWithTeacher"),bn=h(),W=s("div"),y(po.$$.fragment),Ul=h(),ds=s("p"),Nl=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.`),xl=h(),cs=s("p"),zl=i(".. warning::"),Gl=h(),ms=s("p"),Rl=i(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Bl=h(),fo=s("p"),Vl=i("This model is a PyTorch "),go=s("a"),Pl=i("torch.nn.Module"),Xl=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yl=h(),X=s("div"),y(uo.$$.fragment),Al=h(),ve=s("p"),Sl=i("The "),da=s("a"),ql=i("DeiTForImageClassificationWithTeacher"),Ll=i(" forward method, overrides the "),hs=s("code"),Ql=i("__call__"),Hl=i(" special method."),Ol=h(),y(st.$$.fragment),Kl=h(),y(nt.$$.fragment),yn=h(),Me=s("h2"),rt=s("a"),ps=s("span"),y(_o.$$.fragment),ed=h(),fs=s("span"),td=i("TFDeiTModel"),wn=h(),K=s("div"),y(To.$$.fragment),od=h(),bo=s("p"),ad=i(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),yo=s("a"),sd=i("tf.keras.layers.Layer"),nd=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),rd=h(),Y=s("div"),y(wo.$$.fragment),id=h(),$e=s("p"),ld=i("The "),ca=s("a"),dd=i("TFDeiTModel"),cd=i(" forward method, overrides the "),gs=s("code"),md=i("__call__"),hd=i(" special method."),pd=h(),y(it.$$.fragment),fd=h(),y(lt.$$.fragment),vn=h(),Ie=s("h2"),dt=s("a"),us=s("span"),y(vo.$$.fragment),gd=h(),_s=s("span"),ud=i("TFDeiTForMaskedImageModeling"),Mn=h(),ee=s("div"),y(Mo.$$.fragment),_d=h(),ke=s("p"),Td=i("DeiT Model with a decoder on top for masked image modeling, as proposed in "),$o=s("a"),bd=i("SimMIM"),yd=i(`.
This model is a TensorFlow
`),Io=s("a"),wd=i("tf.keras.layers.Layer"),vd=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Md=h(),A=s("div"),y(ko.$$.fragment),$d=h(),Fe=s("p"),Id=i("The "),ma=s("a"),kd=i("TFDeiTForMaskedImageModeling"),Fd=i(" forward method, overrides the "),Ts=s("code"),jd=i("__call__"),Dd=i(" special method."),Wd=h(),y(ct.$$.fragment),Jd=h(),y(mt.$$.fragment),$n=h(),je=s("h2"),ht=s("a"),bs=s("span"),y(Fo.$$.fragment),Ed=h(),ys=s("span"),Cd=i("TFDeiTForImageClassification"),In=h(),z=s("div"),y(jo.$$.fragment),Zd=h(),ws=s("p"),Ud=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.`),Nd=h(),Do=s("p"),xd=i(`This model is a TensorFlow
`),Wo=s("a"),zd=i("tf.keras.layers.Layer"),Gd=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Rd=h(),S=s("div"),y(Jo.$$.fragment),Bd=h(),De=s("p"),Vd=i("The "),ha=s("a"),Pd=i("TFDeiTForImageClassification"),Xd=i(" forward method, overrides the "),vs=s("code"),Yd=i("__call__"),Ad=i(" special method."),Sd=h(),y(pt.$$.fragment),qd=h(),y(ft.$$.fragment),kn=h(),We=s("h2"),gt=s("a"),Ms=s("span"),y(Eo.$$.fragment),Ld=h(),$s=s("span"),Qd=i("TFDeiTForImageClassificationWithTeacher"),Fn=h(),J=s("div"),y(Co.$$.fragment),Hd=h(),Is=s("p"),Od=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.`),Kd=h(),ks=s("p"),ec=i(".. warning::"),tc=h(),Fs=s("p"),oc=i(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),ac=h(),Zo=s("p"),sc=i(`This model is a TensorFlow
`),Uo=s("a"),nc=i("tf.keras.layers.Layer"),rc=i(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ic=h(),q=s("div"),y(No.$$.fragment),lc=h(),Je=s("p"),dc=i("The "),pa=s("a"),cc=i("TFDeiTForImageClassificationWithTeacher"),mc=i(" forward method, overrides the "),js=s("code"),hc=i("__call__"),pc=i(" special method."),fc=h(),y(ut.$$.fragment),gc=h(),y(_t.$$.fragment),this.h()},l(t){const u=hh('[data-svelte="svelte-1phssyn"]',document.head);d=n(u,"META",{name:!0,content:!0}),u.forEach(o),b=p(t),g=n(t,"H1",{class:!0});var xo=r(g);f=n(xo,"A",{id:!0,class:!0,href:!0});var Ds=r(f);T=n(Ds,"SPAN",{});var Ws=r(T);w(a.$$.fragment,Ws),Ws.forEach(o),Ds.forEach(o),m=p(xo),F=n(xo,"SPAN",{});var Js=r(F);Kn=l(Js,"DeiT"),Js.forEach(o),xo.forEach(o),Xs=p(t),w(Ne.$$.fragment,t),Ys=p(t),re=n(t,"H2",{class:!0});var zo=r(re);xe=n(zo,"A",{id:!0,class:!0,href:!0});var Es=r(xe);Wa=n(Es,"SPAN",{});var Cs=r(Wa);w(Dt.$$.fragment,Cs),Cs.forEach(o),Es.forEach(o),er=p(zo),Ja=n(zo,"SPAN",{});var Zs=r(Ja);tr=l(Zs,"Overview"),Zs.forEach(o),zo.forEach(o),As=p(t),R=n(t,"P",{});var te=r(R);or=l(te,"The DeiT model was proposed in "),Wt=n(te,"A",{href:!0,rel:!0});var Us=r(Wt);ar=l(Us,"Training data-efficient image transformers & distillation through attention"),Us.forEach(o),sr=l(te,` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),Ro=n(te,"A",{href:!0});var Ns=r(Ro);nr=l(Ns,"Vision Transformer (ViT)"),Ns.forEach(o),rr=l(te," introduced in "),Jt=n(te,"A",{href:!0,rel:!0});var xs=r(Jt);ir=l(xs,"Dosovitskiy et al., 2020"),xs.forEach(o),lr=l(te,` has shown that one can match or even outperform existing convolutional neural
networks using a Transformer encoder (BERT-like). However, the ViT models introduced in that paper required training on
expensive infrastructure for multiple weeks, using external data. DeiT (data-efficient image transformers) are more
efficiently trained transformers for image classification, requiring far less data and far less computing resources
compared to the original ViT models.`),te.forEach(o),Ss=p(t),Bo=n(t,"P",{});var zs=r(Bo);dr=l(zs,"The abstract from the paper is the following:"),zs.forEach(o),qs=p(t),Vo=n(t,"P",{});var Gs=r(Vo);Ea=n(Gs,"EM",{});var Rs=r(Ea);cr=l(Rs,`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.`),Rs.forEach(o),Gs.forEach(o),Ls=p(t),Po=n(t,"P",{});var Bs=r(Po);mr=l(Bs,"Tips:"),Bs.forEach(o),Qs=p(t),Z=n(t,"UL",{});var G=r(Z);Ca=n(G,"LI",{});var Vs=r(Ca);hr=l(Vs,`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.`),Vs.forEach(o),pr=p(G),ie=n(G,"LI",{});var Ee=r(ie);fr=l(Ee,`There are 2 ways to fine-tune distilled models, either (1) in a classic way, by only placing a prediction head on top
of the final hidden state of the class token and not using the distillation signal, or (2) by placing both a
prediction head on top of the class token and on top of the distillation token. In that case, the [CLS] prediction
head is trained using regular cross-entropy between the prediction of the head and the ground-truth label, while the
distillation prediction head is trained using hard distillation (cross-entropy between the prediction of the
distillation head and the label predicted by the teacher). At inference time, one takes the average prediction
between both heads as final prediction. (2) is also called \u201Cfine-tuning with distillation\u201D, because one relies on a
teacher that has already been fine-tuned on the downstream dataset. In terms of models, (1) corresponds to
`),Xo=n(Ee,"A",{href:!0});var _c=r(Xo);gr=l(_c,"DeiTForImageClassification"),_c.forEach(o),ur=l(Ee,` and (2) corresponds to
`),Yo=n(Ee,"A",{href:!0});var Tc=r(Yo);_r=l(Tc,"DeiTForImageClassificationWithTeacher"),Tc.forEach(o),Tr=l(Ee,"."),Ee.forEach(o),br=p(G),Za=n(G,"LI",{});var bc=r(Za);yr=l(bc,`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.`),bc.forEach(o),wr=p(G),Ua=n(G,"LI",{});var yc=r(Ua);vr=l(yc,`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.`),yc.forEach(o),Mr=p(G),D=n(G,"LI",{});var E=r(D);$r=l(E,`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),Ao=n(E,"A",{href:!0});var wc=r(Ao);Ir=l(wc,"ViTModel"),wc.forEach(o),kr=l(E," or "),So=n(E,"A",{href:!0});var vc=r(So);Fr=l(vc,"ViTForImageClassification"),vc.forEach(o),jr=l(E,`. Techniques like data
augmentation, optimization, and regularization were used in order to simulate training on a much larger dataset
(while only using ImageNet-1k for pre-training). There are 4 variants available (in 3 different sizes):
`),Na=n(E,"EM",{});var Mc=r(Na);Dr=l(Mc,"facebook/deit-tiny-patch16-224"),Mc.forEach(o),Wr=l(E,", "),xa=n(E,"EM",{});var $c=r(xa);Jr=l($c,"facebook/deit-small-patch16-224"),$c.forEach(o),Er=l(E,", "),za=n(E,"EM",{});var Ic=r(za);Cr=l(Ic,"facebook/deit-base-patch16-224"),Ic.forEach(o),Zr=l(E,` and
`),Ga=n(E,"EM",{});var kc=r(Ga);Ur=l(kc,"facebook/deit-base-patch16-384"),kc.forEach(o),Nr=l(E,". Note that one should use "),qo=n(E,"A",{href:!0});var Fc=r(qo);xr=l(Fc,"DeiTImageProcessor"),Fc.forEach(o),zr=l(E,` in order to
prepare images for the model.`),E.forEach(o),G.forEach(o),Hs=p(t),oe=n(t,"P",{});var fa=r(oe);Gr=l(fa,"This model was contributed by "),Et=n(fa,"A",{href:!0,rel:!0});var jc=r(Et);Rr=l(jc,"nielsr"),jc.forEach(o),Br=l(fa,". The TensorFlow version of this model was added by "),Ct=n(fa,"A",{href:!0,rel:!0});var Dc=r(Ct);Vr=l(Dc,"amyeroberts"),Dc.forEach(o),Pr=l(fa,"."),fa.forEach(o),Os=p(t),le=n(t,"H2",{class:!0});var Dn=r(le);ze=n(Dn,"A",{id:!0,class:!0,href:!0});var Wc=r(ze);Ra=n(Wc,"SPAN",{});var Jc=r(Ra);w(Zt.$$.fragment,Jc),Jc.forEach(o),Wc.forEach(o),Xr=p(Dn),Ba=n(Dn,"SPAN",{});var Ec=r(Ba);Yr=l(Ec,"Resources"),Ec.forEach(o),Dn.forEach(o),Ks=p(t),Lo=n(t,"P",{});var Cc=r(Lo);Ar=l(Cc,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DeiT."),Cc.forEach(o),en=p(t),w(Ut.$$.fragment,t),tn=p(t),Ge=n(t,"UL",{});var Wn=r(Ge);ae=n(Wn,"LI",{});var Go=r(ae);Qo=n(Go,"A",{href:!0});var Zc=r(Qo);Sr=l(Zc,"DeiTForImageClassification"),Zc.forEach(o),qr=l(Go," is supported by this "),Nt=n(Go,"A",{href:!0,rel:!0});var Uc=r(Nt);Lr=l(Uc,"example script"),Uc.forEach(o),Qr=l(Go," and "),xt=n(Go,"A",{href:!0,rel:!0});var Nc=r(xt);Hr=l(Nc,"notebook"),Nc.forEach(o),Or=l(Go,"."),Go.forEach(o),Kr=p(Wn),Ho=n(Wn,"LI",{});var uc=r(Ho);ei=l(uc,"See also: "),Oo=n(uc,"A",{href:!0});var xc=r(Oo);ti=l(xc,"Image classification task guide"),xc.forEach(o),uc.forEach(o),Wn.forEach(o),on=p(t),Ko=n(t,"P",{});var zc=r(Ko);oi=l(zc,"Besides that:"),zc.forEach(o),an=p(t),ea=n(t,"UL",{});var Gc=r(ea);Re=n(Gc,"LI",{});var Ps=r(Re);ta=n(Ps,"A",{href:!0});var Rc=r(ta);ai=l(Rc,"DeiTForMaskedImageModeling"),Rc.forEach(o),si=l(Ps," is supported by this "),zt=n(Ps,"A",{href:!0,rel:!0});var Bc=r(zt);ni=l(Bc,"example script"),Bc.forEach(o),ri=l(Ps,"."),Ps.forEach(o),Gc.forEach(o),sn=p(t),oa=n(t,"P",{});var Vc=r(oa);ii=l(Vc,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Vc.forEach(o),nn=p(t),de=n(t,"H2",{class:!0});var Jn=r(de);Be=n(Jn,"A",{id:!0,class:!0,href:!0});var Pc=r(Be);Va=n(Pc,"SPAN",{});var Xc=r(Va);w(Gt.$$.fragment,Xc),Xc.forEach(o),Pc.forEach(o),li=p(Jn),Pa=n(Jn,"SPAN",{});var Yc=r(Pa);di=l(Yc,"DeiTConfig"),Yc.forEach(o),Jn.forEach(o),rn=p(t),N=n(t,"DIV",{class:!0});var Tt=r(N);w(Rt.$$.fragment,Tt),ci=p(Tt),ce=n(Tt,"P",{});var ga=r(ce);mi=l(ga,"This is the configuration class to store the configuration of a "),aa=n(ga,"A",{href:!0});var Ac=r(aa);hi=l(Ac,"DeiTModel"),Ac.forEach(o),pi=l(ga,`. 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
`),Bt=n(ga,"A",{href:!0,rel:!0});var Sc=r(Bt);fi=l(Sc,"facebook/deit-base-distilled-patch16-224"),Sc.forEach(o),gi=l(ga,`
architecture.`),ga.forEach(o),ui=p(Tt),me=n(Tt,"P",{});var ua=r(me);_i=l(ua,"Configuration objects inherit from "),sa=n(ua,"A",{href:!0});var qc=r(sa);Ti=l(qc,"PretrainedConfig"),qc.forEach(o),bi=l(ua,` and can be used to control the model outputs. Read the
documentation from `),na=n(ua,"A",{href:!0});var Lc=r(na);yi=l(Lc,"PretrainedConfig"),Lc.forEach(o),wi=l(ua," for more information."),ua.forEach(o),vi=p(Tt),w(Ve.$$.fragment,Tt),Tt.forEach(o),ln=p(t),he=n(t,"H2",{class:!0});var En=r(he);Pe=n(En,"A",{id:!0,class:!0,href:!0});var Qc=r(Pe);Xa=n(Qc,"SPAN",{});var Hc=r(Xa);w(Vt.$$.fragment,Hc),Hc.forEach(o),Qc.forEach(o),Mi=p(En),Ya=n(En,"SPAN",{});var Oc=r(Ya);$i=l(Oc,"DeiTFeatureExtractor"),Oc.forEach(o),En.forEach(o),dn=p(t),pe=n(t,"DIV",{class:!0});var Cn=r(pe);w(Pt.$$.fragment,Cn),Ii=p(Cn),Xe=n(Cn,"DIV",{class:!0});var Zn=r(Xe);w(Xt.$$.fragment,Zn),ki=p(Zn),Aa=n(Zn,"P",{});var Kc=r(Aa);Fi=l(Kc,"Preprocess an image or a batch of images."),Kc.forEach(o),Zn.forEach(o),Cn.forEach(o),cn=p(t),fe=n(t,"H2",{class:!0});var Un=r(fe);Ye=n(Un,"A",{id:!0,class:!0,href:!0});var em=r(Ye);Sa=n(em,"SPAN",{});var tm=r(Sa);w(Yt.$$.fragment,tm),tm.forEach(o),em.forEach(o),ji=p(Un),qa=n(Un,"SPAN",{});var om=r(qa);Di=l(om,"DeiTImageProcessor"),om.forEach(o),Un.forEach(o),mn=p(t),H=n(t,"DIV",{class:!0});var _a=r(H);w(At.$$.fragment,_a),Wi=p(_a),La=n(_a,"P",{});var am=r(La);Ji=l(am,"Constructs a DeiT image processor."),am.forEach(o),Ei=p(_a),Ae=n(_a,"DIV",{class:!0});var Nn=r(Ae);w(St.$$.fragment,Nn),Ci=p(Nn),Qa=n(Nn,"P",{});var sm=r(Qa);Zi=l(sm,"Preprocess an image or batch of images."),sm.forEach(o),Nn.forEach(o),_a.forEach(o),hn=p(t),ge=n(t,"H2",{class:!0});var xn=r(ge);Se=n(xn,"A",{id:!0,class:!0,href:!0});var nm=r(Se);Ha=n(nm,"SPAN",{});var rm=r(Ha);w(qt.$$.fragment,rm),rm.forEach(o),nm.forEach(o),Ui=p(xn),Oa=n(xn,"SPAN",{});var im=r(Oa);Ni=l(im,"DeiTModel"),im.forEach(o),xn.forEach(o),pn=p(t),O=n(t,"DIV",{class:!0});var Ta=r(O);w(Lt.$$.fragment,Ta),xi=p(Ta),Qt=n(Ta,"P",{});var zn=r(Qt);zi=l(zn,`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ht=n(zn,"A",{href:!0,rel:!0});var lm=r(Ht);Gi=l(lm,"torch.nn.Module"),lm.forEach(o),Ri=l(zn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zn.forEach(o),Bi=p(Ta),B=n(Ta,"DIV",{class:!0});var bt=r(B);w(Ot.$$.fragment,bt),Vi=p(bt),ue=n(bt,"P",{});var ba=r(ue);Pi=l(ba,"The "),ra=n(ba,"A",{href:!0});var dm=r(ra);Xi=l(dm,"DeiTModel"),dm.forEach(o),Yi=l(ba," forward method, overrides the "),Ka=n(ba,"CODE",{});var cm=r(Ka);Ai=l(cm,"__call__"),cm.forEach(o),Si=l(ba," special method."),ba.forEach(o),qi=p(bt),w(qe.$$.fragment,bt),Li=p(bt),w(Le.$$.fragment,bt),bt.forEach(o),Ta.forEach(o),fn=p(t),_e=n(t,"H2",{class:!0});var Gn=r(_e);Qe=n(Gn,"A",{id:!0,class:!0,href:!0});var mm=r(Qe);es=n(mm,"SPAN",{});var hm=r(es);w(Kt.$$.fragment,hm),hm.forEach(o),mm.forEach(o),Qi=p(Gn),ts=n(Gn,"SPAN",{});var pm=r(ts);Hi=l(pm,"DeiTForMaskedImageModeling"),pm.forEach(o),Gn.forEach(o),gn=p(t),C=n(t,"DIV",{class:!0});var se=r(C);w(eo.$$.fragment,se),Oi=p(se),to=n(se,"P",{});var Rn=r(to);Ki=l(Rn,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),oo=n(Rn,"A",{href:!0,rel:!0});var fm=r(oo);el=l(fm,"SimMIM"),fm.forEach(o),tl=l(Rn,"."),Rn.forEach(o),ol=p(se),w(He.$$.fragment,se),al=p(se),ao=n(se,"P",{});var Bn=r(ao);sl=l(Bn,"This model is a PyTorch "),so=n(Bn,"A",{href:!0,rel:!0});var gm=r(so);nl=l(gm,"torch.nn.Module"),gm.forEach(o),rl=l(Bn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bn.forEach(o),il=p(se),V=n(se,"DIV",{class:!0});var yt=r(V);w(no.$$.fragment,yt),ll=p(yt),Te=n(yt,"P",{});var ya=r(Te);dl=l(ya,"The "),ia=n(ya,"A",{href:!0});var um=r(ia);cl=l(um,"DeiTForMaskedImageModeling"),um.forEach(o),ml=l(ya," forward method, overrides the "),os=n(ya,"CODE",{});var _m=r(os);hl=l(_m,"__call__"),_m.forEach(o),pl=l(ya," special method."),ya.forEach(o),fl=p(yt),w(Oe.$$.fragment,yt),gl=p(yt),w(Ke.$$.fragment,yt),yt.forEach(o),se.forEach(o),un=p(t),be=n(t,"H2",{class:!0});var Vn=r(be);et=n(Vn,"A",{id:!0,class:!0,href:!0});var Tm=r(et);as=n(Tm,"SPAN",{});var bm=r(as);w(ro.$$.fragment,bm),bm.forEach(o),Tm.forEach(o),ul=p(Vn),ss=n(Vn,"SPAN",{});var ym=r(ss);_l=l(ym,"DeiTForImageClassification"),ym.forEach(o),Vn.forEach(o),_n=p(t),x=n(t,"DIV",{class:!0});var wt=r(x);w(io.$$.fragment,wt),Tl=p(wt),ns=n(wt,"P",{});var wm=r(ns);bl=l(wm,`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.`),wm.forEach(o),yl=p(wt),lo=n(wt,"P",{});var Pn=r(lo);wl=l(Pn,"This model is a PyTorch "),co=n(Pn,"A",{href:!0,rel:!0});var vm=r(co);vl=l(vm,"torch.nn.Module"),vm.forEach(o),Ml=l(Pn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pn.forEach(o),$l=p(wt),P=n(wt,"DIV",{class:!0});var vt=r(P);w(mo.$$.fragment,vt),Il=p(vt),ye=n(vt,"P",{});var wa=r(ye);kl=l(wa,"The "),la=n(wa,"A",{href:!0});var Mm=r(la);Fl=l(Mm,"DeiTForImageClassification"),Mm.forEach(o),jl=l(wa," forward method, overrides the "),rs=n(wa,"CODE",{});var $m=r(rs);Dl=l($m,"__call__"),$m.forEach(o),Wl=l(wa," special method."),wa.forEach(o),Jl=p(vt),w(tt.$$.fragment,vt),El=p(vt),w(ot.$$.fragment,vt),vt.forEach(o),wt.forEach(o),Tn=p(t),we=n(t,"H2",{class:!0});var Xn=r(we);at=n(Xn,"A",{id:!0,class:!0,href:!0});var Im=r(at);is=n(Im,"SPAN",{});var km=r(is);w(ho.$$.fragment,km),km.forEach(o),Im.forEach(o),Cl=p(Xn),ls=n(Xn,"SPAN",{});var Fm=r(ls);Zl=l(Fm,"DeiTForImageClassificationWithTeacher"),Fm.forEach(o),Xn.forEach(o),bn=p(t),W=n(t,"DIV",{class:!0});var L=r(W);w(po.$$.fragment,L),Ul=p(L),ds=n(L,"P",{});var jm=r(ds);Nl=l(jm,`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.`),jm.forEach(o),xl=p(L),cs=n(L,"P",{});var Dm=r(cs);zl=l(Dm,".. warning::"),Dm.forEach(o),Gl=p(L),ms=n(L,"P",{});var Wm=r(ms);Rl=l(Wm,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Wm.forEach(o),Bl=p(L),fo=n(L,"P",{});var Yn=r(fo);Vl=l(Yn,"This model is a PyTorch "),go=n(Yn,"A",{href:!0,rel:!0});var Jm=r(go);Pl=l(Jm,"torch.nn.Module"),Jm.forEach(o),Xl=l(Yn,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yn.forEach(o),Yl=p(L),X=n(L,"DIV",{class:!0});var Mt=r(X);w(uo.$$.fragment,Mt),Al=p(Mt),ve=n(Mt,"P",{});var va=r(ve);Sl=l(va,"The "),da=n(va,"A",{href:!0});var Em=r(da);ql=l(Em,"DeiTForImageClassificationWithTeacher"),Em.forEach(o),Ll=l(va," forward method, overrides the "),hs=n(va,"CODE",{});var Cm=r(hs);Ql=l(Cm,"__call__"),Cm.forEach(o),Hl=l(va," special method."),va.forEach(o),Ol=p(Mt),w(st.$$.fragment,Mt),Kl=p(Mt),w(nt.$$.fragment,Mt),Mt.forEach(o),L.forEach(o),yn=p(t),Me=n(t,"H2",{class:!0});var An=r(Me);rt=n(An,"A",{id:!0,class:!0,href:!0});var Zm=r(rt);ps=n(Zm,"SPAN",{});var Um=r(ps);w(_o.$$.fragment,Um),Um.forEach(o),Zm.forEach(o),ed=p(An),fs=n(An,"SPAN",{});var Nm=r(fs);td=l(Nm,"TFDeiTModel"),Nm.forEach(o),An.forEach(o),wn=p(t),K=n(t,"DIV",{class:!0});var Ma=r(K);w(To.$$.fragment,Ma),od=p(Ma),bo=n(Ma,"P",{});var Sn=r(bo);ad=l(Sn,`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),yo=n(Sn,"A",{href:!0,rel:!0});var xm=r(yo);sd=l(xm,"tf.keras.layers.Layer"),xm.forEach(o),nd=l(Sn,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Sn.forEach(o),rd=p(Ma),Y=n(Ma,"DIV",{class:!0});var $t=r(Y);w(wo.$$.fragment,$t),id=p($t),$e=n($t,"P",{});var $a=r($e);ld=l($a,"The "),ca=n($a,"A",{href:!0});var zm=r(ca);dd=l(zm,"TFDeiTModel"),zm.forEach(o),cd=l($a," forward method, overrides the "),gs=n($a,"CODE",{});var Gm=r(gs);md=l(Gm,"__call__"),Gm.forEach(o),hd=l($a," special method."),$a.forEach(o),pd=p($t),w(it.$$.fragment,$t),fd=p($t),w(lt.$$.fragment,$t),$t.forEach(o),Ma.forEach(o),vn=p(t),Ie=n(t,"H2",{class:!0});var qn=r(Ie);dt=n(qn,"A",{id:!0,class:!0,href:!0});var Rm=r(dt);us=n(Rm,"SPAN",{});var Bm=r(us);w(vo.$$.fragment,Bm),Bm.forEach(o),Rm.forEach(o),gd=p(qn),_s=n(qn,"SPAN",{});var Vm=r(_s);ud=l(Vm,"TFDeiTForMaskedImageModeling"),Vm.forEach(o),qn.forEach(o),Mn=p(t),ee=n(t,"DIV",{class:!0});var Ia=r(ee);w(Mo.$$.fragment,Ia),_d=p(Ia),ke=n(Ia,"P",{});var ka=r(ke);Td=l(ka,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),$o=n(ka,"A",{href:!0,rel:!0});var Pm=r($o);bd=l(Pm,"SimMIM"),Pm.forEach(o),yd=l(ka,`.
This model is a TensorFlow
`),Io=n(ka,"A",{href:!0,rel:!0});var Xm=r(Io);wd=l(Xm,"tf.keras.layers.Layer"),Xm.forEach(o),vd=l(ka,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ka.forEach(o),Md=p(Ia),A=n(Ia,"DIV",{class:!0});var It=r(A);w(ko.$$.fragment,It),$d=p(It),Fe=n(It,"P",{});var Fa=r(Fe);Id=l(Fa,"The "),ma=n(Fa,"A",{href:!0});var Ym=r(ma);kd=l(Ym,"TFDeiTForMaskedImageModeling"),Ym.forEach(o),Fd=l(Fa," forward method, overrides the "),Ts=n(Fa,"CODE",{});var Am=r(Ts);jd=l(Am,"__call__"),Am.forEach(o),Dd=l(Fa," special method."),Fa.forEach(o),Wd=p(It),w(ct.$$.fragment,It),Jd=p(It),w(mt.$$.fragment,It),It.forEach(o),Ia.forEach(o),$n=p(t),je=n(t,"H2",{class:!0});var Ln=r(je);ht=n(Ln,"A",{id:!0,class:!0,href:!0});var Sm=r(ht);bs=n(Sm,"SPAN",{});var qm=r(bs);w(Fo.$$.fragment,qm),qm.forEach(o),Sm.forEach(o),Ed=p(Ln),ys=n(Ln,"SPAN",{});var Lm=r(ys);Cd=l(Lm,"TFDeiTForImageClassification"),Lm.forEach(o),Ln.forEach(o),In=p(t),z=n(t,"DIV",{class:!0});var kt=r(z);w(jo.$$.fragment,kt),Zd=p(kt),ws=n(kt,"P",{});var Qm=r(ws);Ud=l(Qm,`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.`),Qm.forEach(o),Nd=p(kt),Do=n(kt,"P",{});var Qn=r(Do);xd=l(Qn,`This model is a TensorFlow
`),Wo=n(Qn,"A",{href:!0,rel:!0});var Hm=r(Wo);zd=l(Hm,"tf.keras.layers.Layer"),Hm.forEach(o),Gd=l(Qn,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Qn.forEach(o),Rd=p(kt),S=n(kt,"DIV",{class:!0});var Ft=r(S);w(Jo.$$.fragment,Ft),Bd=p(Ft),De=n(Ft,"P",{});var ja=r(De);Vd=l(ja,"The "),ha=n(ja,"A",{href:!0});var Om=r(ha);Pd=l(Om,"TFDeiTForImageClassification"),Om.forEach(o),Xd=l(ja," forward method, overrides the "),vs=n(ja,"CODE",{});var Km=r(vs);Yd=l(Km,"__call__"),Km.forEach(o),Ad=l(ja," special method."),ja.forEach(o),Sd=p(Ft),w(pt.$$.fragment,Ft),qd=p(Ft),w(ft.$$.fragment,Ft),Ft.forEach(o),kt.forEach(o),kn=p(t),We=n(t,"H2",{class:!0});var Hn=r(We);gt=n(Hn,"A",{id:!0,class:!0,href:!0});var eh=r(gt);Ms=n(eh,"SPAN",{});var th=r(Ms);w(Eo.$$.fragment,th),th.forEach(o),eh.forEach(o),Ld=p(Hn),$s=n(Hn,"SPAN",{});var oh=r($s);Qd=l(oh,"TFDeiTForImageClassificationWithTeacher"),oh.forEach(o),Hn.forEach(o),Fn=p(t),J=n(t,"DIV",{class:!0});var Q=r(J);w(Co.$$.fragment,Q),Hd=p(Q),Is=n(Q,"P",{});var ah=r(Is);Od=l(ah,`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.`),ah.forEach(o),Kd=p(Q),ks=n(Q,"P",{});var sh=r(ks);ec=l(sh,".. warning::"),sh.forEach(o),tc=p(Q),Fs=n(Q,"P",{});var nh=r(Fs);oc=l(nh,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),nh.forEach(o),ac=p(Q),Zo=n(Q,"P",{});var On=r(Zo);sc=l(On,`This model is a TensorFlow
`),Uo=n(On,"A",{href:!0,rel:!0});var rh=r(Uo);nc=l(rh,"tf.keras.layers.Layer"),rh.forEach(o),rc=l(On,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),On.forEach(o),ic=p(Q),q=n(Q,"DIV",{class:!0});var jt=r(q);w(No.$$.fragment,jt),lc=p(jt),Je=n(jt,"P",{});var Da=r(Je);dc=l(Da,"The "),pa=n(Da,"A",{href:!0});var ih=r(pa);cc=l(ih,"TFDeiTForImageClassificationWithTeacher"),ih.forEach(o),mc=l(Da," forward method, overrides the "),js=n(Da,"CODE",{});var lh=r(js);hc=l(lh,"__call__"),lh.forEach(o),pc=l(Da," special method."),Da.forEach(o),fc=p(jt),w(ut.$$.fragment,jt),gc=p(jt),w(_t.$$.fragment,jt),jt.forEach(o),Q.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Uh)),c(f,"id","deit"),c(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(f,"href","#deit"),c(g,"class","relative group"),c(xe,"id","overview"),c(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(xe,"href","#overview"),c(re,"class","relative group"),c(Wt,"href","https://arxiv.org/abs/2012.12877"),c(Wt,"rel","nofollow"),c(Ro,"href","vit"),c(Jt,"href","https://arxiv.org/abs/2010.11929"),c(Jt,"rel","nofollow"),c(Xo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassification"),c(Yo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),c(Ao,"href","/docs/transformers/main/en/model_doc/vit#transformers.ViTModel"),c(So,"href","/docs/transformers/main/en/model_doc/vit#transformers.ViTForImageClassification"),c(qo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTImageProcessor"),c(Et,"href","https://huggingface.co/nielsr"),c(Et,"rel","nofollow"),c(Ct,"href","https://huggingface.co/amyeroberts"),c(Ct,"rel","nofollow"),c(ze,"id","resources"),c(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ze,"href","#resources"),c(le,"class","relative group"),c(Qo,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassification"),c(Nt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(Nt,"rel","nofollow"),c(xt,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(xt,"rel","nofollow"),c(Oo,"href","../tasks/image_classification"),c(ta,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForMaskedImageModeling"),c(zt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(zt,"rel","nofollow"),c(Be,"id","transformers.DeiTConfig"),c(Be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Be,"href","#transformers.DeiTConfig"),c(de,"class","relative group"),c(aa,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTModel"),c(Bt,"href","https://huggingface.co/facebook/deit-base-distilled-patch16-224"),c(Bt,"rel","nofollow"),c(sa,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(na,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pe,"id","transformers.DeiTFeatureExtractor"),c(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Pe,"href","#transformers.DeiTFeatureExtractor"),c(he,"class","relative group"),c(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ye,"id","transformers.DeiTImageProcessor"),c(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ye,"href","#transformers.DeiTImageProcessor"),c(fe,"class","relative group"),c(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Se,"id","transformers.DeiTModel"),c(Se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Se,"href","#transformers.DeiTModel"),c(ge,"class","relative group"),c(Ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ht,"rel","nofollow"),c(ra,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTModel"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Qe,"id","transformers.DeiTForMaskedImageModeling"),c(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"),c(Qe,"href","#transformers.DeiTForMaskedImageModeling"),c(_e,"class","relative group"),c(oo,"href","https://arxiv.org/abs/2111.09886"),c(oo,"rel","nofollow"),c(so,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(so,"rel","nofollow"),c(ia,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForMaskedImageModeling"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(et,"id","transformers.DeiTForImageClassification"),c(et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(et,"href","#transformers.DeiTForImageClassification"),c(be,"class","relative group"),c(co,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(co,"rel","nofollow"),c(la,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassification"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(at,"id","transformers.DeiTForImageClassificationWithTeacher"),c(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"),c(at,"href","#transformers.DeiTForImageClassificationWithTeacher"),c(we,"class","relative group"),c(go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(go,"rel","nofollow"),c(da,"href","/docs/transformers/main/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(rt,"id","transformers.TFDeiTModel"),c(rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(rt,"href","#transformers.TFDeiTModel"),c(Me,"class","relative group"),c(yo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(yo,"rel","nofollow"),c(ca,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTModel"),c(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(dt,"id","transformers.TFDeiTForMaskedImageModeling"),c(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(dt,"href","#transformers.TFDeiTForMaskedImageModeling"),c(Ie,"class","relative group"),c($o,"href","https://arxiv.org/abs/2111.09886"),c($o,"rel","nofollow"),c(Io,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(Io,"rel","nofollow"),c(ma,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTForMaskedImageModeling"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ht,"id","transformers.TFDeiTForImageClassification"),c(ht,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ht,"href","#transformers.TFDeiTForImageClassification"),c(je,"class","relative group"),c(Wo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(Wo,"rel","nofollow"),c(ha,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTForImageClassification"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(gt,"id","transformers.TFDeiTForImageClassificationWithTeacher"),c(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(gt,"href","#transformers.TFDeiTForImageClassificationWithTeacher"),c(We,"class","relative group"),c(Uo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(Uo,"rel","nofollow"),c(pa,"href","/docs/transformers/main/en/model_doc/deit#transformers.TFDeiTForImageClassificationWithTeacher"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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,b,u),_(t,g,u),e(g,f),e(f,T),v(a,T,null),e(g,m),e(g,F),e(F,Kn),_(t,Xs,u),v(Ne,t,u),_(t,Ys,u),_(t,re,u),e(re,xe),e(xe,Wa),v(Dt,Wa,null),e(re,er),e(re,Ja),e(Ja,tr),_(t,As,u),_(t,R,u),e(R,or),e(R,Wt),e(Wt,ar),e(R,sr),e(R,Ro),e(Ro,nr),e(R,rr),e(R,Jt),e(Jt,ir),e(R,lr),_(t,Ss,u),_(t,Bo,u),e(Bo,dr),_(t,qs,u),_(t,Vo,u),e(Vo,Ea),e(Ea,cr),_(t,Ls,u),_(t,Po,u),e(Po,mr),_(t,Qs,u),_(t,Z,u),e(Z,Ca),e(Ca,hr),e(Z,pr),e(Z,ie),e(ie,fr),e(ie,Xo),e(Xo,gr),e(ie,ur),e(ie,Yo),e(Yo,_r),e(ie,Tr),e(Z,br),e(Z,Za),e(Za,yr),e(Z,wr),e(Z,Ua),e(Ua,vr),e(Z,Mr),e(Z,D),e(D,$r),e(D,Ao),e(Ao,Ir),e(D,kr),e(D,So),e(So,Fr),e(D,jr),e(D,Na),e(Na,Dr),e(D,Wr),e(D,xa),e(xa,Jr),e(D,Er),e(D,za),e(za,Cr),e(D,Zr),e(D,Ga),e(Ga,Ur),e(D,Nr),e(D,qo),e(qo,xr),e(D,zr),_(t,Hs,u),_(t,oe,u),e(oe,Gr),e(oe,Et),e(Et,Rr),e(oe,Br),e(oe,Ct),e(Ct,Vr),e(oe,Pr),_(t,Os,u),_(t,le,u),e(le,ze),e(ze,Ra),v(Zt,Ra,null),e(le,Xr),e(le,Ba),e(Ba,Yr),_(t,Ks,u),_(t,Lo,u),e(Lo,Ar),_(t,en,u),v(Ut,t,u),_(t,tn,u),_(t,Ge,u),e(Ge,ae),e(ae,Qo),e(Qo,Sr),e(ae,qr),e(ae,Nt),e(Nt,Lr),e(ae,Qr),e(ae,xt),e(xt,Hr),e(ae,Or),e(Ge,Kr),e(Ge,Ho),e(Ho,ei),e(Ho,Oo),e(Oo,ti),_(t,on,u),_(t,Ko,u),e(Ko,oi),_(t,an,u),_(t,ea,u),e(ea,Re),e(Re,ta),e(ta,ai),e(Re,si),e(Re,zt),e(zt,ni),e(Re,ri),_(t,sn,u),_(t,oa,u),e(oa,ii),_(t,nn,u),_(t,de,u),e(de,Be),e(Be,Va),v(Gt,Va,null),e(de,li),e(de,Pa),e(Pa,di),_(t,rn,u),_(t,N,u),v(Rt,N,null),e(N,ci),e(N,ce),e(ce,mi),e(ce,aa),e(aa,hi),e(ce,pi),e(ce,Bt),e(Bt,fi),e(ce,gi),e(N,ui),e(N,me),e(me,_i),e(me,sa),e(sa,Ti),e(me,bi),e(me,na),e(na,yi),e(me,wi),e(N,vi),v(Ve,N,null),_(t,ln,u),_(t,he,u),e(he,Pe),e(Pe,Xa),v(Vt,Xa,null),e(he,Mi),e(he,Ya),e(Ya,$i),_(t,dn,u),_(t,pe,u),v(Pt,pe,null),e(pe,Ii),e(pe,Xe),v(Xt,Xe,null),e(Xe,ki),e(Xe,Aa),e(Aa,Fi),_(t,cn,u),_(t,fe,u),e(fe,Ye),e(Ye,Sa),v(Yt,Sa,null),e(fe,ji),e(fe,qa),e(qa,Di),_(t,mn,u),_(t,H,u),v(At,H,null),e(H,Wi),e(H,La),e(La,Ji),e(H,Ei),e(H,Ae),v(St,Ae,null),e(Ae,Ci),e(Ae,Qa),e(Qa,Zi),_(t,hn,u),_(t,ge,u),e(ge,Se),e(Se,Ha),v(qt,Ha,null),e(ge,Ui),e(ge,Oa),e(Oa,Ni),_(t,pn,u),_(t,O,u),v(Lt,O,null),e(O,xi),e(O,Qt),e(Qt,zi),e(Qt,Ht),e(Ht,Gi),e(Qt,Ri),e(O,Bi),e(O,B),v(Ot,B,null),e(B,Vi),e(B,ue),e(ue,Pi),e(ue,ra),e(ra,Xi),e(ue,Yi),e(ue,Ka),e(Ka,Ai),e(ue,Si),e(B,qi),v(qe,B,null),e(B,Li),v(Le,B,null),_(t,fn,u),_(t,_e,u),e(_e,Qe),e(Qe,es),v(Kt,es,null),e(_e,Qi),e(_e,ts),e(ts,Hi),_(t,gn,u),_(t,C,u),v(eo,C,null),e(C,Oi),e(C,to),e(to,Ki),e(to,oo),e(oo,el),e(to,tl),e(C,ol),v(He,C,null),e(C,al),e(C,ao),e(ao,sl),e(ao,so),e(so,nl),e(ao,rl),e(C,il),e(C,V),v(no,V,null),e(V,ll),e(V,Te),e(Te,dl),e(Te,ia),e(ia,cl),e(Te,ml),e(Te,os),e(os,hl),e(Te,pl),e(V,fl),v(Oe,V,null),e(V,gl),v(Ke,V,null),_(t,un,u),_(t,be,u),e(be,et),e(et,as),v(ro,as,null),e(be,ul),e(be,ss),e(ss,_l),_(t,_n,u),_(t,x,u),v(io,x,null),e(x,Tl),e(x,ns),e(ns,bl),e(x,yl),e(x,lo),e(lo,wl),e(lo,co),e(co,vl),e(lo,Ml),e(x,$l),e(x,P),v(mo,P,null),e(P,Il),e(P,ye),e(ye,kl),e(ye,la),e(la,Fl),e(ye,jl),e(ye,rs),e(rs,Dl),e(ye,Wl),e(P,Jl),v(tt,P,null),e(P,El),v(ot,P,null),_(t,Tn,u),_(t,we,u),e(we,at),e(at,is),v(ho,is,null),e(we,Cl),e(we,ls),e(ls,Zl),_(t,bn,u),_(t,W,u),v(po,W,null),e(W,Ul),e(W,ds),e(ds,Nl),e(W,xl),e(W,cs),e(cs,zl),e(W,Gl),e(W,ms),e(ms,Rl),e(W,Bl),e(W,fo),e(fo,Vl),e(fo,go),e(go,Pl),e(fo,Xl),e(W,Yl),e(W,X),v(uo,X,null),e(X,Al),e(X,ve),e(ve,Sl),e(ve,da),e(da,ql),e(ve,Ll),e(ve,hs),e(hs,Ql),e(ve,Hl),e(X,Ol),v(st,X,null),e(X,Kl),v(nt,X,null),_(t,yn,u),_(t,Me,u),e(Me,rt),e(rt,ps),v(_o,ps,null),e(Me,ed),e(Me,fs),e(fs,td),_(t,wn,u),_(t,K,u),v(To,K,null),e(K,od),e(K,bo),e(bo,ad),e(bo,yo),e(yo,sd),e(bo,nd),e(K,rd),e(K,Y),v(wo,Y,null),e(Y,id),e(Y,$e),e($e,ld),e($e,ca),e(ca,dd),e($e,cd),e($e,gs),e(gs,md),e($e,hd),e(Y,pd),v(it,Y,null),e(Y,fd),v(lt,Y,null),_(t,vn,u),_(t,Ie,u),e(Ie,dt),e(dt,us),v(vo,us,null),e(Ie,gd),e(Ie,_s),e(_s,ud),_(t,Mn,u),_(t,ee,u),v(Mo,ee,null),e(ee,_d),e(ee,ke),e(ke,Td),e(ke,$o),e($o,bd),e(ke,yd),e(ke,Io),e(Io,wd),e(ke,vd),e(ee,Md),e(ee,A),v(ko,A,null),e(A,$d),e(A,Fe),e(Fe,Id),e(Fe,ma),e(ma,kd),e(Fe,Fd),e(Fe,Ts),e(Ts,jd),e(Fe,Dd),e(A,Wd),v(ct,A,null),e(A,Jd),v(mt,A,null),_(t,$n,u),_(t,je,u),e(je,ht),e(ht,bs),v(Fo,bs,null),e(je,Ed),e(je,ys),e(ys,Cd),_(t,In,u),_(t,z,u),v(jo,z,null),e(z,Zd),e(z,ws),e(ws,Ud),e(z,Nd),e(z,Do),e(Do,xd),e(Do,Wo),e(Wo,zd),e(Do,Gd),e(z,Rd),e(z,S),v(Jo,S,null),e(S,Bd),e(S,De),e(De,Vd),e(De,ha),e(ha,Pd),e(De,Xd),e(De,vs),e(vs,Yd),e(De,Ad),e(S,Sd),v(pt,S,null),e(S,qd),v(ft,S,null),_(t,kn,u),_(t,We,u),e(We,gt),e(gt,Ms),v(Eo,Ms,null),e(We,Ld),e(We,$s),e($s,Qd),_(t,Fn,u),_(t,J,u),v(Co,J,null),e(J,Hd),e(J,Is),e(Is,Od),e(J,Kd),e(J,ks),e(ks,ec),e(J,tc),e(J,Fs),e(Fs,oc),e(J,ac),e(J,Zo),e(Zo,sc),e(Zo,Uo),e(Uo,nc),e(Zo,rc),e(J,ic),e(J,q),v(No,q,null),e(q,lc),e(q,Je),e(Je,dc),e(Je,pa),e(pa,cc),e(Je,mc),e(Je,js),e(js,hc),e(Je,pc),e(q,fc),v(ut,q,null),e(q,gc),v(_t,q,null),jn=!0},p(t,[u]){const xo={};u&2&&(xo.$$scope={dirty:u,ctx:t}),Ne.$set(xo);const Ds={};u&2&&(Ds.$$scope={dirty:u,ctx:t}),Ve.$set(Ds);const Ws={};u&2&&(Ws.$$scope={dirty:u,ctx:t}),qe.$set(Ws);const Js={};u&2&&(Js.$$scope={dirty:u,ctx:t}),Le.$set(Js);const zo={};u&2&&(zo.$$scope={dirty:u,ctx:t}),He.$set(zo);const Es={};u&2&&(Es.$$scope={dirty:u,ctx:t}),Oe.$set(Es);const Cs={};u&2&&(Cs.$$scope={dirty:u,ctx:t}),Ke.$set(Cs);const Zs={};u&2&&(Zs.$$scope={dirty:u,ctx:t}),tt.$set(Zs);const te={};u&2&&(te.$$scope={dirty:u,ctx:t}),ot.$set(te);const Us={};u&2&&(Us.$$scope={dirty:u,ctx:t}),st.$set(Us);const Ns={};u&2&&(Ns.$$scope={dirty:u,ctx:t}),nt.$set(Ns);const xs={};u&2&&(xs.$$scope={dirty:u,ctx:t}),it.$set(xs);const zs={};u&2&&(zs.$$scope={dirty:u,ctx:t}),lt.$set(zs);const Gs={};u&2&&(Gs.$$scope={dirty:u,ctx:t}),ct.$set(Gs);const Rs={};u&2&&(Rs.$$scope={dirty:u,ctx:t}),mt.$set(Rs);const Bs={};u&2&&(Bs.$$scope={dirty:u,ctx:t}),pt.$set(Bs);const G={};u&2&&(G.$$scope={dirty:u,ctx:t}),ft.$set(G);const Vs={};u&2&&(Vs.$$scope={dirty:u,ctx:t}),ut.$set(Vs);const Ee={};u&2&&(Ee.$$scope={dirty:u,ctx:t}),_t.$set(Ee)},i(t){jn||(M(a.$$.fragment,t),M(Ne.$$.fragment,t),M(Dt.$$.fragment,t),M(Zt.$$.fragment,t),M(Ut.$$.fragment,t),M(Gt.$$.fragment,t),M(Rt.$$.fragment,t),M(Ve.$$.fragment,t),M(Vt.$$.fragment,t),M(Pt.$$.fragment,t),M(Xt.$$.fragment,t),M(Yt.$$.fragment,t),M(At.$$.fragment,t),M(St.$$.fragment,t),M(qt.$$.fragment,t),M(Lt.$$.fragment,t),M(Ot.$$.fragment,t),M(qe.$$.fragment,t),M(Le.$$.fragment,t),M(Kt.$$.fragment,t),M(eo.$$.fragment,t),M(He.$$.fragment,t),M(no.$$.fragment,t),M(Oe.$$.fragment,t),M(Ke.$$.fragment,t),M(ro.$$.fragment,t),M(io.$$.fragment,t),M(mo.$$.fragment,t),M(tt.$$.fragment,t),M(ot.$$.fragment,t),M(ho.$$.fragment,t),M(po.$$.fragment,t),M(uo.$$.fragment,t),M(st.$$.fragment,t),M(nt.$$.fragment,t),M(_o.$$.fragment,t),M(To.$$.fragment,t),M(wo.$$.fragment,t),M(it.$$.fragment,t),M(lt.$$.fragment,t),M(vo.$$.fragment,t),M(Mo.$$.fragment,t),M(ko.$$.fragment,t),M(ct.$$.fragment,t),M(mt.$$.fragment,t),M(Fo.$$.fragment,t),M(jo.$$.fragment,t),M(Jo.$$.fragment,t),M(pt.$$.fragment,t),M(ft.$$.fragment,t),M(Eo.$$.fragment,t),M(Co.$$.fragment,t),M(No.$$.fragment,t),M(ut.$$.fragment,t),M(_t.$$.fragment,t),jn=!0)},o(t){$(a.$$.fragment,t),$(Ne.$$.fragment,t),$(Dt.$$.fragment,t),$(Zt.$$.fragment,t),$(Ut.$$.fragment,t),$(Gt.$$.fragment,t),$(Rt.$$.fragment,t),$(Ve.$$.fragment,t),$(Vt.$$.fragment,t),$(Pt.$$.fragment,t),$(Xt.$$.fragment,t),$(Yt.$$.fragment,t),$(At.$$.fragment,t),$(St.$$.fragment,t),$(qt.$$.fragment,t),$(Lt.$$.fragment,t),$(Ot.$$.fragment,t),$(qe.$$.fragment,t),$(Le.$$.fragment,t),$(Kt.$$.fragment,t),$(eo.$$.fragment,t),$(He.$$.fragment,t),$(no.$$.fragment,t),$(Oe.$$.fragment,t),$(Ke.$$.fragment,t),$(ro.$$.fragment,t),$(io.$$.fragment,t),$(mo.$$.fragment,t),$(tt.$$.fragment,t),$(ot.$$.fragment,t),$(ho.$$.fragment,t),$(po.$$.fragment,t),$(uo.$$.fragment,t),$(st.$$.fragment,t),$(nt.$$.fragment,t),$(_o.$$.fragment,t),$(To.$$.fragment,t),$(wo.$$.fragment,t),$(it.$$.fragment,t),$(lt.$$.fragment,t),$(vo.$$.fragment,t),$(Mo.$$.fragment,t),$(ko.$$.fragment,t),$(ct.$$.fragment,t),$(mt.$$.fragment,t),$(Fo.$$.fragment,t),$(jo.$$.fragment,t),$(Jo.$$.fragment,t),$(pt.$$.fragment,t),$(ft.$$.fragment,t),$(Eo.$$.fragment,t),$(Co.$$.fragment,t),$(No.$$.fragment,t),$(ut.$$.fragment,t),$(_t.$$.fragment,t),jn=!1},d(t){o(d),t&&o(b),t&&o(g),I(a),t&&o(Xs),I(Ne,t),t&&o(Ys),t&&o(re),I(Dt),t&&o(As),t&&o(R),t&&o(Ss),t&&o(Bo),t&&o(qs),t&&o(Vo),t&&o(Ls),t&&o(Po),t&&o(Qs),t&&o(Z),t&&o(Hs),t&&o(oe),t&&o(Os),t&&o(le),I(Zt),t&&o(Ks),t&&o(Lo),t&&o(en),I(Ut,t),t&&o(tn),t&&o(Ge),t&&o(on),t&&o(Ko),t&&o(an),t&&o(ea),t&&o(sn),t&&o(oa),t&&o(nn),t&&o(de),I(Gt),t&&o(rn),t&&o(N),I(Rt),I(Ve),t&&o(ln),t&&o(he),I(Vt),t&&o(dn),t&&o(pe),I(Pt),I(Xt),t&&o(cn),t&&o(fe),I(Yt),t&&o(mn),t&&o(H),I(At),I(St),t&&o(hn),t&&o(ge),I(qt),t&&o(pn),t&&o(O),I(Lt),I(Ot),I(qe),I(Le),t&&o(fn),t&&o(_e),I(Kt),t&&o(gn),t&&o(C),I(eo),I(He),I(no),I(Oe),I(Ke),t&&o(un),t&&o(be),I(ro),t&&o(_n),t&&o(x),I(io),I(mo),I(tt),I(ot),t&&o(Tn),t&&o(we),I(ho),t&&o(bn),t&&o(W),I(po),I(uo),I(st),I(nt),t&&o(yn),t&&o(Me),I(_o),t&&o(wn),t&&o(K),I(To),I(wo),I(it),I(lt),t&&o(vn),t&&o(Ie),I(vo),t&&o(Mn),t&&o(ee),I(Mo),I(ko),I(ct),I(mt),t&&o($n),t&&o(je),I(Fo),t&&o(In),t&&o(z),I(jo),I(Jo),I(pt),I(ft),t&&o(kn),t&&o(We),I(Eo),t&&o(Fn),t&&o(J),I(Co),I(No),I(ut),I(_t)}}}const Uh={local:"deit",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.DeiTConfig",title:"DeiTConfig"},{local:"transformers.DeiTFeatureExtractor",title:"DeiTFeatureExtractor"},{local:"transformers.DeiTImageProcessor",title:"DeiTImageProcessor"},{local:"transformers.DeiTModel",title:"DeiTModel"},{local:"transformers.DeiTForMaskedImageModeling",title:"DeiTForMaskedImageModeling"},{local:"transformers.DeiTForImageClassification",title:"DeiTForImageClassification"},{local:"transformers.DeiTForImageClassificationWithTeacher",title:"DeiTForImageClassificationWithTeacher"},{local:"transformers.TFDeiTModel",title:"TFDeiTModel"},{local:"transformers.TFDeiTForMaskedImageModeling",title:"TFDeiTForMaskedImageModeling"},{local:"transformers.TFDeiTForImageClassification",title:"TFDeiTForImageClassification"},{local:"transformers.TFDeiTForImageClassificationWithTeacher",title:"TFDeiTForImageClassificationWithTeacher"}],title:"DeiT"};function Nh(k){return ph(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xh extends dh{constructor(d){super();ch(this,d,Nh,Zh,mh,{})}}export{Xh as default,Uh as metadata};
