import{s as kt,o as Jt,n as G}from"../chunks/scheduler.25b97de1.js";import{S as Wt,i as Ut,g as m,s as i,r as u,A as Zt,h as p,f as s,c as l,j as P,u as g,x as T,k as B,y as c,a as d,v as _,d as b,t as y,w}from"../chunks/index.d9030fc9.js";import{T as Ce}from"../chunks/Tip.baa67368.js";import{D as he}from"../chunks/Docstring.e257edda.js";import{C as Xe}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Ee}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as $e,E as It}from"../chunks/EditOnGithub.91d95064.js";function zt(M){let t,h="Example:",a,r,f;return r=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhpZXJhQ29uZmlnJTJDJTIwSGllcmFNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBIaWVyYSUyMGhpZXJhLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwSGllcmFDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwaGllcmEtYmFzZS1wYXRjaDE2LTIyNCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwSGllcmFNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HieraConfig, HieraModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Hiera hiera-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = HieraConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the hiera-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HieraModel(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`,wrap:!1}}),{c(){t=m("p"),t.textContent=h,a=i(),u(r.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=h),a=l(o),g(r.$$.fragment,o)},m(o,v){d(o,t,v),d(o,a,v),_(r,o,v),f=!0},p:G,i(o){f||(b(r.$$.fragment,o),f=!0)},o(o){y(r.$$.fragment,o),f=!1},d(o){o&&(s(t),s(a)),w(r,o)}}}function Nt(M){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=m("p"),t.innerHTML=h},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(a,r){d(a,t,r)},p:G,d(a){a&&s(t)}}}function Pt(M){let t,h="Example:",a,r,f;return r=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEhpZXJhTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGaGllcmEtdGlueS0yMjQtaGYlMjIpJTBBbW9kZWwlMjAlM0QlMjBIaWVyYU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmhpZXJhLXRpbnktMjI0LWhmJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, HieraModel
<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>, trust_remote_code=<span class="hljs-literal">True</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/hiera-tiny-224-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HieraModel.from_pretrained(<span class="hljs-string">&quot;facebook/hiera-tiny-224-hf&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">49</span>, <span class="hljs-number">768</span>]`,wrap:!1}}),{c(){t=m("p"),t.textContent=h,a=i(),u(r.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=h),a=l(o),g(r.$$.fragment,o)},m(o,v){d(o,t,v),d(o,a,v),_(r,o,v),f=!0},p:G,i(o){f||(b(r.$$.fragment,o),f=!0)},o(o){y(r.$$.fragment,o),f=!1},d(o){o&&(s(t),s(a)),w(r,o)}}}function Bt(M){let t,h=`Note that we provide a script to pre-train this model on custom data in our <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining" rel="nofollow">examples
directory</a>.`;return{c(){t=m("p"),t.innerHTML=h},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-7i3y9o"&&(t.innerHTML=h)},m(a,r){d(a,t,r)},p:G,d(a){a&&s(t)}}}function Gt(M){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=m("p"),t.innerHTML=h},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(a,r){d(a,t,r)},p:G,d(a){a&&s(t)}}}function qt(M){let t,h="Examples:",a,r,f;return r=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEhpZXJhRm9yUHJlVHJhaW5pbmclMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZoaWVyYS10aW55LTIyNC1tYWUtaGYlMjIpJTBBbW9kZWwlMjAlM0QlMjBIaWVyYUZvclByZVRyYWluaW5nLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmhpZXJhLXRpbnktMjI0LW1hZS1oZiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFwcmludChsaXN0KGxvZ2l0cy5zaGFwZSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, HieraForPreTraining
<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/hiera-tiny-224-mae-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HieraForPreTraining.from_pretrained(<span class="hljs-string">&quot;facebook/hiera-tiny-224-mae-hf&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>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-built_in">list</span>(logits.shape))
[<span class="hljs-number">1</span>, <span class="hljs-number">196</span>, <span class="hljs-number">768</span>]`,wrap:!1}}),{c(){t=m("p"),t.textContent=h,a=i(),u(r.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),T(t)!=="svelte-kvfsh7"&&(t.textContent=h),a=l(o),g(r.$$.fragment,o)},m(o,v){d(o,t,v),d(o,a,v),_(r,o,v),f=!0},p:G,i(o){f||(b(r.$$.fragment,o),f=!0)},o(o){y(r.$$.fragment,o),f=!1},d(o){o&&(s(t),s(a)),w(r,o)}}}function Rt(M){let t,h=`Note that it’s possible to fine-tune Hiera on higher resolution images than the ones it has been trained on, by
setting <code>interpolate_pos_encoding</code> to <code>True</code> in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.`;return{c(){t=m("p"),t.innerHTML=h},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-15d8aix"&&(t.innerHTML=h)},m(a,r){d(a,t,r)},p:G,d(a){a&&s(t)}}}function Et(M){let t,h=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=m("p"),t.innerHTML=h},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(a,r){d(a,t,r)},p:G,d(a){a&&s(t)}}}function Xt(M){let t,h="Example:",a,r,f;return r=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEhpZXJhRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZoaWVyYS10aW55LTIyNC1pbjFrLWhmJTIyKSUwQW1vZGVsJTIwJTNEJTIwSGllcmFGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmhpZXJhLXRpbnktMjI0LWluMWstaGYlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, HieraForImageClassification
<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>, trust_remote_code=<span class="hljs-literal">True</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/hiera-tiny-224-in1k-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HieraForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/hiera-tiny-224-in1k-hf&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`,wrap:!1}}),{c(){t=m("p"),t.textContent=h,a=i(),u(r.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=h),a=l(o),g(r.$$.fragment,o)},m(o,v){d(o,t,v),d(o,a,v),_(r,o,v),f=!0},p:G,i(o){f||(b(r.$$.fragment,o),f=!0)},o(o){y(r.$$.fragment,o),f=!1},d(o){o&&(s(t),s(a)),w(r,o)}}}function Lt(M){let t,h,a,r,f,o,v,je,A,ht='Hiera was proposed in <a href="https://arxiv.org/abs/2306.00989" rel="nofollow">Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles</a> by Chaitanya Ryali, Yuan-Ting Hu, Daniel Bolya, Chen Wei, Haoqi Fan, Po-Yao Huang, Vaibhav Aggarwal, Arkabandhu Chowdhury, Omid Poursaeed, Judy Hoffman, Jitendra Malik, Yanghao Li, Christoph Feichtenhofer',xe,O,ft="The paper introduces “Hiera,” a hierarchical Vision Transformer that simplifies the architecture of modern hierarchical vision transformers by removing unnecessary components without compromising on accuracy or efficiency. Unlike traditional transformers that add complex vision-specific components to improve supervised classification performance, Hiera demonstrates that such additions, often termed “bells-and-whistles,” are not essential for high accuracy. By leveraging a strong visual pretext task (MAE) for pretraining, Hiera retains simplicity and achieves superior accuracy and speed both in inference and training across various image and video recognition tasks. The approach suggests that spatial biases required for vision tasks can be effectively learned through proper pretraining, eliminating the need for added architectural complexity.",Fe,D,ut="The abstract from the paper is the following:",ke,K,gt='<em>Modern hierarchical vision transformers have added several vision-specific components in the pursuit of supervised classification performance. While these components lead to effective accuracies and attractive FLOP counts, the added complexity actually makes these transformers slower than their vanilla ViT counterparts. In this paper, we argue that this additional bulk is unnecessary. By pretraining with a strong visual pretext task (MAE), we can strip out all the bells-and-whistles from a state-of-the-art multi-stage vision transformer without losing accuracy. In the process, we create Hiera, an extremely simple hierarchical vision transformer that is more accurate than previous models while being significantly faster both at inference and during training. We evaluate Hiera on a variety of tasks for image and video recognition. Our code and models are available at <a href="https://github.com/facebookresearch/hiera" rel="nofollow">https://github.com/facebookresearch/hiera</a>.</em>',Je,ee,_t='This model was a joint contibution by <a href="https://huggingface.co/EduardoPacheco" rel="nofollow">EduardoPacheco</a> and <a href="https://huggingface.co/namangarg110" rel="nofollow">namangarg110</a>. The original code can be found [here] (<a href="https://github.com/facebookresearch/hiera" rel="nofollow">https://github.com/facebookresearch/hiera</a>).',We,te,Ue,C,oe,Le,fe,bt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraModel">HieraModel</a>. It is used to instantiate a Hiera
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 Hiera
<a href="https://huggingface.co/facebook/hiera-base-224" rel="nofollow">facebook/hiera-base-224</a> architecture.`,Qe,ue,yt=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31098/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ve,q,Ze,ne,Ie,W,ae,Ye,ge,wt=`The bare Hiera Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Se,F,se,Ae,_e,Tt='The <a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraModel">HieraModel</a> forward method, overrides the <code>__call__</code> special method.',Oe,R,De,E,ze,re,Ne,$,ie,Ke,be,vt="The Hiera Model transformer with the decoder on top for self-supervised pre-training.",et,X,tt,ye,Mt=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,ot,k,le,nt,we,$t='The <a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraForPreTraining">HieraForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',at,L,st,Q,Pe,de,Be,H,ce,rt,Te,Ht=`Hiera Model transformer with an image classification head on top (a linear layer on top of the final hidden state with
average pooling) e.g. for ImageNet.`,it,V,lt,ve,Ct=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,dt,J,me,ct,Me,jt='The <a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraForImageClassification">HieraForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',mt,Y,pt,S,Ge,pe,qe,He,Re;return f=new $e({props:{title:"Hiera",local:"hiera",headingTag:"h1"}}),v=new $e({props:{title:"Overview",local:"overview",headingTag:"h2"}}),te=new $e({props:{title:"HieraConfig",local:"transformers.HieraConfig",headingTag:"h2"}}),oe=new he({props:{name:"class transformers.HieraConfig",anchor:"transformers.HieraConfig",parameters:[{name:"embed_dim",val:" = 96"},{name:"image_size",val:" = [224, 224]"},{name:"patch_size",val:" = [7, 7]"},{name:"patch_stride",val:" = [4, 4]"},{name:"patch_padding",val:" = [3, 3]"},{name:"mlp_ratio",val:" = 4.0"},{name:"depths",val:" = [2, 3, 16, 3]"},{name:"num_heads",val:" = [1, 2, 4, 8]"},{name:"embed_dim_multiplier",val:" = 2.0"},{name:"num_query_pool",val:" = 3"},{name:"query_stride",val:" = [2, 2]"},{name:"masked_unit_size",val:" = [8, 8]"},{name:"masked_unit_attention",val:" = [True, True, False, False]"},{name:"drop_path_rate",val:" = 0.0"},{name:"num_channels",val:" = 3"},{name:"hidden_act",val:" = 'gelu'"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_init",val:" = 1.0"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"decoder_hidden_size",val:" = None"},{name:"decoder_depth",val:" = None"},{name:"decoder_num_heads",val:" = None"},{name:"normalize_pixel_loss",val:" = True"},{name:"mask_ratio",val:" = 0.6"},{name:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.HieraConfig.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 96) &#x2014;
Dimensionality of patch embedding.`,name:"embed_dim"},{anchor:"transformers.HieraConfig.image_size",description:`<strong>image_size</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[224, 224]</code>) &#x2014;
The size (resolution) of input in the format (height, width) for images
and (frames, height, width) for videos.`,name:"image_size"},{anchor:"transformers.HieraConfig.patch_size",description:`<strong>patch_size</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[7, 7]</code>) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.HieraConfig.patch_stride",description:`<strong>patch_stride</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[4, 4]</code>) &#x2014;
The stride of the patch.`,name:"patch_stride"},{anchor:"transformers.HieraConfig.patch_padding",description:`<strong>patch_padding</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[3, 3]</code>) &#x2014;
The padding of the patch.`,name:"patch_padding"},{anchor:"transformers.HieraConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
The ratio of mlp hidden dim to embedding dim.`,name:"mlp_ratio"},{anchor:"transformers.HieraConfig.depths",description:`<strong>depths</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[2, 3, 16, 3]</code>) &#x2014;
Depth of each layer in the Transformer encoder.`,name:"depths"},{anchor:"transformers.HieraConfig.num_heads",description:`<strong>num_heads</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[1, 2, 4, 8]</code>) &#x2014;
Number of attention heads in each layer of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.HieraConfig.embed_dim_multiplier",description:`<strong>embed_dim_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
The multiplier to the dimensionality of patch embedding in each layer of the Transformer encoder.`,name:"embed_dim_multiplier"},{anchor:"transformers.HieraConfig.num_query_pool",description:`<strong>num_query_pool</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of query pool stages.`,name:"num_query_pool"},{anchor:"transformers.HieraConfig.query_stride",description:`<strong>query_stride</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[2, 2]</code>) &#x2014;
The stride of the query pool.`,name:"query_stride"},{anchor:"transformers.HieraConfig.masked_unit_size",description:`<strong>masked_unit_size</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[8, 8]</code>) &#x2014;
The size of the masked unit.`,name:"masked_unit_size"},{anchor:"transformers.HieraConfig.masked_unit_attention",description:`<strong>masked_unit_attention</strong> (<code>list(bool)</code>, <em>optional</em>, defaults to <code>[True, True, False, False]</code>) &#x2014;
Whether to use masked unit attention in each layer of the Transformer encoder.`,name:"masked_unit_attention"},{anchor:"transformers.HieraConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The drop path rate.`,name:"drop_path_rate"},{anchor:"transformers.HieraConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.HieraConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder. 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.HieraConfig.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 and
the zero_initializer for initializing all bias vectors.`,name:"initializer_range"},{anchor:"transformers.HieraConfig.layer_norm_init",description:`<strong>layer_norm_init</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The initial weight value for layer normalization layers.`,name:"layer_norm_init"},{anchor:"transformers.HieraConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.HieraConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of decoder embeddings for MAE pretraining.`,name:"decoder_hidden_size"},{anchor:"transformers.HieraConfig.decoder_depth",description:`<strong>decoder_depth</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Depth of the decoder for MAE pretraining.`,name:"decoder_depth"},{anchor:"transformers.HieraConfig.decoder_num_heads",description:`<strong>decoder_num_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of attention heads in each layer of the decoder for MAE pretraining.`,name:"decoder_num_heads"},{anchor:"transformers.HieraConfig.normalize_pixel_loss",description:`<strong>normalize_pixel_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the pixel loss by the number of pixels.`,name:"normalize_pixel_loss"},{anchor:"transformers.HieraConfig.mask_ratio",description:`<strong>mask_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.6) &#x2014;
The ratio of masked tokens in the input.`,name:"mask_ratio"},{anchor:"transformers.HieraConfig.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). If unset and <code>out_indices</code> is set, will default to the
corresponding stages. If unset and <code>out_indices</code> is unset, will default to the last stage. Must be in the
same order as defined in the <code>stage_names</code> attribute.`,name:"out_features"},{anchor:"transformers.HieraConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and <code>out_features</code> is set, will default to the corresponding stages.
If unset and <code>out_features</code> is unset, will default to the last stage. Must be in the
same order as defined in the <code>stage_names</code> attribute.`,name:"out_indices"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/hiera/configuration_hiera.py#L25"}}),q=new Ee({props:{anchor:"transformers.HieraConfig.example",$$slots:{default:[zt]},$$scope:{ctx:M}}}),ne=new $e({props:{title:"HieraModel",local:"transformers.HieraModel",headingTag:"h2"}}),ae=new he({props:{name:"class transformers.HieraModel",anchor:"transformers.HieraModel",parameters:[{name:"config",val:": HieraConfig"},{name:"add_pooling_layer",val:": bool = True"},{name:"is_mae",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HieraModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraConfig">HieraConfig</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/pr_31098/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.HieraModel.add_pooling_layer",description:`<strong>add_pooling_layer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to apply pooling layer.`,name:"add_pooling_layer"},{anchor:"transformers.HieraModel.is_mae",description:`<strong>is_mae</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to run the model on MAE mode.`,name:"is_mae"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/hiera/modeling_hiera.py#L920"}}),se=new he({props:{name:"forward",anchor:"transformers.HieraModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"noise",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.HieraModel.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/pr_31098/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31098/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">BitImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.HieraModel.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.HieraModel.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.HieraModel.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.HieraModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.HieraModel.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.HieraModel.forward.noise",description:`<strong>noise</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_mask_units)</code>, <em>optional</em>) which is &#x2014;
mainly used for testing purposes to control randomness and maintain the reproducibility
when is_mae is set to True.`,name:"noise"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/hiera/modeling_hiera.py#L956",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.hiera.modeling_hiera.HieraModelOutput</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/pr_31098/en/model_doc/hiera#transformers.HieraConfig"
>HieraConfig</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>) — 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>, <em>optional</em>, returned when <code>add_pooling_layer=True</code> is passed) — Average pooling of the last layer hidden-state.</p>
</li>
<li>
<p><strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length)</code>) — Tensor indicating which patches are masked (0) and which are not (1).</p>
</li>
<li>
<p><strong>ids_restore</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) — Tensor containing the original index of the (shuffled) masked patches.</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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. These are the unrolled hidden states of the model.</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(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) 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>
<li>
<p><strong>reshaped_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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, height, width, hidden_size)</code>. These are the reshaped and re-rolled hidden states of the model.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.hiera.modeling_hiera.HieraModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),R=new Ce({props:{$$slots:{default:[Nt]},$$scope:{ctx:M}}}),E=new Ee({props:{anchor:"transformers.HieraModel.forward.example",$$slots:{default:[Pt]},$$scope:{ctx:M}}}),re=new $e({props:{title:"HieraForPreTraining",local:"transformers.HieraForPreTraining",headingTag:"h2"}}),ie=new he({props:{name:"class transformers.HieraForPreTraining",anchor:"transformers.HieraForPreTraining",parameters:[{name:"config",val:": HieraConfig"}],parametersDescription:[{anchor:"transformers.HieraForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraConfig">HieraConfig</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/pr_31098/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/vr_31098/src/transformers/models/hiera/modeling_hiera.py#L1208"}}),X=new Ce({props:{$$slots:{default:[Bt]},$$scope:{ctx:M}}}),le=new he({props:{name:"forward",anchor:"transformers.HieraForPreTraining.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"noise",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.HieraForPreTraining.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/pr_31098/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31098/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">BitImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.HieraForPreTraining.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.HieraForPreTraining.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.HieraForPreTraining.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.HieraForPreTraining.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.HieraForPreTraining.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.HieraForPreTraining.forward.noise",description:`<strong>noise</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_mask_units)</code>, <em>optional</em>) which is &#x2014;
mainly used for testing purposes to control randomness and maintain the reproducibility
when is_mae is set to True.`,name:"noise"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/hiera/modeling_hiera.py#L1261",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.hiera.modeling_hiera.HieraForPreTrainingOutput</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/pr_31098/en/model_doc/hiera#transformers.HieraConfig"
>HieraConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>) — Pixel reconstruction loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, patch_size ** 2 * num_channels)</code>) — Pixel reconstruction logits.</li>
<li><strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length)</code>) — Tensor indicating which patches are masked (0) and which are not (1).</li>
<li><strong>ids_restore</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) — Tensor containing the original index of the (shuffled) masked patches.</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>) — 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>) — 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>
<li><strong>reshaped_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>) — 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, height, width, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs reshaped to include the spatial dimensions.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.hiera.modeling_hiera.HieraForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),L=new Ce({props:{$$slots:{default:[Gt]},$$scope:{ctx:M}}}),Q=new Ee({props:{anchor:"transformers.HieraForPreTraining.forward.example",$$slots:{default:[qt]},$$scope:{ctx:M}}}),de=new $e({props:{title:"HieraForImageClassification",local:"transformers.HieraForImageClassification",headingTag:"h2"}}),ce=new he({props:{name:"class transformers.HieraForImageClassification",anchor:"transformers.HieraForImageClassification",parameters:[{name:"config",val:": HieraConfig"}],parametersDescription:[{anchor:"transformers.HieraForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/hiera#transformers.HieraConfig">HieraConfig</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/pr_31098/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/vr_31098/src/transformers/models/hiera/modeling_hiera.py#L1356"}}),V=new Ce({props:{$$slots:{default:[Rt]},$$scope:{ctx:M}}}),me=new he({props:{name:"forward",anchor:"transformers.HieraForImageClassification.forward",parameters:[{name:"pixel_values",val:""},{name:"head_mask",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.HieraForImageClassification.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/pr_31098/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31098/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">BitImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.HieraForImageClassification.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.HieraForImageClassification.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.HieraForImageClassification.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.HieraForImageClassification.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.HieraForImageClassification.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.HieraForImageClassification.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/vr_31098/src/transformers/models/hiera/modeling_hiera.py#L1386",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.hiera.modeling_hiera.HieraForImageClassificationOutput</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/pr_31098/en/model_doc/hiera#transformers.HieraConfig"
>HieraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <code>optional</code>) — Loss value for the training task.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_labels)</code>) — Prediction scores of the classification head (logits of the output layer).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <code>optional</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. These are the unrolled hidden states of the model.</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(torch.FloatTensor)</code>, <code>optional</code>) — Tuple of <code>torch.FloatTensor</code> (one for each stage) 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>
<li>
<p><strong>reshaped_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <code>optional</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each stage) of
shape <code>(batch_size, height, width, hidden_size)</code>. These are the reshaped and re-rolled hidden states of the model.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs reshaped to
include the spatial dimensions.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.hiera.modeling_hiera.HieraForImageClassificationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new Ce({props:{$$slots:{default:[Et]},$$scope:{ctx:M}}}),S=new Ee({props:{anchor:"transformers.HieraForImageClassification.forward.example",$$slots:{default:[Xt]},$$scope:{ctx:M}}}),pe=new It({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/hiera.md"}}),{c(){t=m("meta"),h=i(),a=m("p"),r=i(),u(f.$$.fragment),o=i(),u(v.$$.fragment),je=i(),A=m("p"),A.innerHTML=ht,xe=i(),O=m("p"),O.textContent=ft,Fe=i(),D=m("p"),D.textContent=ut,ke=i(),K=m("p"),K.innerHTML=gt,Je=i(),ee=m("p"),ee.innerHTML=_t,We=i(),u(te.$$.fragment),Ue=i(),C=m("div"),u(oe.$$.fragment),Le=i(),fe=m("p"),fe.innerHTML=bt,Qe=i(),ue=m("p"),ue.innerHTML=yt,Ve=i(),u(q.$$.fragment),Ze=i(),u(ne.$$.fragment),Ie=i(),W=m("div"),u(ae.$$.fragment),Ye=i(),ge=m("p"),ge.innerHTML=wt,Se=i(),F=m("div"),u(se.$$.fragment),Ae=i(),_e=m("p"),_e.innerHTML=Tt,Oe=i(),u(R.$$.fragment),De=i(),u(E.$$.fragment),ze=i(),u(re.$$.fragment),Ne=i(),$=m("div"),u(ie.$$.fragment),Ke=i(),be=m("p"),be.textContent=vt,et=i(),u(X.$$.fragment),tt=i(),ye=m("p"),ye.innerHTML=Mt,ot=i(),k=m("div"),u(le.$$.fragment),nt=i(),we=m("p"),we.innerHTML=$t,at=i(),u(L.$$.fragment),st=i(),u(Q.$$.fragment),Pe=i(),u(de.$$.fragment),Be=i(),H=m("div"),u(ce.$$.fragment),rt=i(),Te=m("p"),Te.textContent=Ht,it=i(),u(V.$$.fragment),lt=i(),ve=m("p"),ve.innerHTML=Ct,dt=i(),J=m("div"),u(me.$$.fragment),ct=i(),Me=m("p"),Me.innerHTML=jt,mt=i(),u(Y.$$.fragment),pt=i(),u(S.$$.fragment),Ge=i(),u(pe.$$.fragment),qe=i(),He=m("p"),this.h()},l(e){const n=Zt("svelte-u9bgzb",document.head);t=p(n,"META",{name:!0,content:!0}),n.forEach(s),h=l(e),a=p(e,"P",{}),P(a).forEach(s),r=l(e),g(f.$$.fragment,e),o=l(e),g(v.$$.fragment,e),je=l(e),A=p(e,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1hwvwes"&&(A.innerHTML=ht),xe=l(e),O=p(e,"P",{"data-svelte-h":!0}),T(O)!=="svelte-13w2zfe"&&(O.textContent=ft),Fe=l(e),D=p(e,"P",{"data-svelte-h":!0}),T(D)!=="svelte-vfdo9a"&&(D.textContent=ut),ke=l(e),K=p(e,"P",{"data-svelte-h":!0}),T(K)!=="svelte-1m8exf9"&&(K.innerHTML=gt),Je=l(e),ee=p(e,"P",{"data-svelte-h":!0}),T(ee)!=="svelte-wjohm3"&&(ee.innerHTML=_t),We=l(e),g(te.$$.fragment,e),Ue=l(e),C=p(e,"DIV",{class:!0});var U=P(C);g(oe.$$.fragment,U),Le=l(U),fe=p(U,"P",{"data-svelte-h":!0}),T(fe)!=="svelte-1euuopj"&&(fe.innerHTML=bt),Qe=l(U),ue=p(U,"P",{"data-svelte-h":!0}),T(ue)!=="svelte-1eopo2z"&&(ue.innerHTML=yt),Ve=l(U),g(q.$$.fragment,U),U.forEach(s),Ze=l(e),g(ne.$$.fragment,e),Ie=l(e),W=p(e,"DIV",{class:!0});var N=P(W);g(ae.$$.fragment,N),Ye=l(N),ge=p(N,"P",{"data-svelte-h":!0}),T(ge)!=="svelte-ewoc30"&&(ge.innerHTML=wt),Se=l(N),F=p(N,"DIV",{class:!0});var Z=P(F);g(se.$$.fragment,Z),Ae=l(Z),_e=p(Z,"P",{"data-svelte-h":!0}),T(_e)!=="svelte-10w79wv"&&(_e.innerHTML=Tt),Oe=l(Z),g(R.$$.fragment,Z),De=l(Z),g(E.$$.fragment,Z),Z.forEach(s),N.forEach(s),ze=l(e),g(re.$$.fragment,e),Ne=l(e),$=p(e,"DIV",{class:!0});var j=P($);g(ie.$$.fragment,j),Ke=l(j),be=p(j,"P",{"data-svelte-h":!0}),T(be)!=="svelte-dq7c69"&&(be.textContent=vt),et=l(j),g(X.$$.fragment,j),tt=l(j),ye=p(j,"P",{"data-svelte-h":!0}),T(ye)!=="svelte-1gjh92c"&&(ye.innerHTML=Mt),ot=l(j),k=p(j,"DIV",{class:!0});var I=P(k);g(le.$$.fragment,I),nt=l(I),we=p(I,"P",{"data-svelte-h":!0}),T(we)!=="svelte-1n2ak8f"&&(we.innerHTML=$t),at=l(I),g(L.$$.fragment,I),st=l(I),g(Q.$$.fragment,I),I.forEach(s),j.forEach(s),Pe=l(e),g(de.$$.fragment,e),Be=l(e),H=p(e,"DIV",{class:!0});var x=P(H);g(ce.$$.fragment,x),rt=l(x),Te=p(x,"P",{"data-svelte-h":!0}),T(Te)!=="svelte-1pc0sj6"&&(Te.textContent=Ht),it=l(x),g(V.$$.fragment,x),lt=l(x),ve=p(x,"P",{"data-svelte-h":!0}),T(ve)!=="svelte-1gjh92c"&&(ve.innerHTML=Ct),dt=l(x),J=p(x,"DIV",{class:!0});var z=P(J);g(me.$$.fragment,z),ct=l(z),Me=p(z,"P",{"data-svelte-h":!0}),T(Me)!=="svelte-8duasz"&&(Me.innerHTML=jt),mt=l(z),g(Y.$$.fragment,z),pt=l(z),g(S.$$.fragment,z),z.forEach(s),x.forEach(s),Ge=l(e),g(pe.$$.fragment,e),qe=l(e),He=p(e,"P",{}),P(He).forEach(s),this.h()},h(){B(t,"name","hf:doc:metadata"),B(t,"content",Qt),B(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){c(document.head,t),d(e,h,n),d(e,a,n),d(e,r,n),_(f,e,n),d(e,o,n),_(v,e,n),d(e,je,n),d(e,A,n),d(e,xe,n),d(e,O,n),d(e,Fe,n),d(e,D,n),d(e,ke,n),d(e,K,n),d(e,Je,n),d(e,ee,n),d(e,We,n),_(te,e,n),d(e,Ue,n),d(e,C,n),_(oe,C,null),c(C,Le),c(C,fe),c(C,Qe),c(C,ue),c(C,Ve),_(q,C,null),d(e,Ze,n),_(ne,e,n),d(e,Ie,n),d(e,W,n),_(ae,W,null),c(W,Ye),c(W,ge),c(W,Se),c(W,F),_(se,F,null),c(F,Ae),c(F,_e),c(F,Oe),_(R,F,null),c(F,De),_(E,F,null),d(e,ze,n),_(re,e,n),d(e,Ne,n),d(e,$,n),_(ie,$,null),c($,Ke),c($,be),c($,et),_(X,$,null),c($,tt),c($,ye),c($,ot),c($,k),_(le,k,null),c(k,nt),c(k,we),c(k,at),_(L,k,null),c(k,st),_(Q,k,null),d(e,Pe,n),_(de,e,n),d(e,Be,n),d(e,H,n),_(ce,H,null),c(H,rt),c(H,Te),c(H,it),_(V,H,null),c(H,lt),c(H,ve),c(H,dt),c(H,J),_(me,J,null),c(J,ct),c(J,Me),c(J,mt),_(Y,J,null),c(J,pt),_(S,J,null),d(e,Ge,n),_(pe,e,n),d(e,qe,n),d(e,He,n),Re=!0},p(e,[n]){const U={};n&2&&(U.$$scope={dirty:n,ctx:e}),q.$set(U);const N={};n&2&&(N.$$scope={dirty:n,ctx:e}),R.$set(N);const Z={};n&2&&(Z.$$scope={dirty:n,ctx:e}),E.$set(Z);const j={};n&2&&(j.$$scope={dirty:n,ctx:e}),X.$set(j);const I={};n&2&&(I.$$scope={dirty:n,ctx:e}),L.$set(I);const x={};n&2&&(x.$$scope={dirty:n,ctx:e}),Q.$set(x);const z={};n&2&&(z.$$scope={dirty:n,ctx:e}),V.$set(z);const xt={};n&2&&(xt.$$scope={dirty:n,ctx:e}),Y.$set(xt);const Ft={};n&2&&(Ft.$$scope={dirty:n,ctx:e}),S.$set(Ft)},i(e){Re||(b(f.$$.fragment,e),b(v.$$.fragment,e),b(te.$$.fragment,e),b(oe.$$.fragment,e),b(q.$$.fragment,e),b(ne.$$.fragment,e),b(ae.$$.fragment,e),b(se.$$.fragment,e),b(R.$$.fragment,e),b(E.$$.fragment,e),b(re.$$.fragment,e),b(ie.$$.fragment,e),b(X.$$.fragment,e),b(le.$$.fragment,e),b(L.$$.fragment,e),b(Q.$$.fragment,e),b(de.$$.fragment,e),b(ce.$$.fragment,e),b(V.$$.fragment,e),b(me.$$.fragment,e),b(Y.$$.fragment,e),b(S.$$.fragment,e),b(pe.$$.fragment,e),Re=!0)},o(e){y(f.$$.fragment,e),y(v.$$.fragment,e),y(te.$$.fragment,e),y(oe.$$.fragment,e),y(q.$$.fragment,e),y(ne.$$.fragment,e),y(ae.$$.fragment,e),y(se.$$.fragment,e),y(R.$$.fragment,e),y(E.$$.fragment,e),y(re.$$.fragment,e),y(ie.$$.fragment,e),y(X.$$.fragment,e),y(le.$$.fragment,e),y(L.$$.fragment,e),y(Q.$$.fragment,e),y(de.$$.fragment,e),y(ce.$$.fragment,e),y(V.$$.fragment,e),y(me.$$.fragment,e),y(Y.$$.fragment,e),y(S.$$.fragment,e),y(pe.$$.fragment,e),Re=!1},d(e){e&&(s(h),s(a),s(r),s(o),s(je),s(A),s(xe),s(O),s(Fe),s(D),s(ke),s(K),s(Je),s(ee),s(We),s(Ue),s(C),s(Ze),s(Ie),s(W),s(ze),s(Ne),s($),s(Pe),s(Be),s(H),s(Ge),s(qe),s(He)),s(t),w(f,e),w(v,e),w(te,e),w(oe),w(q),w(ne,e),w(ae),w(se),w(R),w(E),w(re,e),w(ie),w(X),w(le),w(L),w(Q),w(de,e),w(ce),w(V),w(me),w(Y),w(S),w(pe,e)}}}const Qt='{"title":"Hiera","local":"hiera","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"HieraConfig","local":"transformers.HieraConfig","sections":[],"depth":2},{"title":"HieraModel","local":"transformers.HieraModel","sections":[],"depth":2},{"title":"HieraForPreTraining","local":"transformers.HieraForPreTraining","sections":[],"depth":2},{"title":"HieraForImageClassification","local":"transformers.HieraForImageClassification","sections":[],"depth":2}],"depth":1}';function Vt(M){return Jt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class to extends Wt{constructor(t){super(),Ut(this,t,Vt,Lt,kt,{})}}export{to as component};
