import{s as Po,o as jo,n as Oe}from"../chunks/scheduler.25b97de1.js";import{S as No,i as Io,g as l,s as r,r as T,A as Oo,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 as b,d as v,t as w,w as k}from"../chunks/index.d9030fc9.js";import{T as wt}from"../chunks/Tip.baa67368.js";import{D as U}from"../chunks/Docstring.e257edda.js";import{C as Wt}from"../chunks/CodeBlock.e6cd0d95.js";import{F as Ao,M as Co}from"../chunks/Markdown.7217f838.js";import{E as Rt}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as je,E as Ho}from"../chunks/EditOnGithub.91d95064.js";function Jo(F){let t,_="pair mask has the following format:",o,c,y;return c=new Wt({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=_,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-qjgeij"&&(t.textContent=_),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),b(c,i,L),y=!0},p:Oe,i(i){y||(v(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(F){let t,_="pair mask has the following format:",o,c,y;return c=new Wt({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=_,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-qjgeij"&&(t.textContent=_),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),b(c,i,L),y=!0},p:Oe,i(i){y||(v(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Wo(F){let t,_=`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=_},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=_)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Eo(F){let t,_="Example:",o,c,y;return c=new Wt({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=_,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-11lpom8"&&(t.textContent=_),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),b(c,i,L),y=!0},p:Oe,i(i){y||(v(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(F){let t,_=`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=_},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=_)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Do(F){let t,_=`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=_},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=_)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Xo(F){let t,_="Example:",o,c,y;return c=new Wt({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=_,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-11lpom8"&&(t.textContent=_),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),b(c,i,L),y=!0},p:Oe,i(i){y||(v(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Vo(F){let t,_,o,c,y,i,L="The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top.",Y,z,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/pr_29693/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/pr_29693/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/pr_29693/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/pr_29693/en/model_doc/lxmert#transformers.LxmertForPreTraining">LxmertForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',be,g,$,N,A,P,ce,Ge,Ee,Ye="Lxmert Model with a visual-answering head on top for downstream QA tasks",kt,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/pr_29693/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.)`,yt,Xe,ve=`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,Fe,Lt,Ve,We='The <a href="/docs/transformers/pr_29693/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering">LxmertForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',mt,we,$t,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/pr_29693/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/pr_29693/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L875"}}),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/pr_29693/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_29693/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_29693/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/pr_29693/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L894",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/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 wt({props:{$$slots:{default:[Wo]},$$scope:{ctx:F}}}),B=new Rt({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[Eo]},$$scope:{ctx:F}}}),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/pr_29693/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/pr_29693/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L1013"}}),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/pr_29693/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_29693/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L1162",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),g=new wt({props:{$$slots:{default:[Uo]},$$scope:{ctx:F}}}),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/pr_29693/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/pr_29693/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L1297"}}),Fe=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/pr_29693/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_29693/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L1393",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/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 wt({props:{$$slots:{default:[Do]},$$scope:{ctx:F}}}),Ne=new Rt({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[Xo]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment),_=r(),o=l("div"),T(c.$$.fragment),y=r(),i=l("p"),i.textContent=L,Y=r(),z=l("p"),z.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,be=r(),T(g.$$.fragment),$=r(),T(N.$$.fragment),A=r(),P=l("div"),T(ce.$$.fragment),Ge=r(),Ee=l("p"),Ee.textContent=Ye,kt=r(),Ue=l("p"),Ue.innerHTML=He,Je=r(),De=l("p"),De.innerHTML=Ke,yt=r(),Xe=l("p"),Xe.innerHTML=ve,Re=r(),he=l("div"),T(Fe.$$.fragment),Lt=r(),Ve=l("p"),Ve.innerHTML=We,mt=r(),T(we.$$.fragment),$t=r(),T(Ne.$$.fragment),this.h()},l(u){x(t.$$.fragment,u),_=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),z=d(M,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1bbanmh"&&(z.innerHTML=W),K=a(M),q=d(M,"P",{"data-svelte-h":!0}),p(q)!=="svelte-17juf9p"&&(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-1xsh2f4"&&(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-17juf9p"&&(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 ze=H(X);x(ne.$$.fragment,ze),qe=a(ze),Ce=d(ze,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-bs4pc8"&&(Ce.innerHTML=xe),be=a(ze),x(g.$$.fragment,ze),ze.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),kt=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-17juf9p"&&(De.innerHTML=Ke),yt=a(D),Xe=d(D,"P",{"data-svelte-h":!0}),p(Xe)!=="svelte-hswkmf"&&(Xe.innerHTML=ve),Re=a(D),he=d(D,"DIV",{class:!0});var fe=H(he);x(Fe.$$.fragment,fe),Lt=a(fe),Ve=d(fe,"P",{"data-svelte-h":!0}),p(Ve)!=="svelte-1x5uoku"&&(Ve.innerHTML=We),mt=a(fe),x(we.$$.fragment,fe),$t=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){b(t,u,M),m(u,_,M),m(u,o,M),b(c,o,null),n(o,y),n(o,i),n(o,Y),n(o,z),n(o,K),n(o,q),n(o,ee),n(o,h),n(o,V),n(o,O),b(ye,O,null),n(O,ge),n(O,ae),n(O,Q),b(_e,O,null),n(O,ie),b(B,O,null),m(u,le,M),b(Z,u,M),m(u,R,M),m(u,j,M),b(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),b(ne,X,null),n(X,qe),n(X,Ce),n(X,be),b(g,X,null),m(u,$,M),b(N,u,M),m(u,A,M),m(u,P,M),b(ce,P,null),n(P,Ge),n(P,Ee),n(P,kt),n(P,Ue),n(P,Je),n(P,De),n(P,yt),n(P,Xe),n(P,Re),n(P,he),b(Fe,he,null),n(he,Lt),n(he,Ve),n(he,mt),b(we,he,null),n(he,$t),b(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 ze={};M&2&&(ze.$$scope={dirty:M,ctx:u}),g.$set(ze);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||(v(t.$$.fragment,u),v(c.$$.fragment,u),v(ye.$$.fragment,u),v(_e.$$.fragment,u),v(B.$$.fragment,u),v(Z.$$.fragment,u),v(G.$$.fragment,u),v(ne.$$.fragment,u),v(g.$$.fragment,u),v(N.$$.fragment,u),v(ce.$$.fragment,u),v(Fe.$$.fragment,u),v(we.$$.fragment,u),v(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(g.$$.fragment,u),w(N.$$.fragment,u),w(ce.$$.fragment,u),w(Fe.$$.fragment,u),w(we.$$.fragment,u),w(Ne.$$.fragment,u),Pe=!1},d(u){u&&(s(_),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(g),k(N,u),k(ce),k(Fe),k(we),k(Ne)}}}function Bo(F){let t,_;return t=new Co({props:{$$slots:{default:[Vo]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment)},l(o){x(t.$$.fragment,o)},m(o,c){b(t,o,c),_=!0},p(o,c){const y={};c&2&&(y.$$scope={dirty:c,ctx:o}),t.$set(y)},i(o){_||(v(t.$$.fragment,o),_=!0)},o(o){w(t.$$.fragment,o),_=!1},d(o){k(t,o)}}}function So(F){let t,_="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:`,z,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=_,o=r(),c=l("ul"),c.innerHTML=y,i=r(),L=l("p"),L.innerHTML=Y,z=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=_),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),z=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,z,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(z),s(W),s(q),s(E))}}}function Qo(F){let t,_=`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=_},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=_)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Zo(F){let t,_="Example:",o,c,y;return c=new Wt({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=_,o=r(),T(c.$$.fragment)},l(i){t=d(i,"P",{"data-svelte-h":!0}),p(t)!=="svelte-11lpom8"&&(t.textContent=_),o=a(i),x(c.$$.fragment,i)},m(i,L){m(i,t,L),m(i,o,L),b(c,i,L),y=!0},p:Oe,i(i){y||(v(c.$$.fragment,i),y=!0)},o(i){w(c.$$.fragment,i),y=!1},d(i){i&&(s(t),s(o)),k(c,i)}}}function Go(F){let t,_="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:`,z,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=_,o=r(),c=l("ul"),c.innerHTML=y,i=r(),L=l("p"),L.innerHTML=Y,z=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=_),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),z=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,z,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(z),s(W),s(q),s(E))}}}function Yo(F){let t,_=`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=_},l(o){t=d(o,"P",{"data-svelte-h":!0}),p(t)!=="svelte-fincs2"&&(t.innerHTML=_)},m(o,c){m(o,t,c)},p:Oe,d(o){o&&s(t)}}}function Ko(F){let t,_,o,c,y,i,L="The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top.",Y,z,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">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/pr_29693/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">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/pr_29693/en/model_doc/lxmert#transformers.TFLxmertForPreTraining">TFLxmertForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',Ce,xe,be;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/pr_29693/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/pr_29693/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1087"}}),h=new wt({props:{$$slots:{default:[So]},$$scope:{ctx:F}}}),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/pr_29693/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_29693/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1096",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/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 wt({props:{$$slots:{default:[Qo]},$$scope:{ctx:F}}}),ie=new Rt({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[Zo]},$$scope:{ctx:F}}}),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/pr_29693/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/pr_29693/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1394"}}),de=new wt({props:{$$slots:{default:[Go]},$$scope:{ctx:F}}}),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/pr_29693/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_29693/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1495",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/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 wt({props:{$$slots:{default:[Yo]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment),_=r(),o=l("div"),T(c.$$.fragment),y=r(),i=l("p"),i.textContent=L,Y=r(),z=l("p"),z.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(g){x(t.$$.fragment,g),_=a(g),o=d(g,"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($),z=d($,"P",{"data-svelte-h":!0}),p(z)!=="svelte-8ixyjl"&&(z.innerHTML=W),K=a($),q=d($,"P",{"data-svelte-h":!0}),p(q)!=="svelte-1be7e3c"&&(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-9qk7m0"&&(ge.innerHTML=ae),Ae=a(N),x(Q.$$.fragment,N),_e=a(N),x(ie.$$.fragment,N),N.forEach(s),$.forEach(s),B=a(g),x(le.$$.fragment,g),Z=a(g),R=d(g,"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-1be7e3c"&&(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-1mg559k"&&(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(g,$){b(t,g,$),m(g,_,$),m(g,o,$),b(c,o,null),n(o,y),n(o,i),n(o,Y),n(o,z),n(o,K),n(o,q),n(o,ee),b(h,o,null),n(o,I),n(o,V),b(O,V,null),n(V,ye),n(V,ge),n(V,Ae),b(Q,V,null),n(V,_e),b(ie,V,null),m(g,B,$),b(le,g,$),m(g,Z,$),m(g,R,$),b(j,R,null),n(R,G),n(R,Te),n(R,Le),n(R,$e),n(R,Qe),n(R,Me),n(R,Ze),b(de,R,null),n(R,te),n(R,oe),b(C,oe,null),n(oe,X),n(oe,ne),n(oe,Ce),b(xe,oe,null),be=!0},p(g,$){const N={};$&2&&(N.$$scope={dirty:$,ctx:g}),h.$set(N);const A={};$&2&&(A.$$scope={dirty:$,ctx:g}),Q.$set(A);const P={};$&2&&(P.$$scope={dirty:$,ctx:g}),ie.$set(P);const ce={};$&2&&(ce.$$scope={dirty:$,ctx:g}),de.$set(ce);const Ge={};$&2&&(Ge.$$scope={dirty:$,ctx:g}),xe.$set(Ge)},i(g){be||(v(t.$$.fragment,g),v(c.$$.fragment,g),v(h.$$.fragment,g),v(O.$$.fragment,g),v(Q.$$.fragment,g),v(ie.$$.fragment,g),v(le.$$.fragment,g),v(j.$$.fragment,g),v(de.$$.fragment,g),v(C.$$.fragment,g),v(xe.$$.fragment,g),be=!0)},o(g){w(t.$$.fragment,g),w(c.$$.fragment,g),w(h.$$.fragment,g),w(O.$$.fragment,g),w(Q.$$.fragment,g),w(ie.$$.fragment,g),w(le.$$.fragment,g),w(j.$$.fragment,g),w(de.$$.fragment,g),w(C.$$.fragment,g),w(xe.$$.fragment,g),be=!1},d(g){g&&(s(_),s(o),s(B),s(Z),s(R)),k(t,g),k(c),k(h),k(O),k(Q),k(ie),k(le,g),k(j),k(de),k(C),k(xe)}}}function en(F){let t,_;return t=new Co({props:{$$slots:{default:[Ko]},$$scope:{ctx:F}}}),{c(){T(t.$$.fragment)},l(o){x(t.$$.fragment,o)},m(o,c){b(t,o,c),_=!0},p(o,c){const y={};c&2&&(y.$$scope={dirty:c,ctx:o}),t.$set(y)},i(o){_||(v(t.$$.fragment,o),_=!0)},o(o){w(t.$$.fragment,o),_=!1},d(o){k(t,o)}}}function tn(F){let t,_,o,c,y,i,L,Y,z,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/pr_29693/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or a <a href="/docs/transformers/pr_29693/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/pr_29693/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_29693/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,be,g=`This tokenizer inherits from <a href="/docs/transformers/pr_29693/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,kt="<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,yt="Converts a sequence of tokens (string) in a single string.",Xe,ve,Re,he,Fe,Lt="Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert sequence",Ve,We,mt,we,$t="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.`,ze,D,fe,ke,ut,ro,Mt,bo="Construct a “fast” Lxmert tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on WordPiece.",ao,Ft,vo=`This tokenizer inherits from <a href="/docs/transformers/pr_29693/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.`,io,Be,pt,lo,zt,wo=`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:`,co,qt,ko="<li>single sequence: <code>[CLS] X [SEP]</code></li> <li>pair of sequences: <code>[CLS] A [SEP] B [SEP]</code></li>",mo,Ie,ht,uo,Ct,yo="Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert sequence",po,it,ho,Pt,Lo="If <code>token_ids_1</code> is <code>None</code>, this method only returns the first portion of the mask (0s).",Et,ft,Ut,et,gt,fo,jt,$o=`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”)`,Dt,tt,_t,go,Nt,Mo='Output type of <a href="/docs/transformers/pr_29693/en/model_doc/lxmert#transformers.LxmertForPreTraining">LxmertForPreTraining</a>.',Xt,ot,Tt,_o,It,Fo='Output type of <a href="/docs/transformers/pr_29693/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering">LxmertForQuestionAnswering</a>.',Vt,nt,xt,To,Ot,zo=`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”)`,Bt,st,bt,xo,At,qo='Output type of <a href="/docs/transformers/pr_29693/en/model_doc/lxmert#transformers.LxmertForPreTraining">LxmertForPreTraining</a>.',St,lt,Qt,vt,Zt,Jt,Gt;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/pr_29693/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/lxmert/configuration_lxmert.py#L24"}}),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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert.py#L53"}}),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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert.py#L183",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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert.py#L178"}}),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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert.py#L236",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 Rt({props:{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Jo]},$$scope:{ctx:F}}}),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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert.py#L208",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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L29"}}),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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L114",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/vr_29693/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L138",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 Rt({props:{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[Ro]},$$scope:{ctx:F}}}),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/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L54"}}),_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/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L140"}}),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/vr_29693/src/transformers/models/lxmert/modeling_lxmert.py#L100"}}),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/vr_29693/src/transformers/models/lxmert/modeling_tf_lxmert.py#L56"}}),bt=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/vr_29693/src/transformers/models/lxmert/modeling_tf_lxmert.py#L102"}}),lt=new Ao({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[en],pytorch:[Bo]},$$scope:{ctx:F}}}),vt=new Ho({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/lxmert.md"}}),{c(){t=l("meta"),_=r(),o=l("p"),c=r(),T(y.$$.fragment),i=r(),T(L.$$.fragment),Y=r(),z=l("p"),z.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(),be=l("p"),be.innerHTML=g,$=r(),N=l("div"),T(A.$$.fragment),P=r(),ce=l("p"),ce.textContent=Ge,Ee=r(),Ye=l("ul"),Ye.innerHTML=kt,Ue=r(),He=l("div"),T(Je.$$.fragment),De=r(),Ke=l("p"),Ke.textContent=yt,Xe=r(),ve=l("div"),T(Re.$$.fragment),he=r(),Fe=l("p"),Fe.textContent=Lt,Ve=r(),T(We.$$.fragment),mt=r(),we=l("p"),we.innerHTML=$t,Ne=r(),Pe=l("div"),T(u.$$.fragment),M=r(),se=l("p"),se.innerHTML=re,ze=r(),T(D.$$.fragment),fe=r(),ke=l("div"),T(ut.$$.fragment),ro=r(),Mt=l("p"),Mt.innerHTML=bo,ao=r(),Ft=l("p"),Ft.innerHTML=vo,io=r(),Be=l("div"),T(pt.$$.fragment),lo=r(),zt=l("p"),zt.textContent=wo,co=r(),qt=l("ul"),qt.innerHTML=ko,mo=r(),Ie=l("div"),T(ht.$$.fragment),uo=r(),Ct=l("p"),Ct.textContent=yo,po=r(),T(it.$$.fragment),ho=r(),Pt=l("p"),Pt.innerHTML=Lo,Et=r(),T(ft.$$.fragment),Ut=r(),et=l("div"),T(gt.$$.fragment),fo=r(),jt=l("p"),jt.textContent=$o,Dt=r(),tt=l("div"),T(_t.$$.fragment),go=r(),Nt=l("p"),Nt.innerHTML=Mo,Xt=r(),ot=l("div"),T(Tt.$$.fragment),_o=r(),It=l("p"),It.innerHTML=Fo,Vt=r(),nt=l("div"),T(xt.$$.fragment),To=r(),Ot=l("p"),Ot.textContent=zo,Bt=r(),st=l("div"),T(bt.$$.fragment),xo=r(),At=l("p"),At.innerHTML=qo,St=r(),T(lt.$$.fragment),Qt=r(),T(vt.$$.fragment),Zt=r(),Jt=l("p"),this.h()},l(e){const f=Oo("svelte-u9bgzb",document.head);t=d(f,"META",{name:!0,content:!0}),f.forEach(s),_=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),z=d(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1tklr6d"&&(z.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-ynd4kg"&&(ue.innerHTML=Qe),Me=a(rt),pe=d(rt,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-jtolpf"&&(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),be=d(me,"P",{"data-svelte-h":!0}),p(be)!=="svelte-101vljb"&&(be.innerHTML=g),$=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=kt),at.forEach(s),Ue=a(me),He=d(me,"DIV",{class:!0});var Yt=H(He);x(Je.$$.fragment,Yt),De=a(Yt),Ke=d(Yt,"P",{"data-svelte-h":!0}),p(Ke)!=="svelte-b3k2yi"&&(Ke.textContent=yt),Yt.forEach(s),Xe=a(me),ve=d(me,"DIV",{class:!0});var dt=H(ve);x(Re.$$.fragment,dt),he=a(dt),Fe=d(dt,"P",{"data-svelte-h":!0}),p(Fe)!=="svelte-11ai4yg"&&(Fe.textContent=Lt),Ve=a(dt),x(We.$$.fragment,dt),mt=a(dt),we=d(dt,"P",{"data-svelte-h":!0}),p(we)!=="svelte-owoxgn"&&(we.innerHTML=$t),dt.forEach(s),Ne=a(me),Pe=d(me,"DIV",{class:!0});var Kt=H(Pe);x(u.$$.fragment,Kt),M=a(Kt),se=d(Kt,"P",{"data-svelte-h":!0}),p(se)!=="svelte-1f4f5kp"&&(se.innerHTML=re),Kt.forEach(s),me.forEach(s),ze=a(e),x(D.$$.fragment,e),fe=a(e),ke=d(e,"DIV",{class:!0});var Se=H(ke);x(ut.$$.fragment,Se),ro=a(Se),Mt=d(Se,"P",{"data-svelte-h":!0}),p(Mt)!=="svelte-rdbmlc"&&(Mt.innerHTML=bo),ao=a(Se),Ft=d(Se,"P",{"data-svelte-h":!0}),p(Ft)!=="svelte-cl4xsz"&&(Ft.innerHTML=vo),io=a(Se),Be=d(Se,"DIV",{class:!0});var Ht=H(Be);x(pt.$$.fragment,Ht),lo=a(Ht),zt=d(Ht,"P",{"data-svelte-h":!0}),p(zt)!=="svelte-nyg2yp"&&(zt.textContent=wo),co=a(Ht),qt=d(Ht,"UL",{"data-svelte-h":!0}),p(qt)!=="svelte-xi6653"&&(qt.innerHTML=ko),Ht.forEach(s),mo=a(Se),Ie=d(Se,"DIV",{class:!0});var ct=H(Ie);x(ht.$$.fragment,ct),uo=a(ct),Ct=d(ct,"P",{"data-svelte-h":!0}),p(Ct)!=="svelte-11ai4yg"&&(Ct.textContent=yo),po=a(ct),x(it.$$.fragment,ct),ho=a(ct),Pt=d(ct,"P",{"data-svelte-h":!0}),p(Pt)!=="svelte-owoxgn"&&(Pt.innerHTML=Lo),ct.forEach(s),Se.forEach(s),Et=a(e),x(ft.$$.fragment,e),Ut=a(e),et=d(e,"DIV",{class:!0});var eo=H(et);x(gt.$$.fragment,eo),fo=a(eo),jt=d(eo,"P",{"data-svelte-h":!0}),p(jt)!=="svelte-1cjb6gy"&&(jt.textContent=$o),eo.forEach(s),Dt=a(e),tt=d(e,"DIV",{class:!0});var to=H(tt);x(_t.$$.fragment,to),go=a(to),Nt=d(to,"P",{"data-svelte-h":!0}),p(Nt)!=="svelte-4on0j2"&&(Nt.innerHTML=Mo),to.forEach(s),Xt=a(e),ot=d(e,"DIV",{class:!0});var oo=H(ot);x(Tt.$$.fragment,oo),_o=a(oo),It=d(oo,"P",{"data-svelte-h":!0}),p(It)!=="svelte-fadv8w"&&(It.innerHTML=Fo),oo.forEach(s),Vt=a(e),nt=d(e,"DIV",{class:!0});var no=H(nt);x(xt.$$.fragment,no),To=a(no),Ot=d(no,"P",{"data-svelte-h":!0}),p(Ot)!=="svelte-1cjb6gy"&&(Ot.textContent=zo),no.forEach(s),Bt=a(e),st=d(e,"DIV",{class:!0});var so=H(st);x(bt.$$.fragment,so),xo=a(so),At=d(so,"P",{"data-svelte-h":!0}),p(At)!=="svelte-4on0j2"&&(At.innerHTML=qo),so.forEach(s),St=a(e),x(lt.$$.fragment,e),Qt=a(e),x(vt.$$.fragment,e),Zt=a(e),Jt=d(e,"P",{}),H(Jt).forEach(s),this.h()},h(){J(t,"name","hf:doc:metadata"),J(t,"content",on),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(ve,"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,f){n(document.head,t),m(e,_,f),m(e,o,f),m(e,c,f),b(y,e,f),m(e,i,f),b(L,e,f),m(e,Y,f),m(e,z,f),m(e,K,f),m(e,q,f),m(e,ee,f),m(e,h,f),m(e,V,f),m(e,O,f),m(e,ge,f),b(ae,e,f),m(e,Ae,f),m(e,Q,f),m(e,ie,f),b(B,e,f),m(e,le,f),m(e,Z,f),m(e,j,f),b(G,e,f),m(e,Te,f),m(e,S,f),b(Le,S,null),n(S,$e),n(S,ue),n(S,Me),n(S,pe),m(e,de,f),b(te,e,f),m(e,oe,f),m(e,C,f),b(X,C,null),n(C,ne),n(C,qe),n(C,xe),n(C,be),n(C,$),n(C,N),b(A,N,null),n(N,P),n(N,ce),n(N,Ee),n(N,Ye),n(C,Ue),n(C,He),b(Je,He,null),n(He,De),n(He,Ke),n(C,Xe),n(C,ve),b(Re,ve,null),n(ve,he),n(ve,Fe),n(ve,Ve),b(We,ve,null),n(ve,mt),n(ve,we),n(C,Ne),n(C,Pe),b(u,Pe,null),n(Pe,M),n(Pe,se),m(e,ze,f),b(D,e,f),m(e,fe,f),m(e,ke,f),b(ut,ke,null),n(ke,ro),n(ke,Mt),n(ke,ao),n(ke,Ft),n(ke,io),n(ke,Be),b(pt,Be,null),n(Be,lo),n(Be,zt),n(Be,co),n(Be,qt),n(ke,mo),n(ke,Ie),b(ht,Ie,null),n(Ie,uo),n(Ie,Ct),n(Ie,po),b(it,Ie,null),n(Ie,ho),n(Ie,Pt),m(e,Et,f),b(ft,e,f),m(e,Ut,f),m(e,et,f),b(gt,et,null),n(et,fo),n(et,jt),m(e,Dt,f),m(e,tt,f),b(_t,tt,null),n(tt,go),n(tt,Nt),m(e,Xt,f),m(e,ot,f),b(Tt,ot,null),n(ot,_o),n(ot,It),m(e,Vt,f),m(e,nt,f),b(xt,nt,null),n(nt,To),n(nt,Ot),m(e,Bt,f),m(e,st,f),b(bt,st,null),n(st,xo),n(st,At),m(e,St,f),b(lt,e,f),m(e,Qt,f),b(vt,e,f),m(e,Zt,f),m(e,Jt,f),Gt=!0},p(e,[f]){const rt={};f&2&&(rt.$$scope={dirty:f,ctx:e}),We.$set(rt);const me={};f&2&&(me.$$scope={dirty:f,ctx:e}),it.$set(me);const at={};f&2&&(at.$$scope={dirty:f,ctx:e}),lt.$set(at)},i(e){Gt||(v(y.$$.fragment,e),v(L.$$.fragment,e),v(ae.$$.fragment,e),v(B.$$.fragment,e),v(G.$$.fragment,e),v(Le.$$.fragment,e),v(te.$$.fragment,e),v(X.$$.fragment,e),v(A.$$.fragment,e),v(Je.$$.fragment,e),v(Re.$$.fragment,e),v(We.$$.fragment,e),v(u.$$.fragment,e),v(D.$$.fragment,e),v(ut.$$.fragment,e),v(pt.$$.fragment,e),v(ht.$$.fragment,e),v(it.$$.fragment,e),v(ft.$$.fragment,e),v(gt.$$.fragment,e),v(_t.$$.fragment,e),v(Tt.$$.fragment,e),v(xt.$$.fragment,e),v(bt.$$.fragment,e),v(lt.$$.fragment,e),v(vt.$$.fragment,e),Gt=!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(bt.$$.fragment,e),w(lt.$$.fragment,e),w(vt.$$.fragment,e),Gt=!1},d(e){e&&(s(_),s(o),s(c),s(i),s(Y),s(z),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(ze),s(fe),s(ke),s(Et),s(Ut),s(et),s(Dt),s(tt),s(Xt),s(ot),s(Vt),s(nt),s(Bt),s(st),s(St),s(Qt),s(Zt),s(Jt)),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(bt),k(lt,e),k(vt,e)}}}const on='{"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 nn(F){return jo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pn extends No{constructor(t){super(),Io(this,t,nn,tn,Po,{})}}export{pn as component};
