import{S as Ga,i as Da,s as qa,e as r,k as m,w as v,t as s,M as Ya,c as a,d as t,m as p,a as n,x as T,h as i,b as d,G as o,g as f,y as w,q as $,o as V,B as M,v as Xa,L as Xr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Sa}from"../../chunks/Tip-hf-doc-builder.js";import{D as he}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Lr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Re}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Yr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as La}from"../../chunks/PipelineTag-hf-doc-builder.js";function Qa(k){let h,y,b,g,_;return g=new Lr({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`}}),{c(){h=r("p"),y=s("Example:"),b=m(),v(g.$$.fragment)},l(l){h=a(l,"P",{});var u=n(h);y=i(u,"Example:"),u.forEach(t),b=p(l),T(g.$$.fragment,l)},m(l,u){f(l,h,u),o(h,y),f(l,b,u),w(g,l,u),_=!0},p:Xr,i(l){_||($(g.$$.fragment,l),_=!0)},o(l){V(g.$$.fragment,l),_=!1},d(l){l&&t(h),l&&t(b),M(g,l)}}}function Oa(k){let h,y,b,g,_;return{c(){h=r("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=r("code"),g=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=n(h);y=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(u,"CODE",{});var x=n(b);g=i(x,"Module"),x.forEach(t),_=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),o(h,y),o(h,b),o(b,g),o(h,_)},d(l){l&&t(h)}}}function Ka(k){let h,y,b,g,_;return g=new Lr({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>]`}}),{c(){h=r("p"),y=s("Example:"),b=m(),v(g.$$.fragment)},l(l){h=a(l,"P",{});var u=n(h);y=i(u,"Example:"),u.forEach(t),b=p(l),T(g.$$.fragment,l)},m(l,u){f(l,h,u),o(h,y),f(l,b,u),w(g,l,u),_=!0},p:Xr,i(l){_||($(g.$$.fragment,l),_=!0)},o(l){V(g.$$.fragment,l),_=!1},d(l){l&&t(h),l&&t(b),M(g,l)}}}function en(k){let h,y,b,g,_;return{c(){h=r("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=r("code"),g=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=n(h);y=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=a(u,"CODE",{});var x=n(b);g=i(x,"Module"),x.forEach(t),_=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),o(h,y),o(h,b),o(b,g),o(h,_)},d(l){l&&t(h)}}}function on(k){let h,y,b,g,_;return g=new Lr({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`}}),{c(){h=r("p"),y=s("Example:"),b=m(),v(g.$$.fragment)},l(l){h=a(l,"P",{});var u=n(h);y=i(u,"Example:"),u.forEach(t),b=p(l),T(g.$$.fragment,l)},m(l,u){f(l,h,u),o(h,y),f(l,b,u),w(g,l,u),_=!0},p:Xr,i(l){_||($(g.$$.fragment,l),_=!0)},o(l){V(g.$$.fragment,l),_=!1},d(l){l&&t(h),l&&t(b),M(g,l)}}}function tn(k){let h,y,b,g,_,l,u,x,ct,Po,W,X,ho,fe,mt,fo,pt,No,C,ht,ge,ft,gt,Be,ut,bt,Se,_t,yt,Fo,Ge,vt,Wo,De,go,Tt,Zo,P,wt,ue,$t,Vt,be,Mt,It,Uo,Z,L,uo,_e,Ht,bo,kt,Ao,qe,Ct,Ro,ye,Bo,Q,N,Ye,Et,zt,ve,xt,jt,Te,Jt,Pt,Nt,Xe,Ft,Le,Wt,So,Qe,Zt,Go,U,O,_o,we,Ut,yo,At,Do,I,$e,Rt,A,Bt,Oe,St,Gt,Ve,Dt,qt,Yt,R,Xt,Ke,Lt,Qt,eo,Ot,Kt,er,K,or,ee,Me,tr,B,rr,oo,ar,nr,vo,sr,ir,qo,S,oe,To,Ie,lr,wo,dr,Yo,j,He,cr,$o,mr,pr,te,ke,hr,Vo,fr,Xo,G,re,Mo,Ce,gr,Io,ur,Lo,J,Ee,br,ze,_r,xe,yr,vr,Tr,E,je,wr,D,$r,to,Vr,Mr,Ho,Ir,Hr,kr,ae,Cr,ne,Qo,q,se,ko,Je,Er,Co,zr,Oo,H,Pe,xr,Eo,jr,Jr,Ne,Pr,Fe,Nr,Fr,Wr,z,We,Zr,Y,Ur,ro,Ar,Rr,zo,Br,Sr,Gr,ie,Dr,le,Ko;return l=new Re({}),fe=new Re({}),_e=new Re({}),ye=new La({props:{pipeline:"image-classification"}}),we=new Re({}),$e=new he({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.31.0/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py#L34"}}),K=new Yr({props:{anchor:"transformers.ViTHybridConfig.example",$$slots:{default:[Qa]},$$scope:{ctx:k}}}),Me=new he({props:{name:"to_dict",anchor:"transformers.ViTHybridConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py#L150"}}),Ie=new Re({}),He=new he({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;
Image standard deviation.`,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;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/vit_hybrid/image_processing_vit_hybrid.py#L51"}}),ke=new he({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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTHybridImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/vit_hybrid/image_processing_vit_hybrid.py#L219"}}),Ce=new Re({}),Ee=new he({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.31.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.31.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.31.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L533"}}),je=new he({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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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.31.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.31.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L558",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ae=new Sa({props:{$$slots:{default:[Oa]},$$scope:{ctx:k}}}),ne=new Yr({props:{anchor:"transformers.ViTHybridModel.forward.example",$$slots:{default:[Ka]},$$scope:{ctx:k}}}),Je=new Re({}),Pe=new he({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.31.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.31.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.31.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L652"}}),We=new he({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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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.31.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.31.0/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py#L665",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ie=new Sa({props:{$$slots:{default:[en]},$$scope:{ctx:k}}}),le=new Yr({props:{anchor:"transformers.ViTHybridForImageClassification.forward.example",$$slots:{default:[on]},$$scope:{ctx:k}}}),{c(){h=r("meta"),y=m(),b=r("h1"),g=r("a"),_=r("span"),v(l.$$.fragment),u=m(),x=r("span"),ct=s("Hybrid Vision Transformer (ViT Hybrid)"),Po=m(),W=r("h2"),X=r("a"),ho=r("span"),v(fe.$$.fragment),mt=m(),fo=r("span"),pt=s("Overview"),No=m(),C=r("p"),ht=s("The hybrid Vision Transformer (ViT) model was proposed in "),ge=r("a"),ft=s(`An Image is Worth 16x16 Words: Transformers for Image Recognition
at Scale`),gt=s(` 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\u2019s 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 `),Be=r("a"),ut=s("plain Vision Transformer"),bt=s(`,
by leveraging a convolutional backbone (specifically, `),Se=r("a"),_t=s("BiT"),yt=s(") whose features are used as initial \u201Ctokens\u201D for the Transformer."),Fo=m(),Ge=r("p"),vt=s("The abstract from the paper is the following:"),Wo=m(),De=r("p"),go=r("em"),Tt=s(`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.`),Zo=m(),P=r("p"),wt=s("This model was contributed by "),ue=r("a"),$t=s("nielsr"),Vt=s(`. The original code (written in JAX) can be
found `),be=r("a"),Mt=s("here"),It=s("."),Uo=m(),Z=r("h2"),L=r("a"),uo=r("span"),v(_e.$$.fragment),Ht=m(),bo=r("span"),kt=s("Resources"),Ao=m(),qe=r("p"),Ct=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT Hybrid."),Ro=m(),v(ye.$$.fragment),Bo=m(),Q=r("ul"),N=r("li"),Ye=r("a"),Et=s("ViTHybridForImageClassification"),zt=s(" is supported by this "),ve=r("a"),xt=s("example script"),jt=s(" and "),Te=r("a"),Jt=s("notebook"),Pt=s("."),Nt=m(),Xe=r("li"),Ft=s("See also: "),Le=r("a"),Wt=s("Image classification task guide"),So=m(),Qe=r("p"),Zt=s("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Go=m(),U=r("h2"),O=r("a"),_o=r("span"),v(we.$$.fragment),Ut=m(),yo=r("span"),At=s("ViTHybridConfig"),Do=m(),I=r("div"),v($e.$$.fragment),Rt=m(),A=r("p"),Bt=s("This is the configuration class to store the configuration of a "),Oe=r("a"),St=s("ViTHybridModel"),Gt=s(`. 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
`),Ve=r("a"),Dt=s("google/vit-hybrid-base-bit-384"),qt=s(" architecture."),Yt=m(),R=r("p"),Xt=s("Configuration objects inherit from "),Ke=r("a"),Lt=s("PretrainedConfig"),Qt=s(` and can be used to control the model outputs. Read the
documentation from `),eo=r("a"),Ot=s("PretrainedConfig"),Kt=s(" for more information."),er=m(),v(K.$$.fragment),or=m(),ee=r("div"),v(Me.$$.fragment),tr=m(),B=r("p"),rr=s("Serializes this instance to a Python dictionary. Override the default "),oo=r("a"),ar=s("to_dict()"),nr=s(`. Returns:
`),vo=r("code"),sr=s("Dict[str, any]"),ir=s(": Dictionary of all the attributes that make up this configuration instance,"),qo=m(),S=r("h2"),oe=r("a"),To=r("span"),v(Ie.$$.fragment),lr=m(),wo=r("span"),dr=s("ViTHybridImageProcessor"),Yo=m(),j=r("div"),v(He.$$.fragment),cr=m(),$o=r("p"),mr=s("Constructs a ViT Hybrid image processor."),pr=m(),te=r("div"),v(ke.$$.fragment),hr=m(),Vo=r("p"),fr=s("Preprocess an image or batch of images."),Xo=m(),G=r("h2"),re=r("a"),Mo=r("span"),v(Ce.$$.fragment),gr=m(),Io=r("span"),ur=s("ViTHybridModel"),Lo=m(),J=r("div"),v(Ee.$$.fragment),br=m(),ze=r("p"),_r=s(`The bare ViT Hybrid Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),xe=r("a"),yr=s("torch.nn.Module"),vr=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tr=m(),E=r("div"),v(je.$$.fragment),wr=m(),D=r("p"),$r=s("The "),to=r("a"),Vr=s("ViTHybridModel"),Mr=s(" forward method, overrides the "),Ho=r("code"),Ir=s("__call__"),Hr=s(" special method."),kr=m(),v(ae.$$.fragment),Cr=m(),v(ne.$$.fragment),Qo=m(),q=r("h2"),se=r("a"),ko=r("span"),v(Je.$$.fragment),Er=m(),Co=r("span"),zr=s("ViTHybridForImageClassification"),Oo=m(),H=r("div"),v(Pe.$$.fragment),xr=m(),Eo=r("p"),jr=s(`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.`),Jr=m(),Ne=r("p"),Pr=s("This model is a PyTorch "),Fe=r("a"),Nr=s("torch.nn.Module"),Fr=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wr=m(),z=r("div"),v(We.$$.fragment),Zr=m(),Y=r("p"),Ur=s("The "),ro=r("a"),Ar=s("ViTHybridForImageClassification"),Rr=s(" forward method, overrides the "),zo=r("code"),Br=s("__call__"),Sr=s(" special method."),Gr=m(),v(ie.$$.fragment),Dr=m(),v(le.$$.fragment),this.h()},l(e){const c=Ya('[data-svelte="svelte-1phssyn"]',document.head);h=a(c,"META",{name:!0,content:!0}),c.forEach(t),y=p(e),b=a(e,"H1",{class:!0});var Ze=n(b);g=a(Ze,"A",{id:!0,class:!0,href:!0});var xo=n(g);_=a(xo,"SPAN",{});var jo=n(_);T(l.$$.fragment,jo),jo.forEach(t),xo.forEach(t),u=p(Ze),x=a(Ze,"SPAN",{});var Jo=n(x);ct=i(Jo,"Hybrid Vision Transformer (ViT Hybrid)"),Jo.forEach(t),Ze.forEach(t),Po=p(e),W=a(e,"H2",{class:!0});var Ue=n(W);X=a(Ue,"A",{id:!0,class:!0,href:!0});var Qr=n(X);ho=a(Qr,"SPAN",{});var Or=n(ho);T(fe.$$.fragment,Or),Or.forEach(t),Qr.forEach(t),mt=p(Ue),fo=a(Ue,"SPAN",{});var Kr=n(fo);pt=i(Kr,"Overview"),Kr.forEach(t),Ue.forEach(t),No=p(e),C=a(e,"P",{});var de=n(C);ht=i(de,"The hybrid Vision Transformer (ViT) model was proposed in "),ge=a(de,"A",{href:!0,rel:!0});var ea=n(ge);ft=i(ea,`An Image is Worth 16x16 Words: Transformers for Image Recognition
at Scale`),ea.forEach(t),gt=i(de,` 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\u2019s 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 `),Be=a(de,"A",{href:!0});var oa=n(Be);ut=i(oa,"plain Vision Transformer"),oa.forEach(t),bt=i(de,`,
by leveraging a convolutional backbone (specifically, `),Se=a(de,"A",{href:!0});var ta=n(Se);_t=i(ta,"BiT"),ta.forEach(t),yt=i(de,") whose features are used as initial \u201Ctokens\u201D for the Transformer."),de.forEach(t),Fo=p(e),Ge=a(e,"P",{});var ra=n(Ge);vt=i(ra,"The abstract from the paper is the following:"),ra.forEach(t),Wo=p(e),De=a(e,"P",{});var aa=n(De);go=a(aa,"EM",{});var na=n(go);Tt=i(na,`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.`),na.forEach(t),aa.forEach(t),Zo=p(e),P=a(e,"P",{});var ao=n(P);wt=i(ao,"This model was contributed by "),ue=a(ao,"A",{href:!0,rel:!0});var sa=n(ue);$t=i(sa,"nielsr"),sa.forEach(t),Vt=i(ao,`. The original code (written in JAX) can be
found `),be=a(ao,"A",{href:!0,rel:!0});var ia=n(be);Mt=i(ia,"here"),ia.forEach(t),It=i(ao,"."),ao.forEach(t),Uo=p(e),Z=a(e,"H2",{class:!0});var et=n(Z);L=a(et,"A",{id:!0,class:!0,href:!0});var la=n(L);uo=a(la,"SPAN",{});var da=n(uo);T(_e.$$.fragment,da),da.forEach(t),la.forEach(t),Ht=p(et),bo=a(et,"SPAN",{});var ca=n(bo);kt=i(ca,"Resources"),ca.forEach(t),et.forEach(t),Ao=p(e),qe=a(e,"P",{});var ma=n(qe);Ct=i(ma,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT Hybrid."),ma.forEach(t),Ro=p(e),T(ye.$$.fragment,e),Bo=p(e),Q=a(e,"UL",{});var ot=n(Q);N=a(ot,"LI",{});var Ae=n(N);Ye=a(Ae,"A",{href:!0});var pa=n(Ye);Et=i(pa,"ViTHybridForImageClassification"),pa.forEach(t),zt=i(Ae," is supported by this "),ve=a(Ae,"A",{href:!0,rel:!0});var ha=n(ve);xt=i(ha,"example script"),ha.forEach(t),jt=i(Ae," and "),Te=a(Ae,"A",{href:!0,rel:!0});var fa=n(Te);Jt=i(fa,"notebook"),fa.forEach(t),Pt=i(Ae,"."),Ae.forEach(t),Nt=p(ot),Xe=a(ot,"LI",{});var qr=n(Xe);Ft=i(qr,"See also: "),Le=a(qr,"A",{href:!0});var ga=n(Le);Wt=i(ga,"Image classification task guide"),ga.forEach(t),qr.forEach(t),ot.forEach(t),So=p(e),Qe=a(e,"P",{});var ua=n(Qe);Zt=i(ua,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ua.forEach(t),Go=p(e),U=a(e,"H2",{class:!0});var tt=n(U);O=a(tt,"A",{id:!0,class:!0,href:!0});var ba=n(O);_o=a(ba,"SPAN",{});var _a=n(_o);T(we.$$.fragment,_a),_a.forEach(t),ba.forEach(t),Ut=p(tt),yo=a(tt,"SPAN",{});var ya=n(yo);At=i(ya,"ViTHybridConfig"),ya.forEach(t),tt.forEach(t),Do=p(e),I=a(e,"DIV",{class:!0});var F=n(I);T($e.$$.fragment,F),Rt=p(F),A=a(F,"P",{});var no=n(A);Bt=i(no,"This is the configuration class to store the configuration of a "),Oe=a(no,"A",{href:!0});var va=n(Oe);St=i(va,"ViTHybridModel"),va.forEach(t),Gt=i(no,`. 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
`),Ve=a(no,"A",{href:!0,rel:!0});var Ta=n(Ve);Dt=i(Ta,"google/vit-hybrid-base-bit-384"),Ta.forEach(t),qt=i(no," architecture."),no.forEach(t),Yt=p(F),R=a(F,"P",{});var so=n(R);Xt=i(so,"Configuration objects inherit from "),Ke=a(so,"A",{href:!0});var wa=n(Ke);Lt=i(wa,"PretrainedConfig"),wa.forEach(t),Qt=i(so,` and can be used to control the model outputs. Read the
documentation from `),eo=a(so,"A",{href:!0});var $a=n(eo);Ot=i($a,"PretrainedConfig"),$a.forEach(t),Kt=i(so," for more information."),so.forEach(t),er=p(F),T(K.$$.fragment,F),or=p(F),ee=a(F,"DIV",{class:!0});var rt=n(ee);T(Me.$$.fragment,rt),tr=p(rt),B=a(rt,"P",{});var io=n(B);rr=i(io,"Serializes this instance to a Python dictionary. Override the default "),oo=a(io,"A",{href:!0});var Va=n(oo);ar=i(Va,"to_dict()"),Va.forEach(t),nr=i(io,`. Returns:
`),vo=a(io,"CODE",{});var Ma=n(vo);sr=i(Ma,"Dict[str, any]"),Ma.forEach(t),ir=i(io,": Dictionary of all the attributes that make up this configuration instance,"),io.forEach(t),rt.forEach(t),F.forEach(t),qo=p(e),S=a(e,"H2",{class:!0});var at=n(S);oe=a(at,"A",{id:!0,class:!0,href:!0});var Ia=n(oe);To=a(Ia,"SPAN",{});var Ha=n(To);T(Ie.$$.fragment,Ha),Ha.forEach(t),Ia.forEach(t),lr=p(at),wo=a(at,"SPAN",{});var ka=n(wo);dr=i(ka,"ViTHybridImageProcessor"),ka.forEach(t),at.forEach(t),Yo=p(e),j=a(e,"DIV",{class:!0});var lo=n(j);T(He.$$.fragment,lo),cr=p(lo),$o=a(lo,"P",{});var Ca=n($o);mr=i(Ca,"Constructs a ViT Hybrid image processor."),Ca.forEach(t),pr=p(lo),te=a(lo,"DIV",{class:!0});var nt=n(te);T(ke.$$.fragment,nt),hr=p(nt),Vo=a(nt,"P",{});var Ea=n(Vo);fr=i(Ea,"Preprocess an image or batch of images."),Ea.forEach(t),nt.forEach(t),lo.forEach(t),Xo=p(e),G=a(e,"H2",{class:!0});var st=n(G);re=a(st,"A",{id:!0,class:!0,href:!0});var za=n(re);Mo=a(za,"SPAN",{});var xa=n(Mo);T(Ce.$$.fragment,xa),xa.forEach(t),za.forEach(t),gr=p(st),Io=a(st,"SPAN",{});var ja=n(Io);ur=i(ja,"ViTHybridModel"),ja.forEach(t),st.forEach(t),Lo=p(e),J=a(e,"DIV",{class:!0});var co=n(J);T(Ee.$$.fragment,co),br=p(co),ze=a(co,"P",{});var it=n(ze);_r=i(it,`The bare ViT Hybrid Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),xe=a(it,"A",{href:!0,rel:!0});var Ja=n(xe);yr=i(Ja,"torch.nn.Module"),Ja.forEach(t),vr=i(it,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),it.forEach(t),Tr=p(co),E=a(co,"DIV",{class:!0});var ce=n(E);T(je.$$.fragment,ce),wr=p(ce),D=a(ce,"P",{});var mo=n(D);$r=i(mo,"The "),to=a(mo,"A",{href:!0});var Pa=n(to);Vr=i(Pa,"ViTHybridModel"),Pa.forEach(t),Mr=i(mo," forward method, overrides the "),Ho=a(mo,"CODE",{});var Na=n(Ho);Ir=i(Na,"__call__"),Na.forEach(t),Hr=i(mo," special method."),mo.forEach(t),kr=p(ce),T(ae.$$.fragment,ce),Cr=p(ce),T(ne.$$.fragment,ce),ce.forEach(t),co.forEach(t),Qo=p(e),q=a(e,"H2",{class:!0});var lt=n(q);se=a(lt,"A",{id:!0,class:!0,href:!0});var Fa=n(se);ko=a(Fa,"SPAN",{});var Wa=n(ko);T(Je.$$.fragment,Wa),Wa.forEach(t),Fa.forEach(t),Er=p(lt),Co=a(lt,"SPAN",{});var Za=n(Co);zr=i(Za,"ViTHybridForImageClassification"),Za.forEach(t),lt.forEach(t),Oo=p(e),H=a(e,"DIV",{class:!0});var me=n(H);T(Pe.$$.fragment,me),xr=p(me),Eo=a(me,"P",{});var Ua=n(Eo);jr=i(Ua,`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.`),Ua.forEach(t),Jr=p(me),Ne=a(me,"P",{});var dt=n(Ne);Pr=i(dt,"This model is a PyTorch "),Fe=a(dt,"A",{href:!0,rel:!0});var Aa=n(Fe);Nr=i(Aa,"torch.nn.Module"),Aa.forEach(t),Fr=i(dt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dt.forEach(t),Wr=p(me),z=a(me,"DIV",{class:!0});var pe=n(z);T(We.$$.fragment,pe),Zr=p(pe),Y=a(pe,"P",{});var po=n(Y);Ur=i(po,"The "),ro=a(po,"A",{href:!0});var Ra=n(ro);Ar=i(Ra,"ViTHybridForImageClassification"),Ra.forEach(t),Rr=i(po," forward method, overrides the "),zo=a(po,"CODE",{});var Ba=n(zo);Br=i(Ba,"__call__"),Ba.forEach(t),Sr=i(po," special method."),po.forEach(t),Gr=p(pe),T(ie.$$.fragment,pe),Dr=p(pe),T(le.$$.fragment,pe),pe.forEach(t),me.forEach(t),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(rn)),d(g,"id","hybrid-vision-transformer-vit-hybrid"),d(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"),d(g,"href","#hybrid-vision-transformer-vit-hybrid"),d(b,"class","relative group"),d(X,"id","overview"),d(X,"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"),d(X,"href","#overview"),d(W,"class","relative group"),d(ge,"href","https://arxiv.org/abs/2010.11929"),d(ge,"rel","nofollow"),d(Be,"href","vit"),d(Se,"href","bit"),d(ue,"href","https://huggingface.co/nielsr"),d(ue,"rel","nofollow"),d(be,"href","https://github.com/google-research/vision_transformer"),d(be,"rel","nofollow"),d(L,"id","resources"),d(L,"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"),d(L,"href","#resources"),d(Z,"class","relative group"),d(Ye,"href","/docs/transformers/v4.31.0/en/model_doc/vit_hybrid#transformers.ViTHybridForImageClassification"),d(ve,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(ve,"rel","nofollow"),d(Te,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(Te,"rel","nofollow"),d(Le,"href","../tasks/image_classification"),d(O,"id","transformers.ViTHybridConfig"),d(O,"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"),d(O,"href","#transformers.ViTHybridConfig"),d(U,"class","relative group"),d(Oe,"href","/docs/transformers/v4.31.0/en/model_doc/vit_hybrid#transformers.ViTHybridModel"),d(Ve,"href","https://huggingface.co/google/vit-hybrid-base-bit-384"),d(Ve,"rel","nofollow"),d(Ke,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(eo,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(oo,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"id","transformers.ViTHybridImageProcessor"),d(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(oe,"href","#transformers.ViTHybridImageProcessor"),d(S,"class","relative group"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(re,"id","transformers.ViTHybridModel"),d(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(re,"href","#transformers.ViTHybridModel"),d(G,"class","relative group"),d(xe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(xe,"rel","nofollow"),d(to,"href","/docs/transformers/v4.31.0/en/model_doc/vit_hybrid#transformers.ViTHybridModel"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(se,"id","transformers.ViTHybridForImageClassification"),d(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(se,"href","#transformers.ViTHybridForImageClassification"),d(q,"class","relative group"),d(Fe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Fe,"rel","nofollow"),d(ro,"href","/docs/transformers/v4.31.0/en/model_doc/vit_hybrid#transformers.ViTHybridForImageClassification"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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,c){o(document.head,h),f(e,y,c),f(e,b,c),o(b,g),o(g,_),w(l,_,null),o(b,u),o(b,x),o(x,ct),f(e,Po,c),f(e,W,c),o(W,X),o(X,ho),w(fe,ho,null),o(W,mt),o(W,fo),o(fo,pt),f(e,No,c),f(e,C,c),o(C,ht),o(C,ge),o(ge,ft),o(C,gt),o(C,Be),o(Be,ut),o(C,bt),o(C,Se),o(Se,_t),o(C,yt),f(e,Fo,c),f(e,Ge,c),o(Ge,vt),f(e,Wo,c),f(e,De,c),o(De,go),o(go,Tt),f(e,Zo,c),f(e,P,c),o(P,wt),o(P,ue),o(ue,$t),o(P,Vt),o(P,be),o(be,Mt),o(P,It),f(e,Uo,c),f(e,Z,c),o(Z,L),o(L,uo),w(_e,uo,null),o(Z,Ht),o(Z,bo),o(bo,kt),f(e,Ao,c),f(e,qe,c),o(qe,Ct),f(e,Ro,c),w(ye,e,c),f(e,Bo,c),f(e,Q,c),o(Q,N),o(N,Ye),o(Ye,Et),o(N,zt),o(N,ve),o(ve,xt),o(N,jt),o(N,Te),o(Te,Jt),o(N,Pt),o(Q,Nt),o(Q,Xe),o(Xe,Ft),o(Xe,Le),o(Le,Wt),f(e,So,c),f(e,Qe,c),o(Qe,Zt),f(e,Go,c),f(e,U,c),o(U,O),o(O,_o),w(we,_o,null),o(U,Ut),o(U,yo),o(yo,At),f(e,Do,c),f(e,I,c),w($e,I,null),o(I,Rt),o(I,A),o(A,Bt),o(A,Oe),o(Oe,St),o(A,Gt),o(A,Ve),o(Ve,Dt),o(A,qt),o(I,Yt),o(I,R),o(R,Xt),o(R,Ke),o(Ke,Lt),o(R,Qt),o(R,eo),o(eo,Ot),o(R,Kt),o(I,er),w(K,I,null),o(I,or),o(I,ee),w(Me,ee,null),o(ee,tr),o(ee,B),o(B,rr),o(B,oo),o(oo,ar),o(B,nr),o(B,vo),o(vo,sr),o(B,ir),f(e,qo,c),f(e,S,c),o(S,oe),o(oe,To),w(Ie,To,null),o(S,lr),o(S,wo),o(wo,dr),f(e,Yo,c),f(e,j,c),w(He,j,null),o(j,cr),o(j,$o),o($o,mr),o(j,pr),o(j,te),w(ke,te,null),o(te,hr),o(te,Vo),o(Vo,fr),f(e,Xo,c),f(e,G,c),o(G,re),o(re,Mo),w(Ce,Mo,null),o(G,gr),o(G,Io),o(Io,ur),f(e,Lo,c),f(e,J,c),w(Ee,J,null),o(J,br),o(J,ze),o(ze,_r),o(ze,xe),o(xe,yr),o(ze,vr),o(J,Tr),o(J,E),w(je,E,null),o(E,wr),o(E,D),o(D,$r),o(D,to),o(to,Vr),o(D,Mr),o(D,Ho),o(Ho,Ir),o(D,Hr),o(E,kr),w(ae,E,null),o(E,Cr),w(ne,E,null),f(e,Qo,c),f(e,q,c),o(q,se),o(se,ko),w(Je,ko,null),o(q,Er),o(q,Co),o(Co,zr),f(e,Oo,c),f(e,H,c),w(Pe,H,null),o(H,xr),o(H,Eo),o(Eo,jr),o(H,Jr),o(H,Ne),o(Ne,Pr),o(Ne,Fe),o(Fe,Nr),o(Ne,Fr),o(H,Wr),o(H,z),w(We,z,null),o(z,Zr),o(z,Y),o(Y,Ur),o(Y,ro),o(ro,Ar),o(Y,Rr),o(Y,zo),o(zo,Br),o(Y,Sr),o(z,Gr),w(ie,z,null),o(z,Dr),w(le,z,null),Ko=!0},p(e,[c]){const Ze={};c&2&&(Ze.$$scope={dirty:c,ctx:e}),K.$set(Ze);const xo={};c&2&&(xo.$$scope={dirty:c,ctx:e}),ae.$set(xo);const jo={};c&2&&(jo.$$scope={dirty:c,ctx:e}),ne.$set(jo);const Jo={};c&2&&(Jo.$$scope={dirty:c,ctx:e}),ie.$set(Jo);const Ue={};c&2&&(Ue.$$scope={dirty:c,ctx:e}),le.$set(Ue)},i(e){Ko||($(l.$$.fragment,e),$(fe.$$.fragment,e),$(_e.$$.fragment,e),$(ye.$$.fragment,e),$(we.$$.fragment,e),$($e.$$.fragment,e),$(K.$$.fragment,e),$(Me.$$.fragment,e),$(Ie.$$.fragment,e),$(He.$$.fragment,e),$(ke.$$.fragment,e),$(Ce.$$.fragment,e),$(Ee.$$.fragment,e),$(je.$$.fragment,e),$(ae.$$.fragment,e),$(ne.$$.fragment,e),$(Je.$$.fragment,e),$(Pe.$$.fragment,e),$(We.$$.fragment,e),$(ie.$$.fragment,e),$(le.$$.fragment,e),Ko=!0)},o(e){V(l.$$.fragment,e),V(fe.$$.fragment,e),V(_e.$$.fragment,e),V(ye.$$.fragment,e),V(we.$$.fragment,e),V($e.$$.fragment,e),V(K.$$.fragment,e),V(Me.$$.fragment,e),V(Ie.$$.fragment,e),V(He.$$.fragment,e),V(ke.$$.fragment,e),V(Ce.$$.fragment,e),V(Ee.$$.fragment,e),V(je.$$.fragment,e),V(ae.$$.fragment,e),V(ne.$$.fragment,e),V(Je.$$.fragment,e),V(Pe.$$.fragment,e),V(We.$$.fragment,e),V(ie.$$.fragment,e),V(le.$$.fragment,e),Ko=!1},d(e){t(h),e&&t(y),e&&t(b),M(l),e&&t(Po),e&&t(W),M(fe),e&&t(No),e&&t(C),e&&t(Fo),e&&t(Ge),e&&t(Wo),e&&t(De),e&&t(Zo),e&&t(P),e&&t(Uo),e&&t(Z),M(_e),e&&t(Ao),e&&t(qe),e&&t(Ro),M(ye,e),e&&t(Bo),e&&t(Q),e&&t(So),e&&t(Qe),e&&t(Go),e&&t(U),M(we),e&&t(Do),e&&t(I),M($e),M(K),M(Me),e&&t(qo),e&&t(S),M(Ie),e&&t(Yo),e&&t(j),M(He),M(ke),e&&t(Xo),e&&t(G),M(Ce),e&&t(Lo),e&&t(J),M(Ee),M(je),M(ae),M(ne),e&&t(Qo),e&&t(q),M(Je),e&&t(Oo),e&&t(H),M(Pe),M(We),M(ie),M(le)}}}const rn={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 an(k){return Xa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hn extends Ga{constructor(h){super();Da(this,h,an,tn,qa,{})}}export{hn as default,rn as metadata};
