import{s as Fo,o as Po,n as et}from"../chunks/scheduler.9bc65507.js";import{S as Zo,i as Wo,g as o,s as d,u as b,A as Uo,h as n,f as t,c,j as f,v as _,y as g,k as m,o as r,a as l,w as y,d as v,t as T,x as w}from"../chunks/index.78c82d43.js";import{T as No}from"../chunks/Tip.87d55b76.js";import{D as Ce}from"../chunks/Docstring.4e7352e2.js";import{C as Ot}from"../chunks/CodeBlock.73e038be.js";import{I as Me}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Qt}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as Eo}from"../chunks/PipelineTag.75b0f707.js";function Bo(H){let i,$="Example:",p,h,u;return h=new Ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEh5YnJpZENvbmZpZyUyQyUyMFZpVEh5YnJpZE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFZpVCUyMEh5YnJpZCUyMHZpdC1oeWJyaWQtYmFzZS1iaXQtMzg0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFZpVEh5YnJpZENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjB2aXQtaHlicmlkLWJhc2UtYml0LTM4NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwVmlUSHlicmlkTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTHybridConfig, ViTHybridModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ViT Hybrid vit-hybrid-base-bit-384 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ViTHybridConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the vit-hybrid-base-bit-384 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTHybridModel(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(){i=o("p"),i.textContent=$,p=d(),b(h.$$.fragment)},l(s){i=n(s,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=$),p=c(s),_(h.$$.fragment,s)},m(s,C){l(s,i,C),l(s,p,C),y(h,s,C),u=!0},p:et,i(s){u||(v(h.$$.fragment,s),u=!0)},o(s){T(h.$$.fragment,s),u=!1},d(s){s&&(t(i),t(p)),w(h,s)}}}function Ro(H){let i,$=`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(){i=o("p"),i.innerHTML=$},l(p){i=n(p,"P",{"data-svelte-h":!0}),g(i)!=="svelte-fincs2"&&(i.innerHTML=$)},m(p,h){l(p,i,h)},p:et,d(p){p&&t(i)}}}function So(H){let i,$="Example:",p,h,u;return h=new Ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVEh5YnJpZE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtaHlicmlkLWJhc2UtYml0LTM4NCUyMiklMEFtb2RlbCUyMCUzRCUyMFZpVEh5YnJpZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZ2aXQtaHlicmlkLWJhc2UtYml0LTM4NCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTHybridModel
<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;google/vit-hybrid-base-bit-384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTHybridModel.from_pretrained(<span class="hljs-string">&quot;google/vit-hybrid-base-bit-384&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">197</span>, <span class="hljs-number">768</span>]`,wrap:!1}}),{c(){i=o("p"),i.textContent=$,p=d(),b(h.$$.fragment)},l(s){i=n(s,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=$),p=c(s),_(h.$$.fragment,s)},m(s,C){l(s,i,C),l(s,p,C),y(h,s,C),u=!0},p:et,i(s){u||(v(h.$$.fragment,s),u=!0)},o(s){T(h.$$.fragment,s),u=!1},d(s){s&&(t(i),t(p)),w(h,s)}}}function Go(H){let i,$=`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(){i=o("p"),i.innerHTML=$},l(p){i=n(p,"P",{"data-svelte-h":!0}),g(i)!=="svelte-fincs2"&&(i.innerHTML=$)},m(p,h){l(p,i,h)},p:et,d(p){p&&t(i)}}}function Lo(H){let i,$="Example:",p,h,u;return h=new Ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpVEh5YnJpZEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnZpdC1oeWJyaWQtYmFzZS1iaXQtMzg0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVmlUSHlicmlkRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdml0LWh5YnJpZC1iYXNlLWJpdC0zODQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTHybridForImageClassification
<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;google/vit-hybrid-base-bit-384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTHybridForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/vit-hybrid-base-bit-384&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(){i=o("p"),i.textContent=$,p=d(),b(h.$$.fragment)},l(s){i=n(s,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=$),p=c(s),_(h.$$.fragment,s)},m(s,C){l(s,i,C),l(s,p,C),y(h,s,C),u=!0},p:et,i(s){u||(v(h.$$.fragment,s),u=!0)},o(s){T(h.$$.fragment,s),u=!1},d(s){s&&(t(i),t(p)),w(h,s)}}}function Ao(H){let i,$,p,h,u,s,C,ee,Ht,xe,Kt="Hybrid Vision Transformer (ViT Hybrid)",tt,j,W,Ge,te,Vt,He,eo="Overview",ot,oe,to=`The hybrid Vision Transformer (ViT) model was proposed in <a href="https://arxiv.org/abs/2010.11929" rel="nofollow">An Image is Worth 16x16 Words: Transformers for Image Recognition
at Scale</a> by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk
Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob
Uszkoreit, Neil Houlsby. It’s the first paper that successfully trains a Transformer encoder on ImageNet, attaining
very good results compared to familiar convolutional architectures. ViT hybrid is a slight variant of the <a href="vit">plain Vision Transformer</a>,
by leveraging a convolutional backbone (specifically, <a href="bit">BiT</a>) whose features are used as initial “tokens” for the Transformer.`,nt,ne,oo="The abstract from the paper is the following:",rt,re,no=`<em>While the Transformer architecture has become the de-facto standard for natural language processing tasks, its
applications to computer vision remain limited. In vision, attention is either applied in conjunction with
convolutional networks, or used to replace certain components of convolutional networks while keeping their overall
structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to
sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of
data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.),
Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring
substantially fewer computational resources to train.</em>`,at,ae,ro=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>. The original code (written in JAX) can be
found <a href="https://github.com/google-research/vision_transformer" rel="nofollow">here</a>.`,st,J,U,Le,se,It,Ve,ao="Resources",it,ie,so="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with ViT Hybrid.",lt,le,dt,de,io='<li><a href="/docs/transformers/v4.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridForImageClassification">ViTHybridForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',ct,ce,lo="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",mt,N,E,Ae,me,kt,Ie,co="ViTHybridConfig",pt,M,pe,zt,ke,mo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridModel">ViTHybridModel</a>. It is used to instantiate a ViT
Hybrid 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 ViT Hybrid
<a href="https://huggingface.co/google/vit-hybrid-base-bit-384" rel="nofollow">google/vit-hybrid-base-bit-384</a> architecture.`,jt,ze,po=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/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/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Jt,B,ht,F,R,qe,he,Nt,je,ho="ViTHybridImageProcessor",ft,k,fe,Ft,Je,fo="Constructs a ViT Hybrid image processor.",Pt,S,ge,Zt,Ne,go="Preprocess an image or batch of images.",gt,P,G,De,ue,Wt,Fe,uo="ViTHybridModel",ut,z,be,Ut,Pe,bo=`The bare ViT Hybrid 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.`,Et,V,_e,Bt,Ze,_o='The <a href="/docs/transformers/v4.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridModel">ViTHybridModel</a> forward method, overrides the <code>__call__</code> special method.',Rt,L,St,A,bt,Z,q,Ye,ye,Gt,We,yo="ViTHybridForImageClassification",_t,x,ve,Lt,Ue,vo=`ViT Hybrid 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.`,At,Ee,To=`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.`,qt,I,Te,Dt,Be,wo='The <a href="/docs/transformers/v4.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridForImageClassification">ViTHybridForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Yt,D,Xt,Y,yt,Xe,vt;return ee=new Me({}),te=new Me({}),se=new Me({}),le=new Eo({props:{pipeline:"image-classification"}}),me=new Me({}),pe=new Ce({props:{name:"class transformers.ViTHybridConfig",anchor:"transformers.ViTHybridConfig",parameters:[{name:"backbone_config",val:" = None"},{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:" = 1"},{name:"num_channels",val:" = 3"},{name:"backbone_featmap_shape",val:" = [1, 1024, 24, 24]"},{name:"qkv_bias",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.ViTHybridConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.ViTHybridConfig.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.ViTHybridConfig.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.ViTHybridConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>Union[Dict[str, Any], PretrainedConfig]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The configuration of the backbone in a dictionary or the config object of the backbone.`,name:"backbone_config"},{anchor:"transformers.ViTHybridConfig.backbone_featmap_shape",description:`<strong>backbone_featmap_shape</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1024, 24, 24]</code>) &#x2014;
Used only for the <code>hybrid</code> embedding type. The shape of the feature maps of the backbone.`,name:"backbone_featmap_shape"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py#L32"}}),B=new Qt({props:{anchor:"transformers.ViTHybridConfig.example",$$slots:{default:[Bo]},$$scope:{ctx:H}}}),he=new Me({}),fe=new Ce({props:{name:"class transformers.ViTHybridImageProcessor",anchor:"transformers.ViTHybridImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{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:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTHybridImageProcessor.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 the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ViTHybridImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.ViTHybridImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <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 the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ViTHybridImageProcessor.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 to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.ViTHybridImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.ViTHybridImageProcessor.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 <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ViTHybridImageProcessor.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 <code>rescale_factor</code> in the <code>preprocess</code>
method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ViTHybridImageProcessor.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.ViTHybridImageProcessor.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.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ViTHybridImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/vit_hybrid/image_processing_vit_hybrid.py#L50"}}),ge=new Ce({props:{name:"preprocess",anchor:"transformers.ViTHybridImageProcessor.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:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": 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:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTHybridImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ViTHybridImageProcessor.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.ViTHybridImageProcessor.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 resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.ViTHybridImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ViTHybridImageProcessor.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.ViTHybridImageProcessor.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 center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.ViTHybridImageProcessor.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.`,name:"do_rescale"},{anchor:"transformers.ViTHybridImageProcessor.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.ViTHybridImageProcessor.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.ViTHybridImageProcessor.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 to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ViTHybridImageProcessor.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 to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ViTHybridImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ViTHybridImageProcessor.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>Unset: 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.ViTHybridImageProcessor.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>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.ViTHybridImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/vit_hybrid/image_processing_vit_hybrid.py#L165"}}),ue=new Me({}),be=new Ce({props:{name:"class transformers.ViTHybridModel",anchor:"transformers.ViTHybridModel",parameters:[{name:"config",val:": ViTHybridConfig"},{name:"add_pooling_layer",val:": bool = True"},{name:"use_mask_token",val:": bool = False"}],parametersDescription:[{anchor:"transformers.ViTHybridModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridConfig">ViTHybridConfig</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.34.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.34.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L533"}}),_e=new Ce({props:{name:"forward",anchor:"transformers.ViTHybridModel.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:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTHybridModel.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ViTHybridImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViTHybridModel.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.ViTHybridModel.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.ViTHybridModel.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.ViTHybridModel.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViTHybridModel.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.34.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L558",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.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.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridConfig"
>ViTHybridConfig</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>) — 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>) — 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>) — 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.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),L=new No({props:{$$slots:{default:[Ro]},$$scope:{ctx:H}}}),A=new Qt({props:{anchor:"transformers.ViTHybridModel.forward.example",$$slots:{default:[So]},$$scope:{ctx:H}}}),ye=new Me({}),ve=new Ce({props:{name:"class transformers.ViTHybridForImageClassification",anchor:"transformers.ViTHybridForImageClassification",parameters:[{name:"config",val:": ViTHybridConfig"}],parametersDescription:[{anchor:"transformers.ViTHybridForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridConfig">ViTHybridConfig</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.34.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.34.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L652"}}),Te=new Ce({props:{name:"forward",anchor:"transformers.ViTHybridForImageClassification.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:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTHybridForImageClassification.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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ViTHybridImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViTHybridForImageClassification.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.ViTHybridForImageClassification.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.ViTHybridForImageClassification.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.ViTHybridForImageClassification.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViTHybridForImageClassification.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.34.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L665",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.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.34.0/en/model_doc/vit_hybrid#transformers.ViTHybridConfig"
>ViTHybridConfig</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) — 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>) — 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>) — 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>) — 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.34.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new No({props:{$$slots:{default:[Go]},$$scope:{ctx:H}}}),Y=new Qt({props:{anchor:"transformers.ViTHybridForImageClassification.forward.example",$$slots:{default:[Lo]},$$scope:{ctx:H}}}),{c(){i=o("meta"),$=d(),p=o("p"),h=d(),u=o("h1"),s=o("a"),C=o("span"),b(ee.$$.fragment),Ht=d(),xe=o("span"),xe.textContent=Kt,tt=d(),j=o("h2"),W=o("a"),Ge=o("span"),b(te.$$.fragment),Vt=d(),He=o("span"),He.textContent=eo,ot=d(),oe=o("p"),oe.innerHTML=to,nt=d(),ne=o("p"),ne.textContent=oo,rt=d(),re=o("p"),re.innerHTML=no,at=d(),ae=o("p"),ae.innerHTML=ro,st=d(),J=o("h2"),U=o("a"),Le=o("span"),b(se.$$.fragment),It=d(),Ve=o("span"),Ve.textContent=ao,it=d(),ie=o("p"),ie.textContent=so,lt=d(),b(le.$$.fragment),dt=d(),de=o("ul"),de.innerHTML=io,ct=d(),ce=o("p"),ce.textContent=lo,mt=d(),N=o("h2"),E=o("a"),Ae=o("span"),b(me.$$.fragment),kt=d(),Ie=o("span"),Ie.textContent=co,pt=d(),M=o("div"),b(pe.$$.fragment),zt=d(),ke=o("p"),ke.innerHTML=mo,jt=d(),ze=o("p"),ze.innerHTML=po,Jt=d(),b(B.$$.fragment),ht=d(),F=o("h2"),R=o("a"),qe=o("span"),b(he.$$.fragment),Nt=d(),je=o("span"),je.textContent=ho,ft=d(),k=o("div"),b(fe.$$.fragment),Ft=d(),Je=o("p"),Je.textContent=fo,Pt=d(),S=o("div"),b(ge.$$.fragment),Zt=d(),Ne=o("p"),Ne.textContent=go,gt=d(),P=o("h2"),G=o("a"),De=o("span"),b(ue.$$.fragment),Wt=d(),Fe=o("span"),Fe.textContent=uo,ut=d(),z=o("div"),b(be.$$.fragment),Ut=d(),Pe=o("p"),Pe.innerHTML=bo,Et=d(),V=o("div"),b(_e.$$.fragment),Bt=d(),Ze=o("p"),Ze.innerHTML=_o,Rt=d(),b(L.$$.fragment),St=d(),b(A.$$.fragment),bt=d(),Z=o("h2"),q=o("a"),Ye=o("span"),b(ye.$$.fragment),Gt=d(),We=o("span"),We.textContent=yo,_t=d(),x=o("div"),b(ve.$$.fragment),Lt=d(),Ue=o("p"),Ue.textContent=vo,At=d(),Ee=o("p"),Ee.innerHTML=To,qt=d(),I=o("div"),b(Te.$$.fragment),Dt=d(),Be=o("p"),Be.innerHTML=wo,Yt=d(),b(D.$$.fragment),Xt=d(),b(Y.$$.fragment),yt=d(),Xe=o("p"),this.h()},l(e){const a=Uo("svelte-1phssyn",document.head);i=n(a,"META",{name:!0,content:!0}),a.forEach(t),$=c(e),p=n(e,"P",{}),f(p).forEach(t),h=c(e),u=n(e,"H1",{class:!0});var we=f(u);s=n(we,"A",{id:!0,class:!0,href:!0});var Qe=f(s);C=n(Qe,"SPAN",{});var Oe=f(C);_(ee.$$.fragment,Oe),Oe.forEach(t),Qe.forEach(t),Ht=c(we),xe=n(we,"SPAN",{"data-svelte-h":!0}),g(xe)!=="svelte-1c6ippe"&&(xe.textContent=Kt),we.forEach(t),tt=c(e),j=n(e,"H2",{class:!0});var $e=f(j);W=n($e,"A",{id:!0,class:!0,href:!0});var Ke=f(W);Ge=n(Ke,"SPAN",{});var $o=f(Ge);_(te.$$.fragment,$o),$o.forEach(t),Ke.forEach(t),Vt=c($e),He=n($e,"SPAN",{"data-svelte-h":!0}),g(He)!=="svelte-1jsw1pg"&&(He.textContent=eo),$e.forEach(t),ot=c(e),oe=n(e,"P",{"data-svelte-h":!0}),g(oe)!=="svelte-6697c1"&&(oe.innerHTML=to),nt=c(e),ne=n(e,"P",{"data-svelte-h":!0}),g(ne)!=="svelte-vfdo9a"&&(ne.textContent=oo),rt=c(e),re=n(e,"P",{"data-svelte-h":!0}),g(re)!=="svelte-yjj3f8"&&(re.innerHTML=no),at=c(e),ae=n(e,"P",{"data-svelte-h":!0}),g(ae)!=="svelte-pwnwoc"&&(ae.innerHTML=ro),st=c(e),J=n(e,"H2",{class:!0});var Tt=f(J);U=n(Tt,"A",{id:!0,class:!0,href:!0});var Co=f(U);Le=n(Co,"SPAN",{});var Mo=f(Le);_(se.$$.fragment,Mo),Mo.forEach(t),Co.forEach(t),It=c(Tt),Ve=n(Tt,"SPAN",{"data-svelte-h":!0}),g(Ve)!=="svelte-w4zzv6"&&(Ve.textContent=ao),Tt.forEach(t),it=c(e),ie=n(e,"P",{"data-svelte-h":!0}),g(ie)!=="svelte-rhht3g"&&(ie.textContent=so),lt=c(e),_(le.$$.fragment,e),dt=c(e),de=n(e,"UL",{"data-svelte-h":!0}),g(de)!=="svelte-189tgqf"&&(de.innerHTML=io),ct=c(e),ce=n(e,"P",{"data-svelte-h":!0}),g(ce)!=="svelte-1xesile"&&(ce.textContent=lo),mt=c(e),N=n(e,"H2",{class:!0});var wt=f(N);E=n(wt,"A",{id:!0,class:!0,href:!0});var xo=f(E);Ae=n(xo,"SPAN",{});var Ho=f(Ae);_(me.$$.fragment,Ho),Ho.forEach(t),xo.forEach(t),kt=c(wt),Ie=n(wt,"SPAN",{"data-svelte-h":!0}),g(Ie)!=="svelte-15cbpa4"&&(Ie.textContent=co),wt.forEach(t),pt=c(e),M=n(e,"DIV",{class:!0});var X=f(M);_(pe.$$.fragment,X),zt=c(X),ke=n(X,"P",{"data-svelte-h":!0}),g(ke)!=="svelte-1c9w54f"&&(ke.innerHTML=mo),jt=c(X),ze=n(X,"P",{"data-svelte-h":!0}),g(ze)!=="svelte-10kqkkl"&&(ze.innerHTML=po),Jt=c(X),_(B.$$.fragment,X),X.forEach(t),ht=c(e),F=n(e,"H2",{class:!0});var $t=f(F);R=n($t,"A",{id:!0,class:!0,href:!0});var Vo=f(R);qe=n(Vo,"SPAN",{});var Io=f(qe);_(he.$$.fragment,Io),Io.forEach(t),Vo.forEach(t),Nt=c($t),je=n($t,"SPAN",{"data-svelte-h":!0}),g(je)!=="svelte-1qwsbeh"&&(je.textContent=ho),$t.forEach(t),ft=c(e),k=n(e,"DIV",{class:!0});var Re=f(k);_(fe.$$.fragment,Re),Ft=c(Re),Je=n(Re,"P",{"data-svelte-h":!0}),g(Je)!=="svelte-p40nh7"&&(Je.textContent=fo),Pt=c(Re),S=n(Re,"DIV",{class:!0});var Ct=f(S);_(ge.$$.fragment,Ct),Zt=c(Ct),Ne=n(Ct,"P",{"data-svelte-h":!0}),g(Ne)!=="svelte-1x3yxsa"&&(Ne.textContent=go),Ct.forEach(t),Re.forEach(t),gt=c(e),P=n(e,"H2",{class:!0});var Mt=f(P);G=n(Mt,"A",{id:!0,class:!0,href:!0});var ko=f(G);De=n(ko,"SPAN",{});var zo=f(De);_(ue.$$.fragment,zo),zo.forEach(t),ko.forEach(t),Wt=c(Mt),Fe=n(Mt,"SPAN",{"data-svelte-h":!0}),g(Fe)!=="svelte-1rui1rb"&&(Fe.textContent=uo),Mt.forEach(t),ut=c(e),z=n(e,"DIV",{class:!0});var Se=f(z);_(be.$$.fragment,Se),Ut=c(Se),Pe=n(Se,"P",{"data-svelte-h":!0}),g(Pe)!=="svelte-9dwrv6"&&(Pe.innerHTML=bo),Et=c(Se),V=n(Se,"DIV",{class:!0});var Q=f(V);_(_e.$$.fragment,Q),Bt=c(Q),Ze=n(Q,"P",{"data-svelte-h":!0}),g(Ze)!=="svelte-1gymm3"&&(Ze.innerHTML=_o),Rt=c(Q),_(L.$$.fragment,Q),St=c(Q),_(A.$$.fragment,Q),Q.forEach(t),Se.forEach(t),bt=c(e),Z=n(e,"H2",{class:!0});var xt=f(Z);q=n(xt,"A",{id:!0,class:!0,href:!0});var jo=f(q);Ye=n(jo,"SPAN",{});var Jo=f(Ye);_(ye.$$.fragment,Jo),Jo.forEach(t),jo.forEach(t),Gt=c(xt),We=n(xt,"SPAN",{"data-svelte-h":!0}),g(We)!=="svelte-2n975a"&&(We.textContent=yo),xt.forEach(t),_t=c(e),x=n(e,"DIV",{class:!0});var O=f(x);_(ve.$$.fragment,O),Lt=c(O),Ue=n(O,"P",{"data-svelte-h":!0}),g(Ue)!=="svelte-hvti62"&&(Ue.textContent=vo),At=c(O),Ee=n(O,"P",{"data-svelte-h":!0}),g(Ee)!=="svelte-1gjh92c"&&(Ee.innerHTML=To),qt=c(O),I=n(O,"DIV",{class:!0});var K=f(I);_(Te.$$.fragment,K),Dt=c(K),Be=n(K,"P",{"data-svelte-h":!0}),g(Be)!=="svelte-v0d34n"&&(Be.innerHTML=wo),Yt=c(K),_(D.$$.fragment,K),Xt=c(K),_(Y.$$.fragment,K),K.forEach(t),O.forEach(t),yt=c(e),Xe=n(e,"P",{}),f(Xe).forEach(t),this.h()},h(){m(i,"name","hf:doc:metadata"),m(i,"content",JSON.stringify(qo)),m(s,"id","hybrid-vision-transformer-vit-hybrid"),m(s,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(s,"href","#hybrid-vision-transformer-vit-hybrid"),m(u,"class","relative group"),m(W,"id","overview"),m(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(W,"href","#overview"),m(j,"class","relative group"),m(U,"id","resources"),m(U,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(U,"href","#resources"),m(J,"class","relative group"),m(E,"id","transformers.ViTHybridConfig"),m(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(E,"href","#transformers.ViTHybridConfig"),m(N,"class","relative group"),m(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(R,"id","transformers.ViTHybridImageProcessor"),m(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(R,"href","#transformers.ViTHybridImageProcessor"),m(F,"class","relative group"),m(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(G,"id","transformers.ViTHybridModel"),m(G,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(G,"href","#transformers.ViTHybridModel"),m(P,"class","relative group"),m(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(q,"id","transformers.ViTHybridForImageClassification"),m(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(q,"href","#transformers.ViTHybridForImageClassification"),m(Z,"class","relative group"),m(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,a){r(document.head,i),l(e,$,a),l(e,p,a),l(e,h,a),l(e,u,a),r(u,s),r(s,C),y(ee,C,null),r(u,Ht),r(u,xe),l(e,tt,a),l(e,j,a),r(j,W),r(W,Ge),y(te,Ge,null),r(j,Vt),r(j,He),l(e,ot,a),l(e,oe,a),l(e,nt,a),l(e,ne,a),l(e,rt,a),l(e,re,a),l(e,at,a),l(e,ae,a),l(e,st,a),l(e,J,a),r(J,U),r(U,Le),y(se,Le,null),r(J,It),r(J,Ve),l(e,it,a),l(e,ie,a),l(e,lt,a),y(le,e,a),l(e,dt,a),l(e,de,a),l(e,ct,a),l(e,ce,a),l(e,mt,a),l(e,N,a),r(N,E),r(E,Ae),y(me,Ae,null),r(N,kt),r(N,Ie),l(e,pt,a),l(e,M,a),y(pe,M,null),r(M,zt),r(M,ke),r(M,jt),r(M,ze),r(M,Jt),y(B,M,null),l(e,ht,a),l(e,F,a),r(F,R),r(R,qe),y(he,qe,null),r(F,Nt),r(F,je),l(e,ft,a),l(e,k,a),y(fe,k,null),r(k,Ft),r(k,Je),r(k,Pt),r(k,S),y(ge,S,null),r(S,Zt),r(S,Ne),l(e,gt,a),l(e,P,a),r(P,G),r(G,De),y(ue,De,null),r(P,Wt),r(P,Fe),l(e,ut,a),l(e,z,a),y(be,z,null),r(z,Ut),r(z,Pe),r(z,Et),r(z,V),y(_e,V,null),r(V,Bt),r(V,Ze),r(V,Rt),y(L,V,null),r(V,St),y(A,V,null),l(e,bt,a),l(e,Z,a),r(Z,q),r(q,Ye),y(ye,Ye,null),r(Z,Gt),r(Z,We),l(e,_t,a),l(e,x,a),y(ve,x,null),r(x,Lt),r(x,Ue),r(x,At),r(x,Ee),r(x,qt),r(x,I),y(Te,I,null),r(I,Dt),r(I,Be),r(I,Yt),y(D,I,null),r(I,Xt),y(Y,I,null),l(e,yt,a),l(e,Xe,a),vt=!0},p(e,[a]){const we={};a&2&&(we.$$scope={dirty:a,ctx:e}),B.$set(we);const Qe={};a&2&&(Qe.$$scope={dirty:a,ctx:e}),L.$set(Qe);const Oe={};a&2&&(Oe.$$scope={dirty:a,ctx:e}),A.$set(Oe);const $e={};a&2&&($e.$$scope={dirty:a,ctx:e}),D.$set($e);const Ke={};a&2&&(Ke.$$scope={dirty:a,ctx:e}),Y.$set(Ke)},i(e){vt||(v(ee.$$.fragment,e),v(te.$$.fragment,e),v(se.$$.fragment,e),v(le.$$.fragment,e),v(me.$$.fragment,e),v(pe.$$.fragment,e),v(B.$$.fragment,e),v(he.$$.fragment,e),v(fe.$$.fragment,e),v(ge.$$.fragment,e),v(ue.$$.fragment,e),v(be.$$.fragment,e),v(_e.$$.fragment,e),v(L.$$.fragment,e),v(A.$$.fragment,e),v(ye.$$.fragment,e),v(ve.$$.fragment,e),v(Te.$$.fragment,e),v(D.$$.fragment,e),v(Y.$$.fragment,e),vt=!0)},o(e){T(ee.$$.fragment,e),T(te.$$.fragment,e),T(se.$$.fragment,e),T(le.$$.fragment,e),T(me.$$.fragment,e),T(pe.$$.fragment,e),T(B.$$.fragment,e),T(he.$$.fragment,e),T(fe.$$.fragment,e),T(ge.$$.fragment,e),T(ue.$$.fragment,e),T(be.$$.fragment,e),T(_e.$$.fragment,e),T(L.$$.fragment,e),T(A.$$.fragment,e),T(ye.$$.fragment,e),T(ve.$$.fragment,e),T(Te.$$.fragment,e),T(D.$$.fragment,e),T(Y.$$.fragment,e),vt=!1},d(e){e&&(t($),t(p),t(h),t(u),t(tt),t(j),t(ot),t(oe),t(nt),t(ne),t(rt),t(re),t(at),t(ae),t(st),t(J),t(it),t(ie),t(lt),t(dt),t(de),t(ct),t(ce),t(mt),t(N),t(pt),t(M),t(ht),t(F),t(ft),t(k),t(gt),t(P),t(ut),t(z),t(bt),t(Z),t(_t),t(x),t(yt),t(Xe)),t(i),w(ee),w(te),w(se),w(le,e),w(me),w(pe),w(B),w(he),w(fe),w(ge),w(ue),w(be),w(_e),w(L),w(A),w(ye),w(ve),w(Te),w(D),w(Y)}}}const qo={local:"hybrid-vision-transformer-vit-hybrid",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ViTHybridConfig",title:"ViTHybridConfig"},{local:"transformers.ViTHybridImageProcessor",title:"ViTHybridImageProcessor"},{local:"transformers.ViTHybridModel",title:"ViTHybridModel"},{local:"transformers.ViTHybridForImageClassification",title:"ViTHybridForImageClassification"}],title:"Hybrid Vision Transformer (ViT Hybrid)"};function Do(H){return Po(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class nn extends Zo{constructor(i){super(),Wo(this,i,Do,Ao,Fo,{})}}export{nn as component};
