import{S as dm,i as cm,s as hm,e as a,k as m,w as y,t as l,M as mm,c as n,d as o,m as p,a as r,x as v,h as i,b as c,G as e,g as _,y as w,q as M,o as $,B as I,v as pm,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 fm}from"../../chunks/PipelineTag-hf-doc-builder.js";function um(k){let d,b,u,f,T;return{c(){d=a("p"),b=l(`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 `),u=a("a"),f=l("Github Issue"),T=l("."),this.h()},l(s){d=n(s,"P",{});var h=r(d);b=i(h,`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 `),u=n(h,"A",{href:!0,rel:!0});var F=r(u);f=i(F,"Github Issue"),F.forEach(o),T=i(h,"."),h.forEach(o),this.h()},h(){c(u,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),c(u,"rel","nofollow")},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function gm(k){let d,b,u,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=a("p"),b=l("Example:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Example:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function _m(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Tm(k){let d,b,u,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=a("p"),b=l("Example:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Example:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function bm(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Note that we provide a script to pre-train this model on custom data in our "),u=a("a"),f=l(`examples
directory`),T=l("."),this.h()},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Note that we provide a script to pre-train this model on custom data in our "),u=n(h,"A",{href:!0,rel:!0});var F=r(u);f=i(F,`examples
directory`),F.forEach(o),T=i(h,"."),h.forEach(o),this.h()},h(){c(u,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(u,"rel","nofollow")},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function ym(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function vm(k){let d,b,u,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=a("p"),b=l("Examples:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Examples:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function wm(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Mm(k){let d,b,u,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=a("p"),b=l("Examples:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Examples:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function $m(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Im(k){let d,b,u,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=a("p"),b=l("Example:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Example:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function km(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Fm(k){let d,b,u,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=a("p"),b=l("Example:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Example:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function jm(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Dm(k){let d,b,u,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=a("p"),b=l("Examples:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Examples:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function Wm(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Jm(k){let d,b,u,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=a("p"),b=l("Examples:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Examples:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function Em(k){let d,b,u,f,T;return{c(){d=a("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=l("Module"),T=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var F=r(u);f=i(F,"Module"),F.forEach(o),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(o)},m(s,h){_(s,d,h),e(d,b),e(d,u),e(u,f),e(d,T)},d(s){s&&o(d)}}}function Cm(k){let d,b,u,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=a("p"),b=l("Example:"),u=m(),y(f.$$.fragment)},l(s){d=n(s,"P",{});var h=r(d);b=i(h,"Example:"),h.forEach(o),u=p(s),v(f.$$.fragment,s)},m(s,h){_(s,d,h),e(d,b),_(s,u,h),w(f,s,h),T=!0},p:Ze,i(s){T||(M(f.$$.fragment,s),T=!0)},o(s){$(f.$$.fragment,s),T=!1},d(s){s&&o(d),s&&o(u),I(f,s)}}}function Zm(k){let d,b,u,f,T,s,h,F,Kn,Xa,Ne,Ya,re,xe,Ws,Dt,er,Js,tr,Aa,R,or,Wt,sr,ar,Ro,nr,rr,Jt,lr,ir,Sa,Bo,dr,La,Vo,Es,cr,qa,Po,hr,Qa,Z,Cs,mr,pr,le,fr,Xo,ur,gr,Yo,_r,Tr,br,Zs,yr,vr,Us,wr,Mr,D,$r,Ao,Ir,kr,So,Fr,jr,Ns,Dr,Wr,xs,Jr,Er,zs,Cr,Zr,Gs,Ur,Nr,Lo,xr,zr,Ha,oe,Gr,Et,Rr,Br,Ct,Vr,Pr,Oa,ie,ze,Rs,Zt,Xr,Bs,Yr,Ka,qo,Ar,en,Ut,tn,Ge,se,Qo,Sr,Lr,Nt,qr,Qr,xt,Hr,Or,Kr,Ho,el,Oo,tl,on,Ko,ol,sn,es,Re,ts,sl,al,zt,nl,rl,an,os,ll,nn,de,Be,Vs,Gt,il,Ps,dl,rn,N,Rt,cl,ce,hl,ss,ml,pl,Bt,fl,ul,gl,he,_l,as,Tl,bl,ns,yl,vl,wl,Ve,ln,me,Pe,Xs,Vt,Ml,Ys,$l,dn,pe,Pt,Il,Xe,Xt,kl,As,Fl,cn,fe,Ye,Ss,Yt,jl,Ls,Dl,hn,H,At,Wl,qs,Jl,El,Ae,St,Cl,Qs,Zl,mn,ue,Se,Hs,Lt,Ul,Os,Nl,pn,O,qt,xl,Qt,zl,Ht,Gl,Rl,Bl,B,Ot,Vl,ge,Pl,rs,Xl,Yl,Ks,Al,Sl,Ll,Le,ql,qe,fn,_e,Qe,ea,Kt,Ql,ta,Hl,un,C,eo,Ol,to,Kl,oo,ei,ti,oi,He,si,so,ai,ao,ni,ri,li,V,no,ii,Te,di,ls,ci,hi,oa,mi,pi,fi,Oe,ui,Ke,gn,be,et,sa,ro,gi,aa,_i,_n,x,lo,Ti,na,bi,yi,io,vi,co,wi,Mi,$i,P,ho,Ii,ye,ki,is,Fi,ji,ra,Di,Wi,Ji,tt,Ei,ot,Tn,ve,st,la,mo,Ci,ia,Zi,bn,W,po,Ui,da,Ni,xi,ca,zi,Gi,ha,Ri,Bi,fo,Vi,uo,Pi,Xi,Yi,X,go,Ai,we,Si,ds,Li,qi,ma,Qi,Hi,Oi,at,Ki,nt,yn,Me,rt,pa,_o,ed,fa,td,vn,K,To,od,bo,sd,yo,ad,nd,rd,Y,vo,ld,$e,id,cs,dd,cd,ua,hd,md,pd,lt,fd,it,wn,Ie,dt,ga,wo,ud,_a,gd,Mn,ee,Mo,_d,ke,Td,$o,bd,yd,Io,vd,wd,Md,A,ko,$d,Fe,Id,hs,kd,Fd,Ta,jd,Dd,Wd,ct,Jd,ht,$n,je,mt,ba,Fo,Ed,ya,Cd,In,z,jo,Zd,va,Ud,Nd,Do,xd,Wo,zd,Gd,Rd,S,Jo,Bd,De,Vd,ms,Pd,Xd,wa,Yd,Ad,Sd,pt,Ld,ft,kn,We,ut,Ma,Eo,qd,$a,Qd,Fn,J,Co,Hd,Ia,Od,Kd,ka,ec,tc,Fa,oc,sc,Zo,ac,Uo,nc,rc,lc,L,No,ic,Je,dc,ps,cc,hc,ja,mc,pc,fc,gt,uc,_t,jn;return s=new U({}),Ne=new ne({props:{$$slots:{default:[um]},$$scope:{ctx:k}}}),Dt=new U({}),Zt=new U({}),Ut=new fm({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/v4.30.0/src/transformers/models/deit/configuration_deit.py#L37"}}),Ve=new Ce({props:{anchor:"transformers.DeiTConfig.example",$$slots:{default:[gm]},$$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/v4.30.0/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/v4.30.0/src/transformers/image_processing_utils.py#L462"}}),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/v4.30.0/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/v4.30.0/src/transformers/models/deit/image_processing_deit.py#L205"}}),Lt=new U({}),qt=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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/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/v4.30.0/src/transformers/models/deit/modeling_deit.py#L486",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new ne({props:{$$slots:{default:[_m]},$$scope:{ctx:k}}}),qe=new Ce({props:{anchor:"transformers.DeiTModel.forward.example",$$slots:{default:[Tm]},$$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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deit/modeling_deit.py#L581"}}),He=new ne({props:{$$slots:{default:[bm]},$$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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DeiTForMaskedImageModeling.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/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:[ym]},$$scope:{ctx:k}}}),Ke=new Ce({props:{anchor:"transformers.DeiTForMaskedImageModeling.forward.example",$$slots:{default:[vm]},$$scope:{ctx:k}}}),ro=new U({}),lo=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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deit/modeling_deit.py#L693"}}),ho=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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DeiTForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deit/modeling_deit.py#L706",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/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:[wm]},$$scope:{ctx:k}}}),ot=new Ce({props:{anchor:"transformers.DeiTForImageClassification.forward.example",$$slots:{default:[Mm]},$$scope:{ctx:k}}}),mo=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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deit/modeling_deit.py#L843"}}),go=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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/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>
`}}),at=new ne({props:{$$slots:{default:[$m]},$$scope:{ctx:k}}}),nt=new Ce({props:{anchor:"transformers.DeiTForImageClassificationWithTeacher.forward.example",$$slots:{default:[Im]},$$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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deit/modeling_tf_deit.py#L610"}}),vo=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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/deit/modeling_tf_deit.py#L620",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),lt=new ne({props:{$$slots:{default:[km]},$$scope:{ctx:k}}}),it=new Ce({props:{anchor:"transformers.TFDeiTModel.call.example",$$slots:{default:[Fm]},$$scope:{ctx:k}}}),wo=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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFDeiTForMaskedImageModeling.call.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>tf.Tensor</code> of type bool and shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/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:[jm]},$$scope:{ctx:k}}}),ht=new Ce({props:{anchor:"transformers.TFDeiTForMaskedImageModeling.call.example",$$slots:{default:[Dm]},$$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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForImageClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFDeiTForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/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:[Wm]},$$scope:{ctx:k}}}),ft=new Ce({props:{anchor:"transformers.TFDeiTForImageClassification.call.example",$$slots:{default:[Jm]},$$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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig">DeiTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">DeiTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/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/v4.30.0/en/model_doc/deit#transformers.DeiTConfig"
>DeiTConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores as the average of the cls_logits and distillation logits.</li>
<li><strong>cls_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the
class token).</li>
<li><strong>distillation_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the
distillation token).</li>
<li><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer plus
the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.deit.modeling_tf_deit.TFDeiTForImageClassificationWithTeacherOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),gt=new ne({props:{$$slots:{default:[Em]},$$scope:{ctx:k}}}),_t=new Ce({props:{anchor:"transformers.TFDeiTForImageClassificationWithTeacher.call.example",$$slots:{default:[Cm]},$$scope:{ctx:k}}}),{c(){d=a("meta"),b=m(),u=a("h1"),f=a("a"),T=a("span"),y(s.$$.fragment),h=m(),F=a("span"),Kn=l("DeiT"),Xa=m(),y(Ne.$$.fragment),Ya=m(),re=a("h2"),xe=a("a"),Ws=a("span"),y(Dt.$$.fragment),er=m(),Js=a("span"),tr=l("Overview"),Aa=m(),R=a("p"),or=l("The DeiT model was proposed in "),Wt=a("a"),sr=l("Training data-efficient image transformers & distillation through attention"),ar=l(` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),Ro=a("a"),nr=l("Vision Transformer (ViT)"),rr=l(" introduced in "),Jt=a("a"),lr=l("Dosovitskiy et al., 2020"),ir=l(` 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.`),Sa=m(),Bo=a("p"),dr=l("The abstract from the paper is the following:"),La=m(),Vo=a("p"),Es=a("em"),cr=l(`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.`),qa=m(),Po=a("p"),hr=l("Tips:"),Qa=m(),Z=a("ul"),Cs=a("li"),mr=l(`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=m(),le=a("li"),fr=l(`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=a("a"),ur=l("DeiTForImageClassification"),gr=l(` and (2) corresponds to
`),Yo=a("a"),_r=l("DeiTForImageClassificationWithTeacher"),Tr=l("."),br=m(),Zs=a("li"),yr=l(`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.`),vr=m(),Us=a("li"),wr=l(`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=m(),D=a("li"),$r=l(`The authors of DeiT also released more efficiently trained ViT models, which you can directly plug into
`),Ao=a("a"),Ir=l("ViTModel"),kr=l(" or "),So=a("a"),Fr=l("ViTForImageClassification"),jr=l(`. 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):
`),Ns=a("em"),Dr=l("facebook/deit-tiny-patch16-224"),Wr=l(", "),xs=a("em"),Jr=l("facebook/deit-small-patch16-224"),Er=l(", "),zs=a("em"),Cr=l("facebook/deit-base-patch16-224"),Zr=l(` and
`),Gs=a("em"),Ur=l("facebook/deit-base-patch16-384"),Nr=l(". Note that one should use "),Lo=a("a"),xr=l("DeiTImageProcessor"),zr=l(` in order to
prepare images for the model.`),Ha=m(),oe=a("p"),Gr=l("This model was contributed by "),Et=a("a"),Rr=l("nielsr"),Br=l(". The TensorFlow version of this model was added by "),Ct=a("a"),Vr=l("amyeroberts"),Pr=l("."),Oa=m(),ie=a("h2"),ze=a("a"),Rs=a("span"),y(Zt.$$.fragment),Xr=m(),Bs=a("span"),Yr=l("Resources"),Ka=m(),qo=a("p"),Ar=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with DeiT."),en=m(),y(Ut.$$.fragment),tn=m(),Ge=a("ul"),se=a("li"),Qo=a("a"),Sr=l("DeiTForImageClassification"),Lr=l(" is supported by this "),Nt=a("a"),qr=l("example script"),Qr=l(" and "),xt=a("a"),Hr=l("notebook"),Or=l("."),Kr=m(),Ho=a("li"),el=l("See also: "),Oo=a("a"),tl=l("Image classification task guide"),on=m(),Ko=a("p"),ol=l("Besides that:"),sn=m(),es=a("ul"),Re=a("li"),ts=a("a"),sl=l("DeiTForMaskedImageModeling"),al=l(" is supported by this "),zt=a("a"),nl=l("example script"),rl=l("."),an=m(),os=a("p"),ll=l("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=m(),de=a("h2"),Be=a("a"),Vs=a("span"),y(Gt.$$.fragment),il=m(),Ps=a("span"),dl=l("DeiTConfig"),rn=m(),N=a("div"),y(Rt.$$.fragment),cl=m(),ce=a("p"),hl=l("This is the configuration class to store the configuration of a "),ss=a("a"),ml=l("DeiTModel"),pl=l(`. 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=a("a"),fl=l("facebook/deit-base-distilled-patch16-224"),ul=l(`
architecture.`),gl=m(),he=a("p"),_l=l("Configuration objects inherit from "),as=a("a"),Tl=l("PretrainedConfig"),bl=l(` and can be used to control the model outputs. Read the
documentation from `),ns=a("a"),yl=l("PretrainedConfig"),vl=l(" for more information."),wl=m(),y(Ve.$$.fragment),ln=m(),me=a("h2"),Pe=a("a"),Xs=a("span"),y(Vt.$$.fragment),Ml=m(),Ys=a("span"),$l=l("DeiTFeatureExtractor"),dn=m(),pe=a("div"),y(Pt.$$.fragment),Il=m(),Xe=a("div"),y(Xt.$$.fragment),kl=m(),As=a("p"),Fl=l("Preprocess an image or a batch of images."),cn=m(),fe=a("h2"),Ye=a("a"),Ss=a("span"),y(Yt.$$.fragment),jl=m(),Ls=a("span"),Dl=l("DeiTImageProcessor"),hn=m(),H=a("div"),y(At.$$.fragment),Wl=m(),qs=a("p"),Jl=l("Constructs a DeiT image processor."),El=m(),Ae=a("div"),y(St.$$.fragment),Cl=m(),Qs=a("p"),Zl=l("Preprocess an image or batch of images."),mn=m(),ue=a("h2"),Se=a("a"),Hs=a("span"),y(Lt.$$.fragment),Ul=m(),Os=a("span"),Nl=l("DeiTModel"),pn=m(),O=a("div"),y(qt.$$.fragment),xl=m(),Qt=a("p"),zl=l(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ht=a("a"),Gl=l("torch.nn.Module"),Rl=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bl=m(),B=a("div"),y(Ot.$$.fragment),Vl=m(),ge=a("p"),Pl=l("The "),rs=a("a"),Xl=l("DeiTModel"),Yl=l(" forward method, overrides the "),Ks=a("code"),Al=l("__call__"),Sl=l(" special method."),Ll=m(),y(Le.$$.fragment),ql=m(),y(qe.$$.fragment),fn=m(),_e=a("h2"),Qe=a("a"),ea=a("span"),y(Kt.$$.fragment),Ql=m(),ta=a("span"),Hl=l("DeiTForMaskedImageModeling"),un=m(),C=a("div"),y(eo.$$.fragment),Ol=m(),to=a("p"),Kl=l("DeiT Model with a decoder on top for masked image modeling, as proposed in "),oo=a("a"),ei=l("SimMIM"),ti=l("."),oi=m(),y(He.$$.fragment),si=m(),so=a("p"),ai=l("This model is a PyTorch "),ao=a("a"),ni=l("torch.nn.Module"),ri=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),li=m(),V=a("div"),y(no.$$.fragment),ii=m(),Te=a("p"),di=l("The "),ls=a("a"),ci=l("DeiTForMaskedImageModeling"),hi=l(" forward method, overrides the "),oa=a("code"),mi=l("__call__"),pi=l(" special method."),fi=m(),y(Oe.$$.fragment),ui=m(),y(Ke.$$.fragment),gn=m(),be=a("h2"),et=a("a"),sa=a("span"),y(ro.$$.fragment),gi=m(),aa=a("span"),_i=l("DeiTForImageClassification"),_n=m(),x=a("div"),y(lo.$$.fragment),Ti=m(),na=a("p"),bi=l(`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.`),yi=m(),io=a("p"),vi=l("This model is a PyTorch "),co=a("a"),wi=l("torch.nn.Module"),Mi=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$i=m(),P=a("div"),y(ho.$$.fragment),Ii=m(),ye=a("p"),ki=l("The "),is=a("a"),Fi=l("DeiTForImageClassification"),ji=l(" forward method, overrides the "),ra=a("code"),Di=l("__call__"),Wi=l(" special method."),Ji=m(),y(tt.$$.fragment),Ei=m(),y(ot.$$.fragment),Tn=m(),ve=a("h2"),st=a("a"),la=a("span"),y(mo.$$.fragment),Ci=m(),ia=a("span"),Zi=l("DeiTForImageClassificationWithTeacher"),bn=m(),W=a("div"),y(po.$$.fragment),Ui=m(),da=a("p"),Ni=l(`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.`),xi=m(),ca=a("p"),zi=l(".. warning::"),Gi=m(),ha=a("p"),Ri=l(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Bi=m(),fo=a("p"),Vi=l("This model is a PyTorch "),uo=a("a"),Pi=l("torch.nn.Module"),Xi=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yi=m(),X=a("div"),y(go.$$.fragment),Ai=m(),we=a("p"),Si=l("The "),ds=a("a"),Li=l("DeiTForImageClassificationWithTeacher"),qi=l(" forward method, overrides the "),ma=a("code"),Qi=l("__call__"),Hi=l(" special method."),Oi=m(),y(at.$$.fragment),Ki=m(),y(nt.$$.fragment),yn=m(),Me=a("h2"),rt=a("a"),pa=a("span"),y(_o.$$.fragment),ed=m(),fa=a("span"),td=l("TFDeiTModel"),vn=m(),K=a("div"),y(To.$$.fragment),od=m(),bo=a("p"),sd=l(`The bare DeiT Model transformer outputting raw hidden-states without any specific head on top.
This model is a TensorFlow
`),yo=a("a"),ad=l("tf.keras.layers.Layer"),nd=l(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),rd=m(),Y=a("div"),y(vo.$$.fragment),ld=m(),$e=a("p"),id=l("The "),cs=a("a"),dd=l("TFDeiTModel"),cd=l(" forward method, overrides the "),ua=a("code"),hd=l("__call__"),md=l(" special method."),pd=m(),y(lt.$$.fragment),fd=m(),y(it.$$.fragment),wn=m(),Ie=a("h2"),dt=a("a"),ga=a("span"),y(wo.$$.fragment),ud=m(),_a=a("span"),gd=l("TFDeiTForMaskedImageModeling"),Mn=m(),ee=a("div"),y(Mo.$$.fragment),_d=m(),ke=a("p"),Td=l("DeiT Model with a decoder on top for masked image modeling, as proposed in "),$o=a("a"),bd=l("SimMIM"),yd=l(`.
This model is a TensorFlow
`),Io=a("a"),vd=l("tf.keras.layers.Layer"),wd=l(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Md=m(),A=a("div"),y(ko.$$.fragment),$d=m(),Fe=a("p"),Id=l("The "),hs=a("a"),kd=l("TFDeiTForMaskedImageModeling"),Fd=l(" forward method, overrides the "),Ta=a("code"),jd=l("__call__"),Dd=l(" special method."),Wd=m(),y(ct.$$.fragment),Jd=m(),y(ht.$$.fragment),$n=m(),je=a("h2"),mt=a("a"),ba=a("span"),y(Fo.$$.fragment),Ed=m(),ya=a("span"),Cd=l("TFDeiTForImageClassification"),In=m(),z=a("div"),y(jo.$$.fragment),Zd=m(),va=a("p"),Ud=l(`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=m(),Do=a("p"),xd=l(`This model is a TensorFlow
`),Wo=a("a"),zd=l("tf.keras.layers.Layer"),Gd=l(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),Rd=m(),S=a("div"),y(Jo.$$.fragment),Bd=m(),De=a("p"),Vd=l("The "),ms=a("a"),Pd=l("TFDeiTForImageClassification"),Xd=l(" forward method, overrides the "),wa=a("code"),Yd=l("__call__"),Ad=l(" special method."),Sd=m(),y(pt.$$.fragment),Ld=m(),y(ft.$$.fragment),kn=m(),We=a("h2"),ut=a("a"),Ma=a("span"),y(Eo.$$.fragment),qd=m(),$a=a("span"),Qd=l("TFDeiTForImageClassificationWithTeacher"),Fn=m(),J=a("div"),y(Co.$$.fragment),Hd=m(),Ia=a("p"),Od=l(`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=m(),ka=a("p"),ec=l(".. warning::"),tc=m(),Fa=a("p"),oc=l(`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),sc=m(),Zo=a("p"),ac=l(`This model is a TensorFlow
`),Uo=a("a"),nc=l("tf.keras.layers.Layer"),rc=l(`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),lc=m(),L=a("div"),y(No.$$.fragment),ic=m(),Je=a("p"),dc=l("The "),ps=a("a"),cc=l("TFDeiTForImageClassificationWithTeacher"),hc=l(" forward method, overrides the "),ja=a("code"),mc=l("__call__"),pc=l(" special method."),fc=m(),y(gt.$$.fragment),uc=m(),y(_t.$$.fragment),this.h()},l(t){const g=mm('[data-svelte="svelte-1phssyn"]',document.head);d=n(g,"META",{name:!0,content:!0}),g.forEach(o),b=p(t),u=n(t,"H1",{class:!0});var xo=r(u);f=n(xo,"A",{id:!0,class:!0,href:!0});var Da=r(f);T=n(Da,"SPAN",{});var Wa=r(T);v(s.$$.fragment,Wa),Wa.forEach(o),Da.forEach(o),h=p(xo),F=n(xo,"SPAN",{});var Ja=r(F);Kn=i(Ja,"DeiT"),Ja.forEach(o),xo.forEach(o),Xa=p(t),v(Ne.$$.fragment,t),Ya=p(t),re=n(t,"H2",{class:!0});var zo=r(re);xe=n(zo,"A",{id:!0,class:!0,href:!0});var Ea=r(xe);Ws=n(Ea,"SPAN",{});var Ca=r(Ws);v(Dt.$$.fragment,Ca),Ca.forEach(o),Ea.forEach(o),er=p(zo),Js=n(zo,"SPAN",{});var Za=r(Js);tr=i(Za,"Overview"),Za.forEach(o),zo.forEach(o),Aa=p(t),R=n(t,"P",{});var te=r(R);or=i(te,"The DeiT model was proposed in "),Wt=n(te,"A",{href:!0,rel:!0});var Ua=r(Wt);sr=i(Ua,"Training data-efficient image transformers & distillation through attention"),Ua.forEach(o),ar=i(te,` by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Herv\xE9 J\xE9gou. The `),Ro=n(te,"A",{href:!0});var Na=r(Ro);nr=i(Na,"Vision Transformer (ViT)"),Na.forEach(o),rr=i(te," introduced in "),Jt=n(te,"A",{href:!0,rel:!0});var xa=r(Jt);lr=i(xa,"Dosovitskiy et al., 2020"),xa.forEach(o),ir=i(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),Sa=p(t),Bo=n(t,"P",{});var za=r(Bo);dr=i(za,"The abstract from the paper is the following:"),za.forEach(o),La=p(t),Vo=n(t,"P",{});var Ga=r(Vo);Es=n(Ga,"EM",{});var Ra=r(Es);cr=i(Ra,`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.`),Ra.forEach(o),Ga.forEach(o),qa=p(t),Po=n(t,"P",{});var Ba=r(Po);hr=i(Ba,"Tips:"),Ba.forEach(o),Qa=p(t),Z=n(t,"UL",{});var G=r(Z);Cs=n(G,"LI",{});var Va=r(Cs);mr=i(Va,`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.`),Va.forEach(o),pr=p(G),le=n(G,"LI",{});var Ee=r(le);fr=i(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);ur=i(_c,"DeiTForImageClassification"),_c.forEach(o),gr=i(Ee,` and (2) corresponds to
`),Yo=n(Ee,"A",{href:!0});var Tc=r(Yo);_r=i(Tc,"DeiTForImageClassificationWithTeacher"),Tc.forEach(o),Tr=i(Ee,"."),Ee.forEach(o),br=p(G),Zs=n(G,"LI",{});var bc=r(Zs);yr=i(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),vr=p(G),Us=n(G,"LI",{});var yc=r(Us);wr=i(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=i(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 vc=r(Ao);Ir=i(vc,"ViTModel"),vc.forEach(o),kr=i(E," or "),So=n(E,"A",{href:!0});var wc=r(So);Fr=i(wc,"ViTForImageClassification"),wc.forEach(o),jr=i(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):
`),Ns=n(E,"EM",{});var Mc=r(Ns);Dr=i(Mc,"facebook/deit-tiny-patch16-224"),Mc.forEach(o),Wr=i(E,", "),xs=n(E,"EM",{});var $c=r(xs);Jr=i($c,"facebook/deit-small-patch16-224"),$c.forEach(o),Er=i(E,", "),zs=n(E,"EM",{});var Ic=r(zs);Cr=i(Ic,"facebook/deit-base-patch16-224"),Ic.forEach(o),Zr=i(E,` and
`),Gs=n(E,"EM",{});var kc=r(Gs);Ur=i(kc,"facebook/deit-base-patch16-384"),kc.forEach(o),Nr=i(E,". Note that one should use "),Lo=n(E,"A",{href:!0});var Fc=r(Lo);xr=i(Fc,"DeiTImageProcessor"),Fc.forEach(o),zr=i(E,` in order to
prepare images for the model.`),E.forEach(o),G.forEach(o),Ha=p(t),oe=n(t,"P",{});var fs=r(oe);Gr=i(fs,"This model was contributed by "),Et=n(fs,"A",{href:!0,rel:!0});var jc=r(Et);Rr=i(jc,"nielsr"),jc.forEach(o),Br=i(fs,". The TensorFlow version of this model was added by "),Ct=n(fs,"A",{href:!0,rel:!0});var Dc=r(Ct);Vr=i(Dc,"amyeroberts"),Dc.forEach(o),Pr=i(fs,"."),fs.forEach(o),Oa=p(t),ie=n(t,"H2",{class:!0});var Dn=r(ie);ze=n(Dn,"A",{id:!0,class:!0,href:!0});var Wc=r(ze);Rs=n(Wc,"SPAN",{});var Jc=r(Rs);v(Zt.$$.fragment,Jc),Jc.forEach(o),Wc.forEach(o),Xr=p(Dn),Bs=n(Dn,"SPAN",{});var Ec=r(Bs);Yr=i(Ec,"Resources"),Ec.forEach(o),Dn.forEach(o),Ka=p(t),qo=n(t,"P",{});var Cc=r(qo);Ar=i(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),v(Ut.$$.fragment,t),tn=p(t),Ge=n(t,"UL",{});var Wn=r(Ge);se=n(Wn,"LI",{});var Go=r(se);Qo=n(Go,"A",{href:!0});var Zc=r(Qo);Sr=i(Zc,"DeiTForImageClassification"),Zc.forEach(o),Lr=i(Go," is supported by this "),Nt=n(Go,"A",{href:!0,rel:!0});var Uc=r(Nt);qr=i(Uc,"example script"),Uc.forEach(o),Qr=i(Go," and "),xt=n(Go,"A",{href:!0,rel:!0});var Nc=r(xt);Hr=i(Nc,"notebook"),Nc.forEach(o),Or=i(Go,"."),Go.forEach(o),Kr=p(Wn),Ho=n(Wn,"LI",{});var gc=r(Ho);el=i(gc,"See also: "),Oo=n(gc,"A",{href:!0});var xc=r(Oo);tl=i(xc,"Image classification task guide"),xc.forEach(o),gc.forEach(o),Wn.forEach(o),on=p(t),Ko=n(t,"P",{});var zc=r(Ko);ol=i(zc,"Besides that:"),zc.forEach(o),sn=p(t),es=n(t,"UL",{});var Gc=r(es);Re=n(Gc,"LI",{});var Pa=r(Re);ts=n(Pa,"A",{href:!0});var Rc=r(ts);sl=i(Rc,"DeiTForMaskedImageModeling"),Rc.forEach(o),al=i(Pa," is supported by this "),zt=n(Pa,"A",{href:!0,rel:!0});var Bc=r(zt);nl=i(Bc,"example script"),Bc.forEach(o),rl=i(Pa,"."),Pa.forEach(o),Gc.forEach(o),an=p(t),os=n(t,"P",{});var Vc=r(os);ll=i(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);Vs=n(Pc,"SPAN",{});var Xc=r(Vs);v(Gt.$$.fragment,Xc),Xc.forEach(o),Pc.forEach(o),il=p(Jn),Ps=n(Jn,"SPAN",{});var Yc=r(Ps);dl=i(Yc,"DeiTConfig"),Yc.forEach(o),Jn.forEach(o),rn=p(t),N=n(t,"DIV",{class:!0});var Tt=r(N);v(Rt.$$.fragment,Tt),cl=p(Tt),ce=n(Tt,"P",{});var us=r(ce);hl=i(us,"This is the configuration class to store the configuration of a "),ss=n(us,"A",{href:!0});var Ac=r(ss);ml=i(Ac,"DeiTModel"),Ac.forEach(o),pl=i(us,`. 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(us,"A",{href:!0,rel:!0});var Sc=r(Bt);fl=i(Sc,"facebook/deit-base-distilled-patch16-224"),Sc.forEach(o),ul=i(us,`
architecture.`),us.forEach(o),gl=p(Tt),he=n(Tt,"P",{});var gs=r(he);_l=i(gs,"Configuration objects inherit from "),as=n(gs,"A",{href:!0});var Lc=r(as);Tl=i(Lc,"PretrainedConfig"),Lc.forEach(o),bl=i(gs,` and can be used to control the model outputs. Read the
documentation from `),ns=n(gs,"A",{href:!0});var qc=r(ns);yl=i(qc,"PretrainedConfig"),qc.forEach(o),vl=i(gs," for more information."),gs.forEach(o),wl=p(Tt),v(Ve.$$.fragment,Tt),Tt.forEach(o),ln=p(t),me=n(t,"H2",{class:!0});var En=r(me);Pe=n(En,"A",{id:!0,class:!0,href:!0});var Qc=r(Pe);Xs=n(Qc,"SPAN",{});var Hc=r(Xs);v(Vt.$$.fragment,Hc),Hc.forEach(o),Qc.forEach(o),Ml=p(En),Ys=n(En,"SPAN",{});var Oc=r(Ys);$l=i(Oc,"DeiTFeatureExtractor"),Oc.forEach(o),En.forEach(o),dn=p(t),pe=n(t,"DIV",{class:!0});var Cn=r(pe);v(Pt.$$.fragment,Cn),Il=p(Cn),Xe=n(Cn,"DIV",{class:!0});var Zn=r(Xe);v(Xt.$$.fragment,Zn),kl=p(Zn),As=n(Zn,"P",{});var Kc=r(As);Fl=i(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 eh=r(Ye);Ss=n(eh,"SPAN",{});var th=r(Ss);v(Yt.$$.fragment,th),th.forEach(o),eh.forEach(o),jl=p(Un),Ls=n(Un,"SPAN",{});var oh=r(Ls);Dl=i(oh,"DeiTImageProcessor"),oh.forEach(o),Un.forEach(o),hn=p(t),H=n(t,"DIV",{class:!0});var _s=r(H);v(At.$$.fragment,_s),Wl=p(_s),qs=n(_s,"P",{});var sh=r(qs);Jl=i(sh,"Constructs a DeiT image processor."),sh.forEach(o),El=p(_s),Ae=n(_s,"DIV",{class:!0});var Nn=r(Ae);v(St.$$.fragment,Nn),Cl=p(Nn),Qs=n(Nn,"P",{});var ah=r(Qs);Zl=i(ah,"Preprocess an image or batch of images."),ah.forEach(o),Nn.forEach(o),_s.forEach(o),mn=p(t),ue=n(t,"H2",{class:!0});var xn=r(ue);Se=n(xn,"A",{id:!0,class:!0,href:!0});var nh=r(Se);Hs=n(nh,"SPAN",{});var rh=r(Hs);v(Lt.$$.fragment,rh),rh.forEach(o),nh.forEach(o),Ul=p(xn),Os=n(xn,"SPAN",{});var lh=r(Os);Nl=i(lh,"DeiTModel"),lh.forEach(o),xn.forEach(o),pn=p(t),O=n(t,"DIV",{class:!0});var Ts=r(O);v(qt.$$.fragment,Ts),xl=p(Ts),Qt=n(Ts,"P",{});var zn=r(Qt);zl=i(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 ih=r(Ht);Gl=i(ih,"torch.nn.Module"),ih.forEach(o),Rl=i(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),Bl=p(Ts),B=n(Ts,"DIV",{class:!0});var bt=r(B);v(Ot.$$.fragment,bt),Vl=p(bt),ge=n(bt,"P",{});var bs=r(ge);Pl=i(bs,"The "),rs=n(bs,"A",{href:!0});var dh=r(rs);Xl=i(dh,"DeiTModel"),dh.forEach(o),Yl=i(bs," forward method, overrides the "),Ks=n(bs,"CODE",{});var ch=r(Ks);Al=i(ch,"__call__"),ch.forEach(o),Sl=i(bs," special method."),bs.forEach(o),Ll=p(bt),v(Le.$$.fragment,bt),ql=p(bt),v(qe.$$.fragment,bt),bt.forEach(o),Ts.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 hh=r(Qe);ea=n(hh,"SPAN",{});var mh=r(ea);v(Kt.$$.fragment,mh),mh.forEach(o),hh.forEach(o),Ql=p(Gn),ta=n(Gn,"SPAN",{});var ph=r(ta);Hl=i(ph,"DeiTForMaskedImageModeling"),ph.forEach(o),Gn.forEach(o),un=p(t),C=n(t,"DIV",{class:!0});var ae=r(C);v(eo.$$.fragment,ae),Ol=p(ae),to=n(ae,"P",{});var Rn=r(to);Kl=i(Rn,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),oo=n(Rn,"A",{href:!0,rel:!0});var fh=r(oo);ei=i(fh,"SimMIM"),fh.forEach(o),ti=i(Rn,"."),Rn.forEach(o),oi=p(ae),v(He.$$.fragment,ae),si=p(ae),so=n(ae,"P",{});var Bn=r(so);ai=i(Bn,"This model is a PyTorch "),ao=n(Bn,"A",{href:!0,rel:!0});var uh=r(ao);ni=i(uh,"torch.nn.Module"),uh.forEach(o),ri=i(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),li=p(ae),V=n(ae,"DIV",{class:!0});var yt=r(V);v(no.$$.fragment,yt),ii=p(yt),Te=n(yt,"P",{});var ys=r(Te);di=i(ys,"The "),ls=n(ys,"A",{href:!0});var gh=r(ls);ci=i(gh,"DeiTForMaskedImageModeling"),gh.forEach(o),hi=i(ys," forward method, overrides the "),oa=n(ys,"CODE",{});var _h=r(oa);mi=i(_h,"__call__"),_h.forEach(o),pi=i(ys," special method."),ys.forEach(o),fi=p(yt),v(Oe.$$.fragment,yt),ui=p(yt),v(Ke.$$.fragment,yt),yt.forEach(o),ae.forEach(o),gn=p(t),be=n(t,"H2",{class:!0});var Vn=r(be);et=n(Vn,"A",{id:!0,class:!0,href:!0});var Th=r(et);sa=n(Th,"SPAN",{});var bh=r(sa);v(ro.$$.fragment,bh),bh.forEach(o),Th.forEach(o),gi=p(Vn),aa=n(Vn,"SPAN",{});var yh=r(aa);_i=i(yh,"DeiTForImageClassification"),yh.forEach(o),Vn.forEach(o),_n=p(t),x=n(t,"DIV",{class:!0});var vt=r(x);v(lo.$$.fragment,vt),Ti=p(vt),na=n(vt,"P",{});var vh=r(na);bi=i(vh,`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.`),vh.forEach(o),yi=p(vt),io=n(vt,"P",{});var Pn=r(io);vi=i(Pn,"This model is a PyTorch "),co=n(Pn,"A",{href:!0,rel:!0});var wh=r(co);wi=i(wh,"torch.nn.Module"),wh.forEach(o),Mi=i(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),$i=p(vt),P=n(vt,"DIV",{class:!0});var wt=r(P);v(ho.$$.fragment,wt),Ii=p(wt),ye=n(wt,"P",{});var vs=r(ye);ki=i(vs,"The "),is=n(vs,"A",{href:!0});var Mh=r(is);Fi=i(Mh,"DeiTForImageClassification"),Mh.forEach(o),ji=i(vs," forward method, overrides the "),ra=n(vs,"CODE",{});var $h=r(ra);Di=i($h,"__call__"),$h.forEach(o),Wi=i(vs," special method."),vs.forEach(o),Ji=p(wt),v(tt.$$.fragment,wt),Ei=p(wt),v(ot.$$.fragment,wt),wt.forEach(o),vt.forEach(o),Tn=p(t),ve=n(t,"H2",{class:!0});var Xn=r(ve);st=n(Xn,"A",{id:!0,class:!0,href:!0});var Ih=r(st);la=n(Ih,"SPAN",{});var kh=r(la);v(mo.$$.fragment,kh),kh.forEach(o),Ih.forEach(o),Ci=p(Xn),ia=n(Xn,"SPAN",{});var Fh=r(ia);Zi=i(Fh,"DeiTForImageClassificationWithTeacher"),Fh.forEach(o),Xn.forEach(o),bn=p(t),W=n(t,"DIV",{class:!0});var q=r(W);v(po.$$.fragment,q),Ui=p(q),da=n(q,"P",{});var jh=r(da);Ni=i(jh,`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.`),jh.forEach(o),xi=p(q),ca=n(q,"P",{});var Dh=r(ca);zi=i(Dh,".. warning::"),Dh.forEach(o),Gi=p(q),ha=n(q,"P",{});var Wh=r(ha);Ri=i(Wh,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),Wh.forEach(o),Bi=p(q),fo=n(q,"P",{});var Yn=r(fo);Vi=i(Yn,"This model is a PyTorch "),uo=n(Yn,"A",{href:!0,rel:!0});var Jh=r(uo);Pi=i(Jh,"torch.nn.Module"),Jh.forEach(o),Xi=i(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),Yi=p(q),X=n(q,"DIV",{class:!0});var Mt=r(X);v(go.$$.fragment,Mt),Ai=p(Mt),we=n(Mt,"P",{});var ws=r(we);Si=i(ws,"The "),ds=n(ws,"A",{href:!0});var Eh=r(ds);Li=i(Eh,"DeiTForImageClassificationWithTeacher"),Eh.forEach(o),qi=i(ws," forward method, overrides the "),ma=n(ws,"CODE",{});var Ch=r(ma);Qi=i(Ch,"__call__"),Ch.forEach(o),Hi=i(ws," special method."),ws.forEach(o),Oi=p(Mt),v(at.$$.fragment,Mt),Ki=p(Mt),v(nt.$$.fragment,Mt),Mt.forEach(o),q.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 Zh=r(rt);pa=n(Zh,"SPAN",{});var Uh=r(pa);v(_o.$$.fragment,Uh),Uh.forEach(o),Zh.forEach(o),ed=p(An),fa=n(An,"SPAN",{});var Nh=r(fa);td=i(Nh,"TFDeiTModel"),Nh.forEach(o),An.forEach(o),vn=p(t),K=n(t,"DIV",{class:!0});var Ms=r(K);v(To.$$.fragment,Ms),od=p(Ms),bo=n(Ms,"P",{});var Sn=r(bo);sd=i(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 xh=r(yo);ad=i(xh,"tf.keras.layers.Layer"),xh.forEach(o),nd=i(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(Ms),Y=n(Ms,"DIV",{class:!0});var $t=r(Y);v(vo.$$.fragment,$t),ld=p($t),$e=n($t,"P",{});var $s=r($e);id=i($s,"The "),cs=n($s,"A",{href:!0});var zh=r(cs);dd=i(zh,"TFDeiTModel"),zh.forEach(o),cd=i($s," forward method, overrides the "),ua=n($s,"CODE",{});var Gh=r(ua);hd=i(Gh,"__call__"),Gh.forEach(o),md=i($s," special method."),$s.forEach(o),pd=p($t),v(lt.$$.fragment,$t),fd=p($t),v(it.$$.fragment,$t),$t.forEach(o),Ms.forEach(o),wn=p(t),Ie=n(t,"H2",{class:!0});var Ln=r(Ie);dt=n(Ln,"A",{id:!0,class:!0,href:!0});var Rh=r(dt);ga=n(Rh,"SPAN",{});var Bh=r(ga);v(wo.$$.fragment,Bh),Bh.forEach(o),Rh.forEach(o),ud=p(Ln),_a=n(Ln,"SPAN",{});var Vh=r(_a);gd=i(Vh,"TFDeiTForMaskedImageModeling"),Vh.forEach(o),Ln.forEach(o),Mn=p(t),ee=n(t,"DIV",{class:!0});var Is=r(ee);v(Mo.$$.fragment,Is),_d=p(Is),ke=n(Is,"P",{});var ks=r(ke);Td=i(ks,"DeiT Model with a decoder on top for masked image modeling, as proposed in "),$o=n(ks,"A",{href:!0,rel:!0});var Ph=r($o);bd=i(Ph,"SimMIM"),Ph.forEach(o),yd=i(ks,`.
This model is a TensorFlow
`),Io=n(ks,"A",{href:!0,rel:!0});var Xh=r(Io);vd=i(Xh,"tf.keras.layers.Layer"),Xh.forEach(o),wd=i(ks,`. Use it as a regular
TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`),ks.forEach(o),Md=p(Is),A=n(Is,"DIV",{class:!0});var It=r(A);v(ko.$$.fragment,It),$d=p(It),Fe=n(It,"P",{});var Fs=r(Fe);Id=i(Fs,"The "),hs=n(Fs,"A",{href:!0});var Yh=r(hs);kd=i(Yh,"TFDeiTForMaskedImageModeling"),Yh.forEach(o),Fd=i(Fs," forward method, overrides the "),Ta=n(Fs,"CODE",{});var Ah=r(Ta);jd=i(Ah,"__call__"),Ah.forEach(o),Dd=i(Fs," special method."),Fs.forEach(o),Wd=p(It),v(ct.$$.fragment,It),Jd=p(It),v(ht.$$.fragment,It),It.forEach(o),Is.forEach(o),$n=p(t),je=n(t,"H2",{class:!0});var qn=r(je);mt=n(qn,"A",{id:!0,class:!0,href:!0});var Sh=r(mt);ba=n(Sh,"SPAN",{});var Lh=r(ba);v(Fo.$$.fragment,Lh),Lh.forEach(o),Sh.forEach(o),Ed=p(qn),ya=n(qn,"SPAN",{});var qh=r(ya);Cd=i(qh,"TFDeiTForImageClassification"),qh.forEach(o),qn.forEach(o),In=p(t),z=n(t,"DIV",{class:!0});var kt=r(z);v(jo.$$.fragment,kt),Zd=p(kt),va=n(kt,"P",{});var Qh=r(va);Ud=i(Qh,`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.`),Qh.forEach(o),Nd=p(kt),Do=n(kt,"P",{});var Qn=r(Do);xd=i(Qn,`This model is a TensorFlow
`),Wo=n(Qn,"A",{href:!0,rel:!0});var Hh=r(Wo);zd=i(Hh,"tf.keras.layers.Layer"),Hh.forEach(o),Gd=i(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);v(Jo.$$.fragment,Ft),Bd=p(Ft),De=n(Ft,"P",{});var js=r(De);Vd=i(js,"The "),ms=n(js,"A",{href:!0});var Oh=r(ms);Pd=i(Oh,"TFDeiTForImageClassification"),Oh.forEach(o),Xd=i(js," forward method, overrides the "),wa=n(js,"CODE",{});var Kh=r(wa);Yd=i(Kh,"__call__"),Kh.forEach(o),Ad=i(js," special method."),js.forEach(o),Sd=p(Ft),v(pt.$$.fragment,Ft),Ld=p(Ft),v(ft.$$.fragment,Ft),Ft.forEach(o),kt.forEach(o),kn=p(t),We=n(t,"H2",{class:!0});var Hn=r(We);ut=n(Hn,"A",{id:!0,class:!0,href:!0});var em=r(ut);Ma=n(em,"SPAN",{});var tm=r(Ma);v(Eo.$$.fragment,tm),tm.forEach(o),em.forEach(o),qd=p(Hn),$a=n(Hn,"SPAN",{});var om=r($a);Qd=i(om,"TFDeiTForImageClassificationWithTeacher"),om.forEach(o),Hn.forEach(o),Fn=p(t),J=n(t,"DIV",{class:!0});var Q=r(J);v(Co.$$.fragment,Q),Hd=p(Q),Ia=n(Q,"P",{});var sm=r(Ia);Od=i(sm,`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.`),sm.forEach(o),Kd=p(Q),ka=n(Q,"P",{});var am=r(ka);ec=i(am,".. warning::"),am.forEach(o),tc=p(Q),Fa=n(Q,"P",{});var nm=r(Fa);oc=i(nm,`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet
supported.`),nm.forEach(o),sc=p(Q),Zo=n(Q,"P",{});var On=r(Zo);ac=i(On,`This model is a TensorFlow
`),Uo=n(On,"A",{href:!0,rel:!0});var rm=r(Uo);nc=i(rm,"tf.keras.layers.Layer"),rm.forEach(o),rc=i(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),lc=p(Q),L=n(Q,"DIV",{class:!0});var jt=r(L);v(No.$$.fragment,jt),ic=p(jt),Je=n(jt,"P",{});var Ds=r(Je);dc=i(Ds,"The "),ps=n(Ds,"A",{href:!0});var lm=r(ps);cc=i(lm,"TFDeiTForImageClassificationWithTeacher"),lm.forEach(o),hc=i(Ds," forward method, overrides the "),ja=n(Ds,"CODE",{});var im=r(ja);mc=i(im,"__call__"),im.forEach(o),pc=i(Ds," special method."),Ds.forEach(o),fc=p(jt),v(gt.$$.fragment,jt),uc=p(jt),v(_t.$$.fragment,jt),jt.forEach(o),Q.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Um)),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(u,"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/v4.30.0/en/model_doc/deit#transformers.DeiTForImageClassification"),c(Yo,"href","/docs/transformers/v4.30.0/en/model_doc/deit#transformers.DeiTForImageClassificationWithTeacher"),c(Ao,"href","/docs/transformers/v4.30.0/en/model_doc/vit#transformers.ViTModel"),c(So,"href","/docs/transformers/v4.30.0/en/model_doc/vit#transformers.ViTForImageClassification"),c(Lo,"href","/docs/transformers/v4.30.0/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(ie,"class","relative group"),c(Qo,"href","/docs/transformers/v4.30.0/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(ts,"href","/docs/transformers/v4.30.0/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(ss,"href","/docs/transformers/v4.30.0/en/model_doc/deit#transformers.DeiTModel"),c(Bt,"href","https://huggingface.co/facebook/deit-base-distilled-patch16-224"),c(Bt,"rel","nofollow"),c(as,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(ns,"href","/docs/transformers/v4.30.0/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(me,"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(ue,"class","relative group"),c(Ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ht,"rel","nofollow"),c(rs,"href","/docs/transformers/v4.30.0/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(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ao,"rel","nofollow"),c(ls,"href","/docs/transformers/v4.30.0/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(is,"href","/docs/transformers/v4.30.0/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(st,"id","transformers.DeiTForImageClassificationWithTeacher"),c(st,"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(st,"href","#transformers.DeiTForImageClassificationWithTeacher"),c(ve,"class","relative group"),c(uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(uo,"rel","nofollow"),c(ds,"href","/docs/transformers/v4.30.0/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(cs,"href","/docs/transformers/v4.30.0/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(hs,"href","/docs/transformers/v4.30.0/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(mt,"id","transformers.TFDeiTForImageClassification"),c(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(mt,"href","#transformers.TFDeiTForImageClassification"),c(je,"class","relative group"),c(Wo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),c(Wo,"rel","nofollow"),c(ms,"href","/docs/transformers/v4.30.0/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(ut,"id","transformers.TFDeiTForImageClassificationWithTeacher"),c(ut,"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(ut,"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(ps,"href","/docs/transformers/v4.30.0/en/model_doc/deit#transformers.TFDeiTForImageClassificationWithTeacher"),c(L,"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,g){e(document.head,d),_(t,b,g),_(t,u,g),e(u,f),e(f,T),w(s,T,null),e(u,h),e(u,F),e(F,Kn),_(t,Xa,g),w(Ne,t,g),_(t,Ya,g),_(t,re,g),e(re,xe),e(xe,Ws),w(Dt,Ws,null),e(re,er),e(re,Js),e(Js,tr),_(t,Aa,g),_(t,R,g),e(R,or),e(R,Wt),e(Wt,sr),e(R,ar),e(R,Ro),e(Ro,nr),e(R,rr),e(R,Jt),e(Jt,lr),e(R,ir),_(t,Sa,g),_(t,Bo,g),e(Bo,dr),_(t,La,g),_(t,Vo,g),e(Vo,Es),e(Es,cr),_(t,qa,g),_(t,Po,g),e(Po,hr),_(t,Qa,g),_(t,Z,g),e(Z,Cs),e(Cs,mr),e(Z,pr),e(Z,le),e(le,fr),e(le,Xo),e(Xo,ur),e(le,gr),e(le,Yo),e(Yo,_r),e(le,Tr),e(Z,br),e(Z,Zs),e(Zs,yr),e(Z,vr),e(Z,Us),e(Us,wr),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,Ns),e(Ns,Dr),e(D,Wr),e(D,xs),e(xs,Jr),e(D,Er),e(D,zs),e(zs,Cr),e(D,Zr),e(D,Gs),e(Gs,Ur),e(D,Nr),e(D,Lo),e(Lo,xr),e(D,zr),_(t,Ha,g),_(t,oe,g),e(oe,Gr),e(oe,Et),e(Et,Rr),e(oe,Br),e(oe,Ct),e(Ct,Vr),e(oe,Pr),_(t,Oa,g),_(t,ie,g),e(ie,ze),e(ze,Rs),w(Zt,Rs,null),e(ie,Xr),e(ie,Bs),e(Bs,Yr),_(t,Ka,g),_(t,qo,g),e(qo,Ar),_(t,en,g),w(Ut,t,g),_(t,tn,g),_(t,Ge,g),e(Ge,se),e(se,Qo),e(Qo,Sr),e(se,Lr),e(se,Nt),e(Nt,qr),e(se,Qr),e(se,xt),e(xt,Hr),e(se,Or),e(Ge,Kr),e(Ge,Ho),e(Ho,el),e(Ho,Oo),e(Oo,tl),_(t,on,g),_(t,Ko,g),e(Ko,ol),_(t,sn,g),_(t,es,g),e(es,Re),e(Re,ts),e(ts,sl),e(Re,al),e(Re,zt),e(zt,nl),e(Re,rl),_(t,an,g),_(t,os,g),e(os,ll),_(t,nn,g),_(t,de,g),e(de,Be),e(Be,Vs),w(Gt,Vs,null),e(de,il),e(de,Ps),e(Ps,dl),_(t,rn,g),_(t,N,g),w(Rt,N,null),e(N,cl),e(N,ce),e(ce,hl),e(ce,ss),e(ss,ml),e(ce,pl),e(ce,Bt),e(Bt,fl),e(ce,ul),e(N,gl),e(N,he),e(he,_l),e(he,as),e(as,Tl),e(he,bl),e(he,ns),e(ns,yl),e(he,vl),e(N,wl),w(Ve,N,null),_(t,ln,g),_(t,me,g),e(me,Pe),e(Pe,Xs),w(Vt,Xs,null),e(me,Ml),e(me,Ys),e(Ys,$l),_(t,dn,g),_(t,pe,g),w(Pt,pe,null),e(pe,Il),e(pe,Xe),w(Xt,Xe,null),e(Xe,kl),e(Xe,As),e(As,Fl),_(t,cn,g),_(t,fe,g),e(fe,Ye),e(Ye,Ss),w(Yt,Ss,null),e(fe,jl),e(fe,Ls),e(Ls,Dl),_(t,hn,g),_(t,H,g),w(At,H,null),e(H,Wl),e(H,qs),e(qs,Jl),e(H,El),e(H,Ae),w(St,Ae,null),e(Ae,Cl),e(Ae,Qs),e(Qs,Zl),_(t,mn,g),_(t,ue,g),e(ue,Se),e(Se,Hs),w(Lt,Hs,null),e(ue,Ul),e(ue,Os),e(Os,Nl),_(t,pn,g),_(t,O,g),w(qt,O,null),e(O,xl),e(O,Qt),e(Qt,zl),e(Qt,Ht),e(Ht,Gl),e(Qt,Rl),e(O,Bl),e(O,B),w(Ot,B,null),e(B,Vl),e(B,ge),e(ge,Pl),e(ge,rs),e(rs,Xl),e(ge,Yl),e(ge,Ks),e(Ks,Al),e(ge,Sl),e(B,Ll),w(Le,B,null),e(B,ql),w(qe,B,null),_(t,fn,g),_(t,_e,g),e(_e,Qe),e(Qe,ea),w(Kt,ea,null),e(_e,Ql),e(_e,ta),e(ta,Hl),_(t,un,g),_(t,C,g),w(eo,C,null),e(C,Ol),e(C,to),e(to,Kl),e(to,oo),e(oo,ei),e(to,ti),e(C,oi),w(He,C,null),e(C,si),e(C,so),e(so,ai),e(so,ao),e(ao,ni),e(so,ri),e(C,li),e(C,V),w(no,V,null),e(V,ii),e(V,Te),e(Te,di),e(Te,ls),e(ls,ci),e(Te,hi),e(Te,oa),e(oa,mi),e(Te,pi),e(V,fi),w(Oe,V,null),e(V,ui),w(Ke,V,null),_(t,gn,g),_(t,be,g),e(be,et),e(et,sa),w(ro,sa,null),e(be,gi),e(be,aa),e(aa,_i),_(t,_n,g),_(t,x,g),w(lo,x,null),e(x,Ti),e(x,na),e(na,bi),e(x,yi),e(x,io),e(io,vi),e(io,co),e(co,wi),e(io,Mi),e(x,$i),e(x,P),w(ho,P,null),e(P,Ii),e(P,ye),e(ye,ki),e(ye,is),e(is,Fi),e(ye,ji),e(ye,ra),e(ra,Di),e(ye,Wi),e(P,Ji),w(tt,P,null),e(P,Ei),w(ot,P,null),_(t,Tn,g),_(t,ve,g),e(ve,st),e(st,la),w(mo,la,null),e(ve,Ci),e(ve,ia),e(ia,Zi),_(t,bn,g),_(t,W,g),w(po,W,null),e(W,Ui),e(W,da),e(da,Ni),e(W,xi),e(W,ca),e(ca,zi),e(W,Gi),e(W,ha),e(ha,Ri),e(W,Bi),e(W,fo),e(fo,Vi),e(fo,uo),e(uo,Pi),e(fo,Xi),e(W,Yi),e(W,X),w(go,X,null),e(X,Ai),e(X,we),e(we,Si),e(we,ds),e(ds,Li),e(we,qi),e(we,ma),e(ma,Qi),e(we,Hi),e(X,Oi),w(at,X,null),e(X,Ki),w(nt,X,null),_(t,yn,g),_(t,Me,g),e(Me,rt),e(rt,pa),w(_o,pa,null),e(Me,ed),e(Me,fa),e(fa,td),_(t,vn,g),_(t,K,g),w(To,K,null),e(K,od),e(K,bo),e(bo,sd),e(bo,yo),e(yo,ad),e(bo,nd),e(K,rd),e(K,Y),w(vo,Y,null),e(Y,ld),e(Y,$e),e($e,id),e($e,cs),e(cs,dd),e($e,cd),e($e,ua),e(ua,hd),e($e,md),e(Y,pd),w(lt,Y,null),e(Y,fd),w(it,Y,null),_(t,wn,g),_(t,Ie,g),e(Ie,dt),e(dt,ga),w(wo,ga,null),e(Ie,ud),e(Ie,_a),e(_a,gd),_(t,Mn,g),_(t,ee,g),w(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,vd),e(ke,wd),e(ee,Md),e(ee,A),w(ko,A,null),e(A,$d),e(A,Fe),e(Fe,Id),e(Fe,hs),e(hs,kd),e(Fe,Fd),e(Fe,Ta),e(Ta,jd),e(Fe,Dd),e(A,Wd),w(ct,A,null),e(A,Jd),w(ht,A,null),_(t,$n,g),_(t,je,g),e(je,mt),e(mt,ba),w(Fo,ba,null),e(je,Ed),e(je,ya),e(ya,Cd),_(t,In,g),_(t,z,g),w(jo,z,null),e(z,Zd),e(z,va),e(va,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),w(Jo,S,null),e(S,Bd),e(S,De),e(De,Vd),e(De,ms),e(ms,Pd),e(De,Xd),e(De,wa),e(wa,Yd),e(De,Ad),e(S,Sd),w(pt,S,null),e(S,Ld),w(ft,S,null),_(t,kn,g),_(t,We,g),e(We,ut),e(ut,Ma),w(Eo,Ma,null),e(We,qd),e(We,$a),e($a,Qd),_(t,Fn,g),_(t,J,g),w(Co,J,null),e(J,Hd),e(J,Ia),e(Ia,Od),e(J,Kd),e(J,ka),e(ka,ec),e(J,tc),e(J,Fa),e(Fa,oc),e(J,sc),e(J,Zo),e(Zo,ac),e(Zo,Uo),e(Uo,nc),e(Zo,rc),e(J,lc),e(J,L),w(No,L,null),e(L,ic),e(L,Je),e(Je,dc),e(Je,ps),e(ps,cc),e(Je,hc),e(Je,ja),e(ja,mc),e(Je,pc),e(L,fc),w(gt,L,null),e(L,uc),w(_t,L,null),jn=!0},p(t,[g]){const xo={};g&2&&(xo.$$scope={dirty:g,ctx:t}),Ne.$set(xo);const Da={};g&2&&(Da.$$scope={dirty:g,ctx:t}),Ve.$set(Da);const Wa={};g&2&&(Wa.$$scope={dirty:g,ctx:t}),Le.$set(Wa);const Ja={};g&2&&(Ja.$$scope={dirty:g,ctx:t}),qe.$set(Ja);const zo={};g&2&&(zo.$$scope={dirty:g,ctx:t}),He.$set(zo);const Ea={};g&2&&(Ea.$$scope={dirty:g,ctx:t}),Oe.$set(Ea);const Ca={};g&2&&(Ca.$$scope={dirty:g,ctx:t}),Ke.$set(Ca);const Za={};g&2&&(Za.$$scope={dirty:g,ctx:t}),tt.$set(Za);const te={};g&2&&(te.$$scope={dirty:g,ctx:t}),ot.$set(te);const Ua={};g&2&&(Ua.$$scope={dirty:g,ctx:t}),at.$set(Ua);const Na={};g&2&&(Na.$$scope={dirty:g,ctx:t}),nt.$set(Na);const xa={};g&2&&(xa.$$scope={dirty:g,ctx:t}),lt.$set(xa);const za={};g&2&&(za.$$scope={dirty:g,ctx:t}),it.$set(za);const Ga={};g&2&&(Ga.$$scope={dirty:g,ctx:t}),ct.$set(Ga);const Ra={};g&2&&(Ra.$$scope={dirty:g,ctx:t}),ht.$set(Ra);const Ba={};g&2&&(Ba.$$scope={dirty:g,ctx:t}),pt.$set(Ba);const G={};g&2&&(G.$$scope={dirty:g,ctx:t}),ft.$set(G);const Va={};g&2&&(Va.$$scope={dirty:g,ctx:t}),gt.$set(Va);const Ee={};g&2&&(Ee.$$scope={dirty:g,ctx:t}),_t.$set(Ee)},i(t){jn||(M(s.$$.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(Lt.$$.fragment,t),M(qt.$$.fragment,t),M(Ot.$$.fragment,t),M(Le.$$.fragment,t),M(qe.$$.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(lo.$$.fragment,t),M(ho.$$.fragment,t),M(tt.$$.fragment,t),M(ot.$$.fragment,t),M(mo.$$.fragment,t),M(po.$$.fragment,t),M(go.$$.fragment,t),M(at.$$.fragment,t),M(nt.$$.fragment,t),M(_o.$$.fragment,t),M(To.$$.fragment,t),M(vo.$$.fragment,t),M(lt.$$.fragment,t),M(it.$$.fragment,t),M(wo.$$.fragment,t),M(Mo.$$.fragment,t),M(ko.$$.fragment,t),M(ct.$$.fragment,t),M(ht.$$.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(gt.$$.fragment,t),M(_t.$$.fragment,t),jn=!0)},o(t){$(s.$$.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),$(Lt.$$.fragment,t),$(qt.$$.fragment,t),$(Ot.$$.fragment,t),$(Le.$$.fragment,t),$(qe.$$.fragment,t),$(Kt.$$.fragment,t),$(eo.$$.fragment,t),$(He.$$.fragment,t),$(no.$$.fragment,t),$(Oe.$$.fragment,t),$(Ke.$$.fragment,t),$(ro.$$.fragment,t),$(lo.$$.fragment,t),$(ho.$$.fragment,t),$(tt.$$.fragment,t),$(ot.$$.fragment,t),$(mo.$$.fragment,t),$(po.$$.fragment,t),$(go.$$.fragment,t),$(at.$$.fragment,t),$(nt.$$.fragment,t),$(_o.$$.fragment,t),$(To.$$.fragment,t),$(vo.$$.fragment,t),$(lt.$$.fragment,t),$(it.$$.fragment,t),$(wo.$$.fragment,t),$(Mo.$$.fragment,t),$(ko.$$.fragment,t),$(ct.$$.fragment,t),$(ht.$$.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),$(gt.$$.fragment,t),$(_t.$$.fragment,t),jn=!1},d(t){o(d),t&&o(b),t&&o(u),I(s),t&&o(Xa),I(Ne,t),t&&o(Ya),t&&o(re),I(Dt),t&&o(Aa),t&&o(R),t&&o(Sa),t&&o(Bo),t&&o(La),t&&o(Vo),t&&o(qa),t&&o(Po),t&&o(Qa),t&&o(Z),t&&o(Ha),t&&o(oe),t&&o(Oa),t&&o(ie),I(Zt),t&&o(Ka),t&&o(qo),t&&o(en),I(Ut,t),t&&o(tn),t&&o(Ge),t&&o(on),t&&o(Ko),t&&o(sn),t&&o(es),t&&o(an),t&&o(os),t&&o(nn),t&&o(de),I(Gt),t&&o(rn),t&&o(N),I(Rt),I(Ve),t&&o(ln),t&&o(me),I(Vt),t&&o(dn),t&&o(pe),I(Pt),I(Xt),t&&o(cn),t&&o(fe),I(Yt),t&&o(hn),t&&o(H),I(At),I(St),t&&o(mn),t&&o(ue),I(Lt),t&&o(pn),t&&o(O),I(qt),I(Ot),I(Le),I(qe),t&&o(fn),t&&o(_e),I(Kt),t&&o(un),t&&o(C),I(eo),I(He),I(no),I(Oe),I(Ke),t&&o(gn),t&&o(be),I(ro),t&&o(_n),t&&o(x),I(lo),I(ho),I(tt),I(ot),t&&o(Tn),t&&o(ve),I(mo),t&&o(bn),t&&o(W),I(po),I(go),I(at),I(nt),t&&o(yn),t&&o(Me),I(_o),t&&o(vn),t&&o(K),I(To),I(vo),I(lt),I(it),t&&o(wn),t&&o(Ie),I(wo),t&&o(Mn),t&&o(ee),I(Mo),I(ko),I(ct),I(ht),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(gt),I(_t)}}}const Um={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 Nm(k){return pm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xm extends dm{constructor(d){super();cm(this,d,Nm,Zm,hm,{})}}export{Xm as default,Um as metadata};
