import{s as qo,o as Co,n as Oe}from"../chunks/scheduler.9bc65507.js";import{S as Po,i as jo,g as l,s as r,r as T,A as No,h as d,f as s,c as a,j as H,u as x,x as p,k as J,y as n,a as m,v,d as b,t as w,w as k}from"../chunks/index.707bf1b6.js";import{T as bt}from"../chunks/Tip.c2ecdbf4.js";import{D as U}from"../chunks/Docstring.17db21ae.js";import{C as Rt}from"../chunks/CodeBlock.54a9f38d.js";import{F as Io,M as Fo}from"../chunks/Markdown.fef84341.js";import{E as Jt}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as je}from"../chunks/Heading.342b1fa6.js";function Oo(z){let t,g="pair mask has the following format:",o,c,y;return c=new Rt({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){t=l("p"),t.textContent=g,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-qjgeij"&&(t.textContent=g),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),v(c,i,L),y=!0},p:Oe,i(i){y||(b(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Ao(z){let t,g="pair mask has the following format:",o,c,y;return c=new Rt({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){t=l("p"),t.textContent=g,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-qjgeij"&&(t.textContent=g),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),v(c,i,L),y=!0},p:Oe,i(i){y||(b(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Ho(z){let t,g=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=l("p"),t.innerHTML=g},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=g)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Jo(z){let t,g="Example:",o,c,y;return c=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMeG1lcnRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBMeG1lcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LxmertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LxmertModel.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){t=l("p"),t.textContent=g,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-11lpom8"&&(t.textContent=g),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),v(c,i,L),y=!0},p:Oe,i(i){y||(b(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Ro(z){let t,g=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=l("p"),t.innerHTML=g},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=g)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Wo(z){let t,g=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=l("p"),t.innerHTML=g},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=g)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Eo(z){let t,g="Example:",o,c,y;return c=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMeG1lcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBMeG1lcnRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWFuc3dlcl9zdGFydF9pbmRleCUyMCUzRCUyMG91dHB1dHMuc3RhcnRfbG9naXRzLmFyZ21heCgpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMG91dHB1dHMuZW5kX2xvZ2l0cy5hcmdtYXgoKSUwQSUwQXByZWRpY3RfYW5zd2VyX3Rva2VucyUyMCUzRCUyMGlucHV0cy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEElMEElMjMlMjB0YXJnZXQlMjBpcyUyMCUyMm5pY2UlMjBwdXBwZXQlMjIlMEF0YXJnZXRfc3RhcnRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNSU1RCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBzdGFydF9wb3NpdGlvbnMlM0R0YXJnZXRfc3RhcnRfaW5kZXglMkMlMjBlbmRfcG9zaXRpb25zJTNEdGFyZ2V0X2VuZF9pbmRleCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3Nz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LxmertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LxmertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, 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>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`,wrap:!1}}),{c(){t=l("p"),t.textContent=g,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-11lpom8"&&(t.textContent=g),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),v(c,i,L),y=!0},p:Oe,i(i){y||(b(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Uo(z){let t,g,o,c,y,i,L="The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top.",Y,F,W=`The LXMERT model was proposed in <a href="https://arxiv.org/abs/1908.07490" rel="nofollow">LXMERT: Learning Cross-Modality Encoder Representations from
Transformers</a> by Hao Tan and Mohit Bansal. It’s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`,K,q,E=`This model inherits from <a href="/docs/transformers/v4.37.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ee,h,I=`This model is also 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.`,V,O,ye,ge,ae,Ae='The <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> forward method, overrides the <code>__call__</code> special method.',Q,_e,ie,B,le,Z,R,j,G,Te,S,Le="Lxmert Model with a specified pretraining head on top.",$e,ue,Qe=`The LXMERT model was proposed in <a href="https://arxiv.org/abs/1908.07490" rel="nofollow">LXMERT: Learning Cross-Modality Encoder Representations from
Transformers</a> by Hao Tan and Mohit Bansal. It’s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`,Me,pe,Ze=`This model inherits from <a href="/docs/transformers/v4.37.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,de,te,oe=`This model is also 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.`,C,X,ne,qe,Ce,xe='The <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertForPreTraining">LxmertForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',ve,f,$,N,A,P,ce,Ge,Ee,Ye="Lxmert Model with a visual-answering head on top for downstream QA tasks",wt,Ue,He=`The LXMERT model was proposed in <a href="https://arxiv.org/abs/1908.07490" rel="nofollow">LXMERT: Learning Cross-Modality Encoder Representations from
Transformers</a> by Hao Tan and Mohit Bansal. It’s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`,Je,De,Ke=`This model inherits from <a href="/docs/transformers/v4.37.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,kt,Xe,be=`This model is also 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.`,Re,he,ze,yt,Ve,We='The <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering">LxmertForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',mt,we,Lt,Ne,Pe;return t=new je({props:{title:"LxmertModel",local:"transformers.LxmertModel",headingTag:"h2"}}),c=new U({props:{name:"class transformers.LxmertModel",anchor:"transformers.LxmertModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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.37.1/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.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L879"}}),ye=new U({props:{name:"forward",anchor:"transformers.LxmertModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"visual_feats",val:": Optional = None"},{name:"visual_pos",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"visual_attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LxmertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LxmertModel.forward.visual_feats",description:`<strong>visual_feats</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.`,name:"visual_feats"},{anchor:"transformers.LxmertModel.forward.visual_pos",description:`<strong>visual_pos</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>) &#x2014;
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"visual_pos"},{anchor:"transformers.LxmertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertModel.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertModel.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.LxmertModel.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.LxmertModel.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.37.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L898",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</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.37.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>language_output</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 language encoder.</li>
<li><strong>vision_output</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 visual encoder.</li>
<li><strong>pooled_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, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear</li>
<li><strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new bt({props:{$$slots:{default:[Ho]},$$scope:{ctx:z}}}),B=new Jt({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[Jo]},$$scope:{ctx:z}}}),Z=new je({props:{title:"LxmertForPreTraining",local:"transformers.LxmertForPreTraining",headingTag:"h2"}}),G=new U({props:{name:"class transformers.LxmertForPreTraining",anchor:"transformers.LxmertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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.37.1/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.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L1017"}}),ne=new U({props:{name:"forward",anchor:"transformers.LxmertForPreTraining.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"visual_feats",val:": Optional = None"},{name:"visual_pos",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"visual_attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"obj_labels",val:": Optional = None"},{name:"matched_label",val:": Optional = None"},{name:"ans",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LxmertForPreTraining.forward.visual_feats",description:`<strong>visual_feats</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.`,name:"visual_feats"},{anchor:"transformers.LxmertForPreTraining.forward.visual_pos",description:`<strong>visual_pos</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>) &#x2014;
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"visual_pos"},{anchor:"transformers.LxmertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertForPreTraining.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertForPreTraining.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.LxmertForPreTraining.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.LxmertForPreTraining.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.37.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LxmertForPreTraining.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.LxmertForPreTraining.forward.obj_labels",description:`<strong>obj_labels</strong> (<code>Dict[Str -- Tuple[Torch.FloatTensor, Torch.FloatTensor]]</code>, <em>optional</em>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"obj_labels"},{anchor:"transformers.LxmertForPreTraining.forward.matched_label",description:`<strong>matched_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.LxmertForPreTraining.forward.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L1150",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</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.37.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) — Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>cross_relationship_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) — Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).</li>
<li><strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>) — Prediction scores of question answering objective (classification).</li>
<li><strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),f=new bt({props:{$$slots:{default:[Ro]},$$scope:{ctx:z}}}),N=new je({props:{title:"LxmertForQuestionAnswering",local:"transformers.LxmertForQuestionAnswering",headingTag:"h2"}}),ce=new U({props:{name:"class transformers.LxmertForQuestionAnswering",anchor:"transformers.LxmertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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.37.1/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.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L1285"}}),ze=new U({props:{name:"forward",anchor:"transformers.LxmertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"visual_feats",val:": Optional = None"},{name:"visual_pos",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"visual_attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LxmertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_feats",description:`<strong>visual_feats</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.`,name:"visual_feats"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_pos",description:`<strong>visual_pos</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>) &#x2014;
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"visual_pos"},{anchor:"transformers.LxmertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertForQuestionAnswering.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.LxmertForQuestionAnswering.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.LxmertForQuestionAnswering.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.37.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LxmertForQuestionAnswering.forward.labels",description:`<strong>labels</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
A one-hot representation of the correct answer`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L1381",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</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.37.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) — Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.</li>
<li><strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>) — Prediction scores of question answering objective (classification).</li>
<li><strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),we=new bt({props:{$$slots:{default:[Wo]},$$scope:{ctx:z}}}),Ne=new Jt({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[Eo]},$$scope:{ctx:z}}}),{c(){T(t.$$.fragment),g=r(),o=l("div"),T(c.$$.fragment),y=r(),i=l("p"),i.textContent=L,Y=r(),F=l("p"),F.innerHTML=W,K=r(),q=l("p"),q.innerHTML=E,ee=r(),h=l("p"),h.innerHTML=I,V=r(),O=l("div"),T(ye.$$.fragment),ge=r(),ae=l("p"),ae.innerHTML=Ae,Q=r(),T(_e.$$.fragment),ie=r(),T(B.$$.fragment),le=r(),T(Z.$$.fragment),R=r(),j=l("div"),T(G.$$.fragment),Te=r(),S=l("p"),S.textContent=Le,$e=r(),ue=l("p"),ue.innerHTML=Qe,Me=r(),pe=l("p"),pe.innerHTML=Ze,de=r(),te=l("p"),te.innerHTML=oe,C=r(),X=l("div"),T(ne.$$.fragment),qe=r(),Ce=l("p"),Ce.innerHTML=xe,ve=r(),T(f.$$.fragment),$=r(),T(N.$$.fragment),A=r(),P=l("div"),T(ce.$$.fragment),Ge=r(),Ee=l("p"),Ee.textContent=Ye,wt=r(),Ue=l("p"),Ue.innerHTML=He,Je=r(),De=l("p"),De.innerHTML=Ke,kt=r(),Xe=l("p"),Xe.innerHTML=be,Re=r(),he=l("div"),T(ze.$$.fragment),yt=r(),Ve=l("p"),Ve.innerHTML=We,mt=r(),T(we.$$.fragment),Lt=r(),T(Ne.$$.fragment),this.h()},l(u){x(t.$$.fragment,u),g=a(u),o=d(u,"DIV",{class:!0});var M=H(o);x(c.$$.fragment,M),y=a(M),i=d(M,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fhk4sj"&&(i.textContent=L),Y=a(M),F=d(M,"P",{"data-svelte-h":!0}),p(F)!=="svelte-1bbanmh"&&(F.innerHTML=W),K=a(M),q=d(M,"P",{"data-svelte-h":!0}),p(q)!=="svelte-1vcryay"&&(q.innerHTML=E),ee=a(M),h=d(M,"P",{"data-svelte-h":!0}),p(h)!=="svelte-hswkmf"&&(h.innerHTML=I),V=a(M),O=d(M,"DIV",{class:!0});var se=H(O);x(ye.$$.fragment,se),ge=a(se),ae=d(se,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-1q18u5j"&&(ae.innerHTML=Ae),Q=a(se),x(_e.$$.fragment,se),ie=a(se),x(B.$$.fragment,se),se.forEach(s),M.forEach(s),le=a(u),x(Z.$$.fragment,u),R=a(u),j=d(u,"DIV",{class:!0});var re=H(j);x(G.$$.fragment,re),Te=a(re),S=d(re,"P",{"data-svelte-h":!0}),p(S)!=="svelte-1dd3ewf"&&(S.textContent=Le),$e=a(re),ue=d(re,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-1bbanmh"&&(ue.innerHTML=Qe),Me=a(re),pe=d(re,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-1vcryay"&&(pe.innerHTML=Ze),de=a(re),te=d(re,"P",{"data-svelte-h":!0}),p(te)!=="svelte-hswkmf"&&(te.innerHTML=oe),C=a(re),X=d(re,"DIV",{class:!0});var Fe=H(X);x(ne.$$.fragment,Fe),qe=a(Fe),Ce=d(Fe,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-1dxv86n"&&(Ce.innerHTML=xe),ve=a(Fe),x(f.$$.fragment,Fe),Fe.forEach(s),re.forEach(s),$=a(u),x(N.$$.fragment,u),A=a(u),P=d(u,"DIV",{class:!0});var D=H(P);x(ce.$$.fragment,D),Ge=a(D),Ee=d(D,"P",{"data-svelte-h":!0}),p(Ee)!=="svelte-a5jm60"&&(Ee.textContent=Ye),wt=a(D),Ue=d(D,"P",{"data-svelte-h":!0}),p(Ue)!=="svelte-1bbanmh"&&(Ue.innerHTML=He),Je=a(D),De=d(D,"P",{"data-svelte-h":!0}),p(De)!=="svelte-1vcryay"&&(De.innerHTML=Ke),kt=a(D),Xe=d(D,"P",{"data-svelte-h":!0}),p(Xe)!=="svelte-hswkmf"&&(Xe.innerHTML=be),Re=a(D),he=d(D,"DIV",{class:!0});var fe=H(he);x(ze.$$.fragment,fe),yt=a(fe),Ve=d(fe,"P",{"data-svelte-h":!0}),p(Ve)!=="svelte-1v9evg9"&&(Ve.innerHTML=We),mt=a(fe),x(we.$$.fragment,fe),Lt=a(fe),x(Ne.$$.fragment,fe),fe.forEach(s),D.forEach(s),this.h()},h(){J(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(u,M){v(t,u,M),m(u,g,M),m(u,o,M),v(c,o,null),n(o,y),n(o,i),n(o,Y),n(o,F),n(o,K),n(o,q),n(o,ee),n(o,h),n(o,V),n(o,O),v(ye,O,null),n(O,ge),n(O,ae),n(O,Q),v(_e,O,null),n(O,ie),v(B,O,null),m(u,le,M),v(Z,u,M),m(u,R,M),m(u,j,M),v(G,j,null),n(j,Te),n(j,S),n(j,$e),n(j,ue),n(j,Me),n(j,pe),n(j,de),n(j,te),n(j,C),n(j,X),v(ne,X,null),n(X,qe),n(X,Ce),n(X,ve),v(f,X,null),m(u,$,M),v(N,u,M),m(u,A,M),m(u,P,M),v(ce,P,null),n(P,Ge),n(P,Ee),n(P,wt),n(P,Ue),n(P,Je),n(P,De),n(P,kt),n(P,Xe),n(P,Re),n(P,he),v(ze,he,null),n(he,yt),n(he,Ve),n(he,mt),v(we,he,null),n(he,Lt),v(Ne,he,null),Pe=!0},p(u,M){const se={};M&2&&(se.$$scope={dirty:M,ctx:u}),_e.$set(se);const re={};M&2&&(re.$$scope={dirty:M,ctx:u}),B.$set(re);const Fe={};M&2&&(Fe.$$scope={dirty:M,ctx:u}),f.$set(Fe);const D={};M&2&&(D.$$scope={dirty:M,ctx:u}),we.$set(D);const fe={};M&2&&(fe.$$scope={dirty:M,ctx:u}),Ne.$set(fe)},i(u){Pe||(b(t.$$.fragment,u),b(c.$$.fragment,u),b(ye.$$.fragment,u),b(_e.$$.fragment,u),b(B.$$.fragment,u),b(Z.$$.fragment,u),b(G.$$.fragment,u),b(ne.$$.fragment,u),b(f.$$.fragment,u),b(N.$$.fragment,u),b(ce.$$.fragment,u),b(ze.$$.fragment,u),b(we.$$.fragment,u),b(Ne.$$.fragment,u),Pe=!0)},o(u){w(t.$$.fragment,u),w(c.$$.fragment,u),w(ye.$$.fragment,u),w(_e.$$.fragment,u),w(B.$$.fragment,u),w(Z.$$.fragment,u),w(G.$$.fragment,u),w(ne.$$.fragment,u),w(f.$$.fragment,u),w(N.$$.fragment,u),w(ce.$$.fragment,u),w(ze.$$.fragment,u),w(we.$$.fragment,u),w(Ne.$$.fragment,u),Pe=!1},d(u){u&&(s(g),s(o),s(le),s(R),s(j),s($),s(A),s(P)),k(t,u),k(c),k(ye),k(_e),k(B),k(Z,u),k(G),k(ne),k(f),k(N,u),k(ce),k(ze),k(we),k(Ne)}}}function Do(z){let t,g;return t=new Fo({props:{$$slots:{default:[Uo]},$$scope:{ctx:z}}}),{c(){T(t.$$.fragment)},l(o){x(t.$$.fragment,o)},m(o,c){v(t,o,c),g=!0},p(o,c){const y={};c&2&&(y.$$scope={dirty:c,ctx:o}),t.$set(y)},i(o){g||(b(t.$$.fragment,o),g=!0)},o(o){w(t.$$.fragment,o),g=!1},d(o){k(t,o)}}}function Xo(z){let t,g="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,c,y="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",i,L,Y=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,F,W,K=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,q,E,ee=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){t=l("p"),t.innerHTML=g,o=r(),c=l("ul"),c.innerHTML=y,i=r(),L=l("p"),L.innerHTML=Y,F=r(),W=l("ul"),W.innerHTML=K,q=r(),E=l("p"),E.innerHTML=ee},l(h){t=d(h,"P",{"data-svelte-h":!0}),p(t)!=="svelte-1ajbfxg"&&(t.innerHTML=g),o=a(h),c=d(h,"UL",{"data-svelte-h":!0}),p(c)!=="svelte-qm1t26"&&(c.innerHTML=y),i=a(h),L=d(h,"P",{"data-svelte-h":!0}),p(L)!=="svelte-1v9qsc5"&&(L.innerHTML=Y),F=a(h),W=d(h,"UL",{"data-svelte-h":!0}),p(W)!=="svelte-15scerc"&&(W.innerHTML=K),q=a(h),E=d(h,"P",{"data-svelte-h":!0}),p(E)!=="svelte-1an3odd"&&(E.innerHTML=ee)},m(h,I){m(h,t,I),m(h,o,I),m(h,c,I),m(h,i,I),m(h,L,I),m(h,F,I),m(h,W,I),m(h,q,I),m(h,E,I)},p:Oe,d(h){h&&(s(t),s(o),s(c),s(i),s(L),s(F),s(W),s(q),s(E))}}}function Vo(z){let t,g=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=l("p"),t.innerHTML=g},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=g)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Bo(z){let t,g="Example:",o,c,y;return c=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkx4bWVydE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1bmMtbmxwJTJGbHhtZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGTHhtZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnVuYy1ubHAlMkZseG1lcnQtYmFzZS11bmNhc2VkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFLxmertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFLxmertModel.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){t=l("p"),t.textContent=g,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-11lpom8"&&(t.textContent=g),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),v(c,i,L),y=!0},p:Oe,i(i){y||(b(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function So(z){let t,g="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",o,c,y="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",i,L,Y=`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,F,W,K=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,q,E,ee=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){t=l("p"),t.innerHTML=g,o=r(),c=l("ul"),c.innerHTML=y,i=r(),L=l("p"),L.innerHTML=Y,F=r(),W=l("ul"),W.innerHTML=K,q=r(),E=l("p"),E.innerHTML=ee},l(h){t=d(h,"P",{"data-svelte-h":!0}),p(t)!=="svelte-1ajbfxg"&&(t.innerHTML=g),o=a(h),c=d(h,"UL",{"data-svelte-h":!0}),p(c)!=="svelte-qm1t26"&&(c.innerHTML=y),i=a(h),L=d(h,"P",{"data-svelte-h":!0}),p(L)!=="svelte-1v9qsc5"&&(L.innerHTML=Y),F=a(h),W=d(h,"UL",{"data-svelte-h":!0}),p(W)!=="svelte-15scerc"&&(W.innerHTML=K),q=a(h),E=d(h,"P",{"data-svelte-h":!0}),p(E)!=="svelte-1an3odd"&&(E.innerHTML=ee)},m(h,I){m(h,t,I),m(h,o,I),m(h,c,I),m(h,i,I),m(h,L,I),m(h,F,I),m(h,W,I),m(h,q,I),m(h,E,I)},p:Oe,d(h){h&&(s(t),s(o),s(c),s(i),s(L),s(F),s(W),s(q),s(E))}}}function Qo(z){let t,g=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=l("p"),t.innerHTML=g},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=g)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Zo(z){let t,g,o,c,y,i,L="The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top.",Y,F,W=`The LXMERT model was proposed in <a href="https://arxiv.org/abs/1908.07490" rel="nofollow">LXMERT: Learning Cross-Modality Encoder Representations from
Transformers</a> by Hao Tan and Mohit Bansal. It’s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`,K,q,E=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,ee,h,I,V,O,ye,ge,ae='The <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.TFLxmertModel">TFLxmertModel</a> forward method, overrides the <code>__call__</code> special method.',Ae,Q,_e,ie,B,le,Z,R,j,G,Te,S="Lxmert Model with a <code>language modeling</code> head on top.",Le,$e,ue=`The LXMERT model was proposed in <a href="https://arxiv.org/abs/1908.07490" rel="nofollow">LXMERT: Learning Cross-Modality Encoder Representations from
Transformers</a> by Hao Tan and Mohit Bansal. It’s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`,Qe,Me,pe=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">tf.keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Ze,de,te,oe,C,X,ne,qe='The <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.TFLxmertForPreTraining">TFLxmertForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',Ce,xe,ve;return t=new je({props:{title:"TFLxmertModel",local:"transformers.TFLxmertModel",headingTag:"h2"}}),c=new U({props:{name:"class transformers.TFLxmertModel",anchor:"transformers.TFLxmertModel",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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.37.1/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.37.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1093"}}),h=new bt({props:{$$slots:{default:[Xo]},$$scope:{ctx:z}}}),O=new U({props:{name:"call",anchor:"transformers.TFLxmertModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"visual_feats",val:": tf.Tensor | None = None"},{name:"visual_pos",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"visual_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFLxmertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLxmertModel.call.visual_feats",description:`<strong>visual_feats</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.`,name:"visual_feats"},{anchor:"transformers.TFLxmertModel.call.visual_pos",description:`<strong>visual_pos</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"visual_pos"},{anchor:"transformers.TFLxmertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLxmertModel.call.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
MMask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.TFLxmertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFLxmertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFLxmertModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLxmertModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLxmertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.37.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1102",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>language_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the language encoder.</li>
<li><strong>vision_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the visual encoder.</li>
<li><strong>pooled_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear</li>
<li><strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Q=new bt({props:{$$slots:{default:[Vo]},$$scope:{ctx:z}}}),ie=new Jt({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[Bo]},$$scope:{ctx:z}}}),le=new je({props:{title:"TFLxmertForPreTraining",local:"transformers.TFLxmertForPreTraining",headingTag:"h2"}}),j=new U({props:{name:"class transformers.TFLxmertForPreTraining",anchor:"transformers.TFLxmertForPreTraining",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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.37.1/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.37.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1400"}}),de=new bt({props:{$$slots:{default:[So]},$$scope:{ctx:z}}}),C=new U({props:{name:"call",anchor:"transformers.TFLxmertForPreTraining.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"visual_feats",val:": tf.Tensor | None = None"},{name:"visual_pos",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"visual_attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"masked_lm_labels",val:": tf.Tensor | None = None"},{name:"obj_labels",val:": Dict[str, Tuple[tf.Tensor, tf.Tensor]] | None = None"},{name:"matched_label",val:": tf.Tensor | None = None"},{name:"ans",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_feats",description:`<strong>visual_feats</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.`,name:"visual_feats"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_pos",description:`<strong>visual_pos</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"visual_pos"},{anchor:"transformers.TFLxmertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
MMask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.TFLxmertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFLxmertForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLxmertForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLxmertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.37.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFLxmertForPreTraining.call.masked_lm_labels",description:`<strong>masked_lm_labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"masked_lm_labels"},{anchor:"transformers.TFLxmertForPreTraining.call.obj_labels",description:`<strong>obj_labels</strong> (<code>Dict[Str -- Tuple[tf.Tensor, tf.Tensor]]</code>, <em>optional</em>, defaults to <code>None</code>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"obj_labels"},{anchor:"transformers.TFLxmertForPreTraining.call.matched_label",description:`<strong>matched_label</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.TFLxmertForPreTraining.call.ans",description:`<strong>ans</strong> (<code>tf.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1501",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) — Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>cross_relationship_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) — Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).</li>
<li><strong>question_answering_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>) — Prediction scores of question answering objective (classification).</li>
<li><strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),xe=new bt({props:{$$slots:{default:[Qo]},$$scope:{ctx:z}}}),{c(){T(t.$$.fragment),g=r(),o=l("div"),T(c.$$.fragment),y=r(),i=l("p"),i.textContent=L,Y=r(),F=l("p"),F.innerHTML=W,K=r(),q=l("p"),q.innerHTML=E,ee=r(),T(h.$$.fragment),I=r(),V=l("div"),T(O.$$.fragment),ye=r(),ge=l("p"),ge.innerHTML=ae,Ae=r(),T(Q.$$.fragment),_e=r(),T(ie.$$.fragment),B=r(),T(le.$$.fragment),Z=r(),R=l("div"),T(j.$$.fragment),G=r(),Te=l("p"),Te.innerHTML=S,Le=r(),$e=l("p"),$e.innerHTML=ue,Qe=r(),Me=l("p"),Me.innerHTML=pe,Ze=r(),T(de.$$.fragment),te=r(),oe=l("div"),T(C.$$.fragment),X=r(),ne=l("p"),ne.innerHTML=qe,Ce=r(),T(xe.$$.fragment),this.h()},l(f){x(t.$$.fragment,f),g=a(f),o=d(f,"DIV",{class:!0});var $=H(o);x(c.$$.fragment,$),y=a($),i=d($,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fhk4sj"&&(i.textContent=L),Y=a($),F=d($,"P",{"data-svelte-h":!0}),p(F)!=="svelte-8ixyjl"&&(F.innerHTML=W),K=a($),q=d($,"P",{"data-svelte-h":!0}),p(q)!=="svelte-1ivrf8m"&&(q.innerHTML=E),ee=a($),x(h.$$.fragment,$),I=a($),V=d($,"DIV",{class:!0});var N=H(V);x(O.$$.fragment,N),ye=a(N),ge=d(N,"P",{"data-svelte-h":!0}),p(ge)!=="svelte-6o7vz"&&(ge.innerHTML=ae),Ae=a(N),x(Q.$$.fragment,N),_e=a(N),x(ie.$$.fragment,N),N.forEach(s),$.forEach(s),B=a(f),x(le.$$.fragment,f),Z=a(f),R=d(f,"DIV",{class:!0});var A=H(R);x(j.$$.fragment,A),G=a(A),Te=d(A,"P",{"data-svelte-h":!0}),p(Te)!=="svelte-lehd7m"&&(Te.innerHTML=S),Le=a(A),$e=d(A,"P",{"data-svelte-h":!0}),p($e)!=="svelte-8ixyjl"&&($e.innerHTML=ue),Qe=a(A),Me=d(A,"P",{"data-svelte-h":!0}),p(Me)!=="svelte-1ivrf8m"&&(Me.innerHTML=pe),Ze=a(A),x(de.$$.fragment,A),te=a(A),oe=d(A,"DIV",{class:!0});var P=H(oe);x(C.$$.fragment,P),X=a(P),ne=d(P,"P",{"data-svelte-h":!0}),p(ne)!=="svelte-v2cnm7"&&(ne.innerHTML=qe),Ce=a(P),x(xe.$$.fragment,P),P.forEach(s),A.forEach(s),this.h()},h(){J(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(f,$){v(t,f,$),m(f,g,$),m(f,o,$),v(c,o,null),n(o,y),n(o,i),n(o,Y),n(o,F),n(o,K),n(o,q),n(o,ee),v(h,o,null),n(o,I),n(o,V),v(O,V,null),n(V,ye),n(V,ge),n(V,Ae),v(Q,V,null),n(V,_e),v(ie,V,null),m(f,B,$),v(le,f,$),m(f,Z,$),m(f,R,$),v(j,R,null),n(R,G),n(R,Te),n(R,Le),n(R,$e),n(R,Qe),n(R,Me),n(R,Ze),v(de,R,null),n(R,te),n(R,oe),v(C,oe,null),n(oe,X),n(oe,ne),n(oe,Ce),v(xe,oe,null),ve=!0},p(f,$){const N={};$&2&&(N.$$scope={dirty:$,ctx:f}),h.$set(N);const A={};$&2&&(A.$$scope={dirty:$,ctx:f}),Q.$set(A);const P={};$&2&&(P.$$scope={dirty:$,ctx:f}),ie.$set(P);const ce={};$&2&&(ce.$$scope={dirty:$,ctx:f}),de.$set(ce);const Ge={};$&2&&(Ge.$$scope={dirty:$,ctx:f}),xe.$set(Ge)},i(f){ve||(b(t.$$.fragment,f),b(c.$$.fragment,f),b(h.$$.fragment,f),b(O.$$.fragment,f),b(Q.$$.fragment,f),b(ie.$$.fragment,f),b(le.$$.fragment,f),b(j.$$.fragment,f),b(de.$$.fragment,f),b(C.$$.fragment,f),b(xe.$$.fragment,f),ve=!0)},o(f){w(t.$$.fragment,f),w(c.$$.fragment,f),w(h.$$.fragment,f),w(O.$$.fragment,f),w(Q.$$.fragment,f),w(ie.$$.fragment,f),w(le.$$.fragment,f),w(j.$$.fragment,f),w(de.$$.fragment,f),w(C.$$.fragment,f),w(xe.$$.fragment,f),ve=!1},d(f){f&&(s(g),s(o),s(B),s(Z),s(R)),k(t,f),k(c),k(h),k(O),k(Q),k(ie),k(le,f),k(j),k(de),k(C),k(xe)}}}function Go(z){let t,g;return t=new Fo({props:{$$slots:{default:[Zo]},$$scope:{ctx:z}}}),{c(){T(t.$$.fragment)},l(o){x(t.$$.fragment,o)},m(o,c){v(t,o,c),g=!0},p(o,c){const y={};c&2&&(y.$$scope={dirty:c,ctx:o}),t.$set(y)},i(o){g||(b(t.$$.fragment,o),g=!0)},o(o){w(t.$$.fragment,o),g=!1},d(o){k(t,o)}}}function Yo(z){let t,g,o,c,y,i,L,Y,F,W=`The LXMERT model was proposed in <a href="https://arxiv.org/abs/1908.07490" rel="nofollow">LXMERT: Learning Cross-Modality Encoder Representations from Transformers</a> by Hao Tan &amp; Mohit Bansal. It is a series of bidirectional transformer encoders
(one for the vision modality, one for the language modality, and then one to fuse both modalities) pretrained using a
combination of masked language modeling, visual-language text alignment, ROI-feature regression, masked
visual-attribute modeling, masked visual-object modeling, and visual-question answering objectives. The pretraining
consists of multiple multi-modal datasets: MSCOCO, Visual-Genome + Visual-Genome Question Answering, VQA 2.0, and GQA.`,K,q,E="The abstract from the paper is the following:",ee,h,I=`<em>Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly,
the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality
Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we
build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language
encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language
semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative
pretraining tasks: masked language modeling, masked object prediction (feature regression and label classification),
cross-modality matching, and image question answering. These tasks help in learning both intra-modality and
cross-modality relationships. After fine-tuning from our pretrained parameters, our model achieves the state-of-the-art
results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our
pretrained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR, and improve the previous
best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel
model components and pretraining strategies significantly contribute to our strong results; and also present several
attention visualizations for the different encoders</em>`,V,O,ye='This model was contributed by <a href="https://huggingface.co/eltoto1219" rel="nofollow">eltoto1219</a>. The original code can be found <a href="https://github.com/airsplay/lxmert" rel="nofollow">here</a>.',ge,ae,Ae,Q,_e=`<li>Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.</li> <li>Both the language hidden states and the visual hidden states that LXMERT outputs are passed through the
cross-modality layer, so they contain information from both modalities. To access a modality that only attends to
itself, select the vision/language hidden states from the first input in the tuple.</li> <li>The bidirectional cross-modality encoder attention only returns attention values when the language modality is used
as the input and the vision modality is used as the context vector. Further, while the cross-modality encoder
contains self-attention for each respective modality and cross-attention, only the cross attention is returned and
both self attention outputs are disregarded.</li>`,ie,B,le,Z,R='<li><a href="../tasks/question_answering">Question answering task guide</a></li>',j,G,Te,S,Le,$e,ue,Qe=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or a <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.TFLxmertModel">TFLxmertModel</a>. It is used
to instantiate a LXMERT 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 Lxmert
<a href="https://huggingface.co/unc-nlp/lxmert-base-uncased" rel="nofollow">unc-nlp/lxmert-base-uncased</a> architecture.`,Me,pe,Ze=`Configuration objects inherit from <a href="/docs/transformers/v4.37.1/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.37.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,de,te,oe,C,X,ne,qe,Ce="Construct a Lxmert tokenizer. Based on WordPiece.",xe,ve,f=`This tokenizer inherits from <a href="/docs/transformers/v4.37.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,$,N,A,P,ce,Ge=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Lxmert sequence has the following format:`,Ee,Ye,wt="<li>single sequence: <code>[CLS] X [SEP]</code></li> <li>pair of sequences: <code>[CLS] A [SEP] B [SEP]</code></li>",Ue,He,Je,De,Ke,kt="Converts a sequence of tokens (string) in a single string.",Xe,be,Re,he,ze,yt="Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert sequence",Ve,We,mt,we,Lt="If <code>token_ids_1</code> is <code>None</code>, this method only returns the first portion of the mask (0s).",Ne,Pe,u,M,se,re=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> method.`,Fe,D,fe,ke,ut,no,$t,To="Construct a “fast” Lxmert tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on WordPiece.",so,Mt,xo=`This tokenizer inherits from <a href="/docs/transformers/v4.37.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,ro,Be,pt,ao,zt,vo=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Lxmert sequence has the following format:`,io,Ft,bo="<li>single sequence: <code>[CLS] X [SEP]</code></li> <li>pair of sequences: <code>[CLS] A [SEP] B [SEP]</code></li>",lo,Ie,ht,co,qt,wo="Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert sequence",mo,it,uo,Ct,ko="If <code>token_ids_1</code> is <code>None</code>, this method only returns the first portion of the mask (0s).",Wt,ft,Et,et,gt,po,Pt,yo=`Lxmert’s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the “relation-ship”
encoder”)`,Ut,tt,_t,ho,jt,Lo='Output type of <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertForPreTraining">LxmertForPreTraining</a>.',Dt,ot,Tt,fo,Nt,$o='Output type of <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering">LxmertForQuestionAnswering</a>.',Xt,nt,xt,go,It,Mo=`Lxmert’s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the “relation-ship”
encoder”)`,Vt,st,vt,_o,Ot,zo='Output type of <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertForPreTraining">LxmertForPreTraining</a>.',Bt,lt,St,Ht,Qt;return y=new je({props:{title:"LXMERT",local:"lxmert",headingTag:"h1"}}),L=new je({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ae=new je({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),B=new je({props:{title:"Resources",local:"resources",headingTag:"h2"}}),G=new je({props:{title:"LxmertConfig",local:"transformers.LxmertConfig",headingTag:"h2"}}),Le=new U({props:{name:"class transformers.LxmertConfig",anchor:"transformers.LxmertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_attention_heads",val:" = 12"},{name:"num_qa_labels",val:" = 9500"},{name:"num_object_labels",val:" = 1600"},{name:"num_attr_labels",val:" = 400"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"l_layers",val:" = 9"},{name:"x_layers",val:" = 5"},{name:"r_layers",val:" = 5"},{name:"visual_feat_dim",val:" = 2048"},{name:"visual_pos_dim",val:" = 4"},{name:"visual_loss_normalizer",val:" = 6.67"},{name:"task_matched",val:" = True"},{name:"task_mask_lm",val:" = True"},{name:"task_obj_predict",val:" = True"},{name:"task_qa",val:" = True"},{name:"visual_obj_loss",val:" = True"},{name:"visual_attr_loss",val:" = True"},{name:"visual_feat_loss",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the LXMERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/v4.37.1/en/model_doc/lxmert#transformers.TFLxmertModel">TFLxmertModel</a>.`,name:"vocab_size"},{anchor:"transformers.LxmertConfig.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.LxmertConfig.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.LxmertConfig.num_qa_labels",description:`<strong>num_qa_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 9500) &#x2014;
This represents the total number of different question answering (QA) labels there are. If using more than
one dataset with QA, the user will need to account for the total number of labels that all of the datasets
have in total.`,name:"num_qa_labels"},{anchor:"transformers.LxmertConfig.num_object_labels",description:`<strong>num_object_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
This represents the total number of semantically unique objects that lxmert will be able to classify a
pooled-object feature as belonging too.`,name:"num_object_labels"},{anchor:"transformers.LxmertConfig.num_attr_labels",description:`<strong>num_attr_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 400) &#x2014;
This represents the total number of semantically unique attributes that lxmert will be able to classify a
pooled-object feature as possessing.`,name:"num_attr_labels"},{anchor:"transformers.LxmertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.LxmertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.LxmertConfig.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.LxmertConfig.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.LxmertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.LxmertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <em>token_type_ids</em> passed into <a href="/docs/transformers/v4.37.1/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.LxmertConfig.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.LxmertConfig.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.LxmertConfig.l_layers",description:`<strong>l_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 9) &#x2014;
Number of hidden layers in the Transformer language encoder.`,name:"l_layers"},{anchor:"transformers.LxmertConfig.x_layers",description:`<strong>x_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer cross modality encoder.`,name:"x_layers"},{anchor:"transformers.LxmertConfig.r_layers",description:`<strong>r_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer visual encoder.`,name:"r_layers"},{anchor:"transformers.LxmertConfig.visual_feat_dim",description:`<strong>visual_feat_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
This represents the last dimension of the pooled-object features used as input for the model, representing
the size of each object feature itself.`,name:"visual_feat_dim"},{anchor:"transformers.LxmertConfig.visual_pos_dim",description:`<strong>visual_pos_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
This represents the number of spacial features that are mixed into the visual features. The default is set
to 4 because most commonly this will represent the location of a bounding box. i.e., (x, y, width, height)`,name:"visual_pos_dim"},{anchor:"transformers.LxmertConfig.visual_loss_normalizer",description:`<strong>visual_loss_normalizer</strong> (<code>float</code>, <em>optional</em>, defaults to 6.67) &#x2014;
This represents the scaling factor in which each visual loss is multiplied by if during pretraining, one
decided to train with multiple vision-based loss objectives.`,name:"visual_loss_normalizer"},{anchor:"transformers.LxmertConfig.task_matched",description:`<strong>task_matched</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
This task is used for sentence-image matching. If the sentence correctly describes the image the label will
be 1. If the sentence does not correctly describe the image, the label will be 0.`,name:"task_matched"},{anchor:"transformers.LxmertConfig.task_mask_lm",description:`<strong>task_mask_lm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add masked language modeling (as used in pretraining models such as BERT) to the loss
objective.`,name:"task_mask_lm"},{anchor:"transformers.LxmertConfig.task_obj_predict",description:`<strong>task_obj_predict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add object prediction, attribute prediction and feature regression to the loss objective.`,name:"task_obj_predict"},{anchor:"transformers.LxmertConfig.task_qa",description:`<strong>task_qa</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add the question-answering loss to the objective`,name:"task_qa"},{anchor:"transformers.LxmertConfig.visual_obj_loss",description:`<strong>visual_obj_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the object-prediction loss objective`,name:"visual_obj_loss"},{anchor:"transformers.LxmertConfig.visual_attr_loss",description:`<strong>visual_attr_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the attribute-prediction loss objective`,name:"visual_attr_loss"},{anchor:"transformers.LxmertConfig.visual_feat_loss",description:`<strong>visual_feat_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the feature-regression loss objective`,name:"visual_feat_loss"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/configuration_lxmert.py#L29"}}),te=new je({props:{title:"LxmertTokenizer",local:"transformers.LxmertTokenizer",headingTag:"h2"}}),X=new U({props:{name:"class transformers.LxmertTokenizer",anchor:"transformers.LxmertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.LxmertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.LxmertTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.LxmertTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.LxmertTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LxmertTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LxmertTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LxmertTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LxmertTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LxmertTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.LxmertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original Lxmert).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert.py#L67"}}),A=new U({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert.py#L200",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),Je=new U({props:{name:"convert_tokens_to_string",anchor:"transformers.LxmertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert.py#L195"}}),Re=new U({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert.py#L253",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),We=new Jt({props:{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Oo]},$$scope:{ctx:z}}}),u=new U({props:{name:"get_special_tokens_mask",anchor:"transformers.LxmertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.LxmertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert.py#L225",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),D=new je({props:{title:"LxmertTokenizerFast",local:"transformers.LxmertTokenizerFast",headingTag:"h2"}}),ut=new U({props:{name:"class transformers.LxmertTokenizerFast",anchor:"transformers.LxmertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.LxmertTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.LxmertTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LxmertTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LxmertTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LxmertTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LxmertTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LxmertTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.LxmertTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.LxmertTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original Lxmert).`,name:"strip_accents"},{anchor:"transformers.LxmertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L48"}}),pt=new U({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LxmertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L136",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),ht=new U({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L160",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),it=new Jt({props:{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[Ao]},$$scope:{ctx:z}}}),ft=new je({props:{title:"Lxmert specific outputs",local:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",headingTag:"h2"}}),gt=new U({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",parameters:[{name:"language_output",val:": Optional = None"},{name:"vision_output",val:": Optional = None"},{name:"pooled_output",val:": Optional = None"},{name:"language_hidden_states",val:": Optional = None"},{name:"vision_hidden_states",val:": Optional = None"},{name:"language_attentions",val:": Optional = None"},{name:"vision_attentions",val:": Optional = None"},{name:"cross_encoder_attentions",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_output",description:`<strong>language_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the language encoder.`,name:"language_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_output",description:`<strong>vision_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the visual encoder.`,name:"vision_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.pooled_output",description:`<strong>pooled_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear`,name:"pooled_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_hidden_states",description:`<strong>language_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_hidden_states",description:`<strong>vision_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_attentions",description:`<strong>language_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_attentions",description:`<strong>vision_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.cross_encoder_attentions",description:`<strong>cross_encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L59"}}),_t=new U({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",parameters:[{name:"loss",val:": Optional = None"},{name:"prediction_logits",val:": Optional = None"},{name:"cross_relationship_score",val:": Optional = None"},{name:"question_answering_score",val:": Optional = None"},{name:"language_hidden_states",val:": Optional = None"},{name:"vision_hidden_states",val:": Optional = None"},{name:"language_attentions",val:": Optional = None"},{name:"vision_attentions",val:": Optional = None"},{name:"cross_encoder_attentions",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.cross_relationship_score",description:`<strong>cross_relationship_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).`,name:"cross_relationship_score"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.question_answering_score",description:`<strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>) &#x2014;
Prediction scores of question answering objective (classification).`,name:"question_answering_score"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_attentions",description:`<strong>language_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L145"}}),Tt=new U({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",parameters:[{name:"loss",val:": Optional = None"},{name:"question_answering_score",val:": Optional = None"},{name:"language_hidden_states",val:": Optional = None"},{name:"vision_hidden_states",val:": Optional = None"},{name:"language_attentions",val:": Optional = None"},{name:"vision_attentions",val:": Optional = None"},{name:"cross_encoder_attentions",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.question_answering_score",description:`<strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>) &#x2014;
Prediction scores of question answering objective (classification).`,name:"question_answering_score"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_hidden_states",description:`<strong>language_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_hidden_states",description:`<strong>vision_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_attentions",description:`<strong>language_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_attentions",description:`<strong>vision_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.cross_encoder_attentions",description:`<strong>cross_encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_lxmert.py#L105"}}),xt=new U({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",parameters:[{name:"language_output",val:": tf.Tensor | None = None"},{name:"vision_output",val:": tf.Tensor | None = None"},{name:"pooled_output",val:": tf.Tensor | None = None"},{name:"language_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"language_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"cross_encoder_attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_output",description:`<strong>language_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the language encoder.`,name:"language_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_output",description:`<strong>vision_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the visual encoder.`,name:"vision_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.pooled_output",description:`<strong>pooled_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear`,name:"pooled_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L60"}}),vt=new U({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",parameters:[{name:"loss",val:": tf.Tensor | None = None"},{name:"prediction_logits",val:": tf.Tensor | None = None"},{name:"cross_relationship_score",val:": tf.Tensor | None = None"},{name:"question_answering_score",val:": tf.Tensor | None = None"},{name:"language_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"language_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"cross_encoder_attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.cross_relationship_score",description:`<strong>cross_relationship_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).`,name:"cross_relationship_score"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.question_answering_score",description:`<strong>question_answering_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>) &#x2014;
Prediction scores of question answering objective (classification).`,name:"question_answering_score"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.37.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L106"}}),lt=new Io({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Go],pytorch:[Do]},$$scope:{ctx:z}}}),{c(){t=l("meta"),g=r(),o=l("p"),c=r(),T(y.$$.fragment),i=r(),T(L.$$.fragment),Y=r(),F=l("p"),F.innerHTML=W,K=r(),q=l("p"),q.textContent=E,ee=r(),h=l("p"),h.innerHTML=I,V=r(),O=l("p"),O.innerHTML=ye,ge=r(),T(ae.$$.fragment),Ae=r(),Q=l("ul"),Q.innerHTML=_e,ie=r(),T(B.$$.fragment),le=r(),Z=l("ul"),Z.innerHTML=R,j=r(),T(G.$$.fragment),Te=r(),S=l("div"),T(Le.$$.fragment),$e=r(),ue=l("p"),ue.innerHTML=Qe,Me=r(),pe=l("p"),pe.innerHTML=Ze,de=r(),T(te.$$.fragment),oe=r(),C=l("div"),T(X.$$.fragment),ne=r(),qe=l("p"),qe.textContent=Ce,xe=r(),ve=l("p"),ve.innerHTML=f,$=r(),N=l("div"),T(A.$$.fragment),P=r(),ce=l("p"),ce.textContent=Ge,Ee=r(),Ye=l("ul"),Ye.innerHTML=wt,Ue=r(),He=l("div"),T(Je.$$.fragment),De=r(),Ke=l("p"),Ke.textContent=kt,Xe=r(),be=l("div"),T(Re.$$.fragment),he=r(),ze=l("p"),ze.textContent=yt,Ve=r(),T(We.$$.fragment),mt=r(),we=l("p"),we.innerHTML=Lt,Ne=r(),Pe=l("div"),T(u.$$.fragment),M=r(),se=l("p"),se.innerHTML=re,Fe=r(),T(D.$$.fragment),fe=r(),ke=l("div"),T(ut.$$.fragment),no=r(),$t=l("p"),$t.innerHTML=To,so=r(),Mt=l("p"),Mt.innerHTML=xo,ro=r(),Be=l("div"),T(pt.$$.fragment),ao=r(),zt=l("p"),zt.textContent=vo,io=r(),Ft=l("ul"),Ft.innerHTML=bo,lo=r(),Ie=l("div"),T(ht.$$.fragment),co=r(),qt=l("p"),qt.textContent=wo,mo=r(),T(it.$$.fragment),uo=r(),Ct=l("p"),Ct.innerHTML=ko,Wt=r(),T(ft.$$.fragment),Et=r(),et=l("div"),T(gt.$$.fragment),po=r(),Pt=l("p"),Pt.textContent=yo,Ut=r(),tt=l("div"),T(_t.$$.fragment),ho=r(),jt=l("p"),jt.innerHTML=Lo,Dt=r(),ot=l("div"),T(Tt.$$.fragment),fo=r(),Nt=l("p"),Nt.innerHTML=$o,Xt=r(),nt=l("div"),T(xt.$$.fragment),go=r(),It=l("p"),It.textContent=Mo,Vt=r(),st=l("div"),T(vt.$$.fragment),_o=r(),Ot=l("p"),Ot.innerHTML=zo,Bt=r(),T(lt.$$.fragment),St=r(),Ht=l("p"),this.h()},l(e){const _=No("svelte-u9bgzb",document.head);t=d(_,"META",{name:!0,content:!0}),_.forEach(s),g=a(e),o=d(e,"P",{}),H(o).forEach(s),c=a(e),x(y.$$.fragment,e),i=a(e),x(L.$$.fragment,e),Y=a(e),F=d(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-1tklr6d"&&(F.innerHTML=W),K=a(e),q=d(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-vfdo9a"&&(q.textContent=E),ee=a(e),h=d(e,"P",{"data-svelte-h":!0}),p(h)!=="svelte-in8h9j"&&(h.innerHTML=I),V=a(e),O=d(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-10qftla"&&(O.innerHTML=ye),ge=a(e),x(ae.$$.fragment,e),Ae=a(e),Q=d(e,"UL",{"data-svelte-h":!0}),p(Q)!=="svelte-1fnxla1"&&(Q.innerHTML=_e),ie=a(e),x(B.$$.fragment,e),le=a(e),Z=d(e,"UL",{"data-svelte-h":!0}),p(Z)!=="svelte-18r7tt6"&&(Z.innerHTML=R),j=a(e),x(G.$$.fragment,e),Te=a(e),S=d(e,"DIV",{class:!0});var rt=H(S);x(Le.$$.fragment,rt),$e=a(rt),ue=d(rt,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-10bzit0"&&(ue.innerHTML=Qe),Me=a(rt),pe=d(rt,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-1chy751"&&(pe.innerHTML=Ze),rt.forEach(s),de=a(e),x(te.$$.fragment,e),oe=a(e),C=d(e,"DIV",{class:!0});var me=H(C);x(X.$$.fragment,me),ne=a(me),qe=d(me,"P",{"data-svelte-h":!0}),p(qe)!=="svelte-19b2nlj"&&(qe.textContent=Ce),xe=a(me),ve=d(me,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-19kasw8"&&(ve.innerHTML=f),$=a(me),N=d(me,"DIV",{class:!0});var at=H(N);x(A.$$.fragment,at),P=a(at),ce=d(at,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-nyg2yp"&&(ce.textContent=Ge),Ee=a(at),Ye=d(at,"UL",{"data-svelte-h":!0}),p(Ye)!=="svelte-xi6653"&&(Ye.innerHTML=wt),at.forEach(s),Ue=a(me),He=d(me,"DIV",{class:!0});var Zt=H(He);x(Je.$$.fragment,Zt),De=a(Zt),Ke=d(Zt,"P",{"data-svelte-h":!0}),p(Ke)!=="svelte-b3k2yi"&&(Ke.textContent=kt),Zt.forEach(s),Xe=a(me),be=d(me,"DIV",{class:!0});var dt=H(be);x(Re.$$.fragment,dt),he=a(dt),ze=d(dt,"P",{"data-svelte-h":!0}),p(ze)!=="svelte-11ai4yg"&&(ze.textContent=yt),Ve=a(dt),x(We.$$.fragment,dt),mt=a(dt),we=d(dt,"P",{"data-svelte-h":!0}),p(we)!=="svelte-owoxgn"&&(we.innerHTML=Lt),dt.forEach(s),Ne=a(me),Pe=d(me,"DIV",{class:!0});var Gt=H(Pe);x(u.$$.fragment,Gt),M=a(Gt),se=d(Gt,"P",{"data-svelte-h":!0}),p(se)!=="svelte-1f4f5kp"&&(se.innerHTML=re),Gt.forEach(s),me.forEach(s),Fe=a(e),x(D.$$.fragment,e),fe=a(e),ke=d(e,"DIV",{class:!0});var Se=H(ke);x(ut.$$.fragment,Se),no=a(Se),$t=d(Se,"P",{"data-svelte-h":!0}),p($t)!=="svelte-rdbmlc"&&($t.innerHTML=To),so=a(Se),Mt=d(Se,"P",{"data-svelte-h":!0}),p(Mt)!=="svelte-16r6k2c"&&(Mt.innerHTML=xo),ro=a(Se),Be=d(Se,"DIV",{class:!0});var At=H(Be);x(pt.$$.fragment,At),ao=a(At),zt=d(At,"P",{"data-svelte-h":!0}),p(zt)!=="svelte-nyg2yp"&&(zt.textContent=vo),io=a(At),Ft=d(At,"UL",{"data-svelte-h":!0}),p(Ft)!=="svelte-xi6653"&&(Ft.innerHTML=bo),At.forEach(s),lo=a(Se),Ie=d(Se,"DIV",{class:!0});var ct=H(Ie);x(ht.$$.fragment,ct),co=a(ct),qt=d(ct,"P",{"data-svelte-h":!0}),p(qt)!=="svelte-11ai4yg"&&(qt.textContent=wo),mo=a(ct),x(it.$$.fragment,ct),uo=a(ct),Ct=d(ct,"P",{"data-svelte-h":!0}),p(Ct)!=="svelte-owoxgn"&&(Ct.innerHTML=ko),ct.forEach(s),Se.forEach(s),Wt=a(e),x(ft.$$.fragment,e),Et=a(e),et=d(e,"DIV",{class:!0});var Yt=H(et);x(gt.$$.fragment,Yt),po=a(Yt),Pt=d(Yt,"P",{"data-svelte-h":!0}),p(Pt)!=="svelte-1cjb6gy"&&(Pt.textContent=yo),Yt.forEach(s),Ut=a(e),tt=d(e,"DIV",{class:!0});var Kt=H(tt);x(_t.$$.fragment,Kt),ho=a(Kt),jt=d(Kt,"P",{"data-svelte-h":!0}),p(jt)!=="svelte-1lzvrtp"&&(jt.innerHTML=Lo),Kt.forEach(s),Dt=a(e),ot=d(e,"DIV",{class:!0});var eo=H(ot);x(Tt.$$.fragment,eo),fo=a(eo),Nt=d(eo,"P",{"data-svelte-h":!0}),p(Nt)!=="svelte-1k0xudv"&&(Nt.innerHTML=$o),eo.forEach(s),Xt=a(e),nt=d(e,"DIV",{class:!0});var to=H(nt);x(xt.$$.fragment,to),go=a(to),It=d(to,"P",{"data-svelte-h":!0}),p(It)!=="svelte-1cjb6gy"&&(It.textContent=Mo),to.forEach(s),Vt=a(e),st=d(e,"DIV",{class:!0});var oo=H(st);x(vt.$$.fragment,oo),_o=a(oo),Ot=d(oo,"P",{"data-svelte-h":!0}),p(Ot)!=="svelte-1lzvrtp"&&(Ot.innerHTML=zo),oo.forEach(s),Bt=a(e),x(lt.$$.fragment,e),St=a(e),Ht=d(e,"P",{}),H(Ht).forEach(s),this.h()},h(){J(t,"name","hf:doc:metadata"),J(t,"content",Ko),J(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,_){n(document.head,t),m(e,g,_),m(e,o,_),m(e,c,_),v(y,e,_),m(e,i,_),v(L,e,_),m(e,Y,_),m(e,F,_),m(e,K,_),m(e,q,_),m(e,ee,_),m(e,h,_),m(e,V,_),m(e,O,_),m(e,ge,_),v(ae,e,_),m(e,Ae,_),m(e,Q,_),m(e,ie,_),v(B,e,_),m(e,le,_),m(e,Z,_),m(e,j,_),v(G,e,_),m(e,Te,_),m(e,S,_),v(Le,S,null),n(S,$e),n(S,ue),n(S,Me),n(S,pe),m(e,de,_),v(te,e,_),m(e,oe,_),m(e,C,_),v(X,C,null),n(C,ne),n(C,qe),n(C,xe),n(C,ve),n(C,$),n(C,N),v(A,N,null),n(N,P),n(N,ce),n(N,Ee),n(N,Ye),n(C,Ue),n(C,He),v(Je,He,null),n(He,De),n(He,Ke),n(C,Xe),n(C,be),v(Re,be,null),n(be,he),n(be,ze),n(be,Ve),v(We,be,null),n(be,mt),n(be,we),n(C,Ne),n(C,Pe),v(u,Pe,null),n(Pe,M),n(Pe,se),m(e,Fe,_),v(D,e,_),m(e,fe,_),m(e,ke,_),v(ut,ke,null),n(ke,no),n(ke,$t),n(ke,so),n(ke,Mt),n(ke,ro),n(ke,Be),v(pt,Be,null),n(Be,ao),n(Be,zt),n(Be,io),n(Be,Ft),n(ke,lo),n(ke,Ie),v(ht,Ie,null),n(Ie,co),n(Ie,qt),n(Ie,mo),v(it,Ie,null),n(Ie,uo),n(Ie,Ct),m(e,Wt,_),v(ft,e,_),m(e,Et,_),m(e,et,_),v(gt,et,null),n(et,po),n(et,Pt),m(e,Ut,_),m(e,tt,_),v(_t,tt,null),n(tt,ho),n(tt,jt),m(e,Dt,_),m(e,ot,_),v(Tt,ot,null),n(ot,fo),n(ot,Nt),m(e,Xt,_),m(e,nt,_),v(xt,nt,null),n(nt,go),n(nt,It),m(e,Vt,_),m(e,st,_),v(vt,st,null),n(st,_o),n(st,Ot),m(e,Bt,_),v(lt,e,_),m(e,St,_),m(e,Ht,_),Qt=!0},p(e,[_]){const rt={};_&2&&(rt.$$scope={dirty:_,ctx:e}),We.$set(rt);const me={};_&2&&(me.$$scope={dirty:_,ctx:e}),it.$set(me);const at={};_&2&&(at.$$scope={dirty:_,ctx:e}),lt.$set(at)},i(e){Qt||(b(y.$$.fragment,e),b(L.$$.fragment,e),b(ae.$$.fragment,e),b(B.$$.fragment,e),b(G.$$.fragment,e),b(Le.$$.fragment,e),b(te.$$.fragment,e),b(X.$$.fragment,e),b(A.$$.fragment,e),b(Je.$$.fragment,e),b(Re.$$.fragment,e),b(We.$$.fragment,e),b(u.$$.fragment,e),b(D.$$.fragment,e),b(ut.$$.fragment,e),b(pt.$$.fragment,e),b(ht.$$.fragment,e),b(it.$$.fragment,e),b(ft.$$.fragment,e),b(gt.$$.fragment,e),b(_t.$$.fragment,e),b(Tt.$$.fragment,e),b(xt.$$.fragment,e),b(vt.$$.fragment,e),b(lt.$$.fragment,e),Qt=!0)},o(e){w(y.$$.fragment,e),w(L.$$.fragment,e),w(ae.$$.fragment,e),w(B.$$.fragment,e),w(G.$$.fragment,e),w(Le.$$.fragment,e),w(te.$$.fragment,e),w(X.$$.fragment,e),w(A.$$.fragment,e),w(Je.$$.fragment,e),w(Re.$$.fragment,e),w(We.$$.fragment,e),w(u.$$.fragment,e),w(D.$$.fragment,e),w(ut.$$.fragment,e),w(pt.$$.fragment,e),w(ht.$$.fragment,e),w(it.$$.fragment,e),w(ft.$$.fragment,e),w(gt.$$.fragment,e),w(_t.$$.fragment,e),w(Tt.$$.fragment,e),w(xt.$$.fragment,e),w(vt.$$.fragment,e),w(lt.$$.fragment,e),Qt=!1},d(e){e&&(s(g),s(o),s(c),s(i),s(Y),s(F),s(K),s(q),s(ee),s(h),s(V),s(O),s(ge),s(Ae),s(Q),s(ie),s(le),s(Z),s(j),s(Te),s(S),s(de),s(oe),s(C),s(Fe),s(fe),s(ke),s(Wt),s(Et),s(et),s(Ut),s(tt),s(Dt),s(ot),s(Xt),s(nt),s(Vt),s(st),s(Bt),s(St),s(Ht)),s(t),k(y,e),k(L,e),k(ae,e),k(B,e),k(G,e),k(Le),k(te,e),k(X),k(A),k(Je),k(Re),k(We),k(u),k(D,e),k(ut),k(pt),k(ht),k(it),k(ft,e),k(gt),k(_t),k(Tt),k(xt),k(vt),k(lt,e)}}}const Ko='{"title":"LXMERT","local":"lxmert","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"LxmertConfig","local":"transformers.LxmertConfig","sections":[],"depth":2},{"title":"LxmertTokenizer","local":"transformers.LxmertTokenizer","sections":[],"depth":2},{"title":"LxmertTokenizerFast","local":"transformers.LxmertTokenizerFast","sections":[],"depth":2},{"title":"Lxmert specific outputs","local":"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput","sections":[],"depth":2},{"title":"LxmertModel","local":"transformers.LxmertModel","sections":[],"depth":2},{"title":"LxmertForPreTraining","local":"transformers.LxmertForPreTraining","sections":[],"depth":2},{"title":"LxmertForQuestionAnswering","local":"transformers.LxmertForQuestionAnswering","sections":[],"depth":2},{"title":"TFLxmertModel","local":"transformers.TFLxmertModel","sections":[],"depth":2},{"title":"TFLxmertForPreTraining","local":"transformers.TFLxmertForPreTraining","sections":[],"depth":2}],"depth":1}';function en(z){return Co(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class cn extends Po{constructor(t){super(),jo(this,t,en,Yo,qo,{})}}export{cn as component};
