import{S as lu,i as du,s as cu,e as n,k as l,w as b,t as a,M as mu,c as s,d as t,m as d,a as r,x,h as i,b as m,G as e,g as h,y as w,q as y,o as k,B as L,v as uu,L as mr}from"../../chunks/vendor-hf-doc-builder.js";import{T as zn}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ur}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ue}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as cr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function hu(A){let u,$,g,_,v;return _=new ur({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 |`}}),{c(){u=n("p"),$=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"sequence pair mask has the following format:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function pu(A){let u,$,g,_,v;return _=new ur({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 |`}}),{c(){u=n("p"),$=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"sequence pair mask has the following format:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function fu(A){let u,$,g,_,v;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var z=r(g);_=i(z,"Module"),z.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,v)},d(c){c&&t(u)}}}function gu(A){let u,$,g,_,v;return _=new ur({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`}}),{c(){u=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function _u(A){let u,$,g,_,v;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var z=r(g);_=i(z,"Module"),z.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,v)},d(c){c&&t(u)}}}function Tu(A){let u,$,g,_,v;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var z=r(g);_=i(z,"Module"),z.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,v)},d(c){c&&t(u)}}}function vu(A){let u,$,g,_,v;return _=new ur({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`}}),{c(){u=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function bu(A){let u,$,g,_,v,c,f,z,Ve,Fe,I,oe,ae,M,Be,B,Qe,ze,J,Ge,ie,le,Ze,Ee,X,He,qe,U,we,Ye,Te,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,V,me,ue,tt,Q,he,pe,ot,ve,P,ne,R,fe,nt;return{c(){u=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),v=a(" accept two formats as input:"),c=l(),f=n("ul"),z=n("li"),Ve=a("having all inputs as keyword arguments (like PyTorch models), or"),Fe=l(),I=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),M=n("p"),Be=a(`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 `),B=n("code"),Qe=a("model.fit()"),ze=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=n("code"),Ge=a("model.fit()"),ie=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Ze=a("fit()"),Ee=a(" and "),X=n("code"),He=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),U=n("code"),we=a("Functional"),Ye=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Te=l(),q=n("ul"),j=n("li"),Pe=a("a single Tensor with "),N=n("code"),ye=a("input_ids"),Ke=a(" only and nothing else: "),de=n("code"),ke=a("model(input_ids)"),et=l(),D=n("li"),Le=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=n("code"),Ae=a("model([input_ids, attention_mask])"),V=a(" or "),me=n("code"),ue=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),Q=n("li"),he=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=n("code"),ot=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),R=n("a"),fe=a("subclassing"),nt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(T){u=s(T,"P",{});var F=r(u);$=i(F,"TensorFlow models and layers in "),g=s(F,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),v=i(F," accept two formats as input:"),F.forEach(t),c=d(T),f=s(T,"UL",{});var se=r(f);z=s(se,"LI",{});var st=r(z);Ve=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),Fe=d(se),I=s(se,"LI",{});var Ce=r(I);oe=i(Ce,"having all inputs as a list, tuple or dict in the first positional argument."),Ce.forEach(t),se.forEach(t),ae=d(T),M=s(T,"P",{});var E=r(M);Be=i(E,`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 `),B=s(E,"CODE",{});var it=r(B);Qe=i(it,"model.fit()"),it.forEach(t),ze=i(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=s(E,"CODE",{});var ge=r(J);Ge=i(ge,"model.fit()"),ge.forEach(t),ie=i(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=s(E,"CODE",{});var be=r(le);Ze=i(be,"fit()"),be.forEach(t),Ee=i(E," and "),X=s(E,"CODE",{});var rt=r(X);He=i(rt,"predict()"),rt.forEach(t),qe=i(E,`, such as when creating your own layers or models with
the Keras `),U=s(E,"CODE",{});var $e=r(U);we=i($e,"Functional"),$e.forEach(t),Ye=i(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),Te=d(T),q=s(T,"UL",{});var G=r(q);j=s(G,"LI",{});var Z=r(j);Pe=i(Z,"a single Tensor with "),N=s(Z,"CODE",{});var pt=r(N);ye=i(pt,"input_ids"),pt.forEach(t),Ke=i(Z," only and nothing else: "),de=s(Z,"CODE",{});var lt=r(de);ke=i(lt,"model(input_ids)"),lt.forEach(t),Z.forEach(t),et=d(G),D=s(G,"LI",{});var O=r(D);Le=i(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=s(O,"CODE",{});var Me=r(ce);Ae=i(Me,"model([input_ids, attention_mask])"),Me.forEach(t),V=i(O," or "),me=s(O,"CODE",{});var ft=r(me);ue=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),O.forEach(t),tt=d(G),Q=s(G,"LI",{});var S=r(Q);he=i(S,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(S,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),S.forEach(t),G.forEach(t),ve=d(T),P=s(T,"P",{});var re=r(P);ne=i(re,`Note that when creating models and layers with
`),R=s(re,"A",{href:!0,rel:!0});var _t=r(R);fe=i(_t,"subclassing"),_t.forEach(t),nt=i(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){m(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(T,F){h(T,u,F),e(u,$),e(u,g),e(g,_),e(u,v),h(T,c,F),h(T,f,F),e(f,z),e(z,Ve),e(f,Fe),e(f,I),e(I,oe),h(T,ae,F),h(T,M,F),e(M,Be),e(M,B),e(B,Qe),e(M,ze),e(M,J),e(J,Ge),e(M,ie),e(M,le),e(le,Ze),e(M,Ee),e(M,X),e(X,He),e(M,qe),e(M,U),e(U,we),e(M,Ye),h(T,Te,F),h(T,q,F),e(q,j),e(j,Pe),e(j,N),e(N,ye),e(j,Ke),e(j,de),e(de,ke),e(q,et),e(q,D),e(D,Le),e(D,ce),e(ce,Ae),e(D,V),e(D,me),e(me,ue),e(q,tt),e(q,Q),e(Q,he),e(Q,pe),e(pe,ot),h(T,ve,F),h(T,P,F),e(P,ne),e(P,R),e(R,fe),e(P,nt)},d(T){T&&t(u),T&&t(c),T&&t(f),T&&t(ae),T&&t(M),T&&t(Te),T&&t(q),T&&t(ve),T&&t(P)}}}function xu(A){let u,$,g,_,v;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var z=r(g);_=i(z,"Module"),z.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,v)},d(c){c&&t(u)}}}function wu(A){let u,$,g,_,v;return _=new ur({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`}}),{c(){u=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function yu(A){let u,$,g,_,v,c,f,z,Ve,Fe,I,oe,ae,M,Be,B,Qe,ze,J,Ge,ie,le,Ze,Ee,X,He,qe,U,we,Ye,Te,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,V,me,ue,tt,Q,he,pe,ot,ve,P,ne,R,fe,nt;return{c(){u=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),v=a(" accept two formats as input:"),c=l(),f=n("ul"),z=n("li"),Ve=a("having all inputs as keyword arguments (like PyTorch models), or"),Fe=l(),I=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),M=n("p"),Be=a(`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 `),B=n("code"),Qe=a("model.fit()"),ze=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=n("code"),Ge=a("model.fit()"),ie=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Ze=a("fit()"),Ee=a(" and "),X=n("code"),He=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),U=n("code"),we=a("Functional"),Ye=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Te=l(),q=n("ul"),j=n("li"),Pe=a("a single Tensor with "),N=n("code"),ye=a("input_ids"),Ke=a(" only and nothing else: "),de=n("code"),ke=a("model(input_ids)"),et=l(),D=n("li"),Le=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=n("code"),Ae=a("model([input_ids, attention_mask])"),V=a(" or "),me=n("code"),ue=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),Q=n("li"),he=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=n("code"),ot=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),R=n("a"),fe=a("subclassing"),nt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(T){u=s(T,"P",{});var F=r(u);$=i(F,"TensorFlow models and layers in "),g=s(F,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),v=i(F," accept two formats as input:"),F.forEach(t),c=d(T),f=s(T,"UL",{});var se=r(f);z=s(se,"LI",{});var st=r(z);Ve=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),Fe=d(se),I=s(se,"LI",{});var Ce=r(I);oe=i(Ce,"having all inputs as a list, tuple or dict in the first positional argument."),Ce.forEach(t),se.forEach(t),ae=d(T),M=s(T,"P",{});var E=r(M);Be=i(E,`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 `),B=s(E,"CODE",{});var it=r(B);Qe=i(it,"model.fit()"),it.forEach(t),ze=i(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=s(E,"CODE",{});var ge=r(J);Ge=i(ge,"model.fit()"),ge.forEach(t),ie=i(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=s(E,"CODE",{});var be=r(le);Ze=i(be,"fit()"),be.forEach(t),Ee=i(E," and "),X=s(E,"CODE",{});var rt=r(X);He=i(rt,"predict()"),rt.forEach(t),qe=i(E,`, such as when creating your own layers or models with
the Keras `),U=s(E,"CODE",{});var $e=r(U);we=i($e,"Functional"),$e.forEach(t),Ye=i(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),Te=d(T),q=s(T,"UL",{});var G=r(q);j=s(G,"LI",{});var Z=r(j);Pe=i(Z,"a single Tensor with "),N=s(Z,"CODE",{});var pt=r(N);ye=i(pt,"input_ids"),pt.forEach(t),Ke=i(Z," only and nothing else: "),de=s(Z,"CODE",{});var lt=r(de);ke=i(lt,"model(input_ids)"),lt.forEach(t),Z.forEach(t),et=d(G),D=s(G,"LI",{});var O=r(D);Le=i(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=s(O,"CODE",{});var Me=r(ce);Ae=i(Me,"model([input_ids, attention_mask])"),Me.forEach(t),V=i(O," or "),me=s(O,"CODE",{});var ft=r(me);ue=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),O.forEach(t),tt=d(G),Q=s(G,"LI",{});var S=r(Q);he=i(S,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(S,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),S.forEach(t),G.forEach(t),ve=d(T),P=s(T,"P",{});var re=r(P);ne=i(re,`Note that when creating models and layers with
`),R=s(re,"A",{href:!0,rel:!0});var _t=r(R);fe=i(_t,"subclassing"),_t.forEach(t),nt=i(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){m(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(T,F){h(T,u,F),e(u,$),e(u,g),e(g,_),e(u,v),h(T,c,F),h(T,f,F),e(f,z),e(z,Ve),e(f,Fe),e(f,I),e(I,oe),h(T,ae,F),h(T,M,F),e(M,Be),e(M,B),e(B,Qe),e(M,ze),e(M,J),e(J,Ge),e(M,ie),e(M,le),e(le,Ze),e(M,Ee),e(M,X),e(X,He),e(M,qe),e(M,U),e(U,we),e(M,Ye),h(T,Te,F),h(T,q,F),e(q,j),e(j,Pe),e(j,N),e(N,ye),e(j,Ke),e(j,de),e(de,ke),e(q,et),e(q,D),e(D,Le),e(D,ce),e(ce,Ae),e(D,V),e(D,me),e(me,ue),e(q,tt),e(q,Q),e(Q,he),e(Q,pe),e(pe,ot),h(T,ve,F),h(T,P,F),e(P,ne),e(P,R),e(R,fe),e(P,nt)},d(T){T&&t(u),T&&t(c),T&&t(f),T&&t(ae),T&&t(M),T&&t(Te),T&&t(q),T&&t(ve),T&&t(P)}}}function ku(A){let u,$,g,_,v;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var z=r(g);_=i(z,"Module"),z.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,v)},d(c){c&&t(u)}}}function Lu(A){let u,$,g,_,v,c,f,z,Ve,Fe,I,oe,ae,M,Be,B,Qe,ze,J,Ge,ie,le,Ze,Ee,X,He,qe,U,we,Ye,Te,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,V,me,ue,tt,Q,he,pe,ot,ve,P,ne,R,fe,nt,T,F,at,se,st,Ce,E,it,ge,be,rt,$e,G,Z,pt,lt,O,Me,ft,S,gt,re,_t,ba,En,xa,wa,po,ya,ka,La,Tt,$a,qn,Ma,Fa,Pn,za,Ea,hr,vt,Dt,ms,fo,qa,us,Pa,pr,W,go,Aa,hs,Ca,Oa,_o,Na,An,Ia,ja,Da,dt,To,Ra,ps,Ja,Sa,vo,Cn,Wa,fs,Xa,Ua,On,Va,gs,Ba,Qa,Rt,bo,Ga,_s,Za,Ha,Oe,xo,Ya,Ts,Ka,ei,Jt,ti,bt,oi,vs,ni,si,bs,ri,ai,ii,St,wo,li,yo,di,xs,ci,mi,fr,xt,Wt,ws,ko,ui,ys,hi,gr,_e,Lo,pi,$o,fi,ks,gi,_i,Ti,Mo,vi,Nn,bi,xi,wi,ct,Fo,yi,Ls,ki,Li,zo,In,$i,$s,Mi,Fi,jn,zi,Ms,Ei,qi,Ne,Eo,Pi,Fs,Ai,Ci,Xt,Oi,wt,Ni,zs,Ii,ji,Es,Di,Ri,_r,yt,Ut,qs,qo,Ji,Ps,Si,Tr,kt,Po,Wi,As,Xi,vr,Lt,Ao,Ui,Co,Vi,Dn,Bi,Qi,br,$t,Oo,Gi,No,Zi,Rn,Hi,Yi,xr,Mt,Io,Ki,Cs,el,wr,Ft,jo,tl,Do,ol,Jn,nl,sl,yr,zt,Vt,Os,Ro,rl,Ns,al,kr,H,Jo,il,Is,ll,dl,So,cl,Wo,ml,ul,hl,Xo,pl,Sn,fl,gl,_l,Uo,Tl,Vo,vl,bl,xl,Ie,Bo,wl,Et,yl,Wn,kl,Ll,js,$l,Ml,Fl,Bt,zl,Qt,Lr,qt,Gt,Ds,Qo,El,Rs,ql,$r,Y,Go,Pl,Js,Al,Cl,Zo,Ol,Ho,Nl,Il,jl,Yo,Dl,Xn,Rl,Jl,Sl,Ko,Wl,en,Xl,Ul,Vl,mt,tn,Bl,Pt,Ql,Un,Gl,Zl,Ss,Hl,Yl,Kl,Zt,Mr,At,Ht,Ws,on,ed,Xs,td,Fr,K,nn,od,Us,nd,sd,sn,rd,rn,ad,id,ld,an,dd,Vn,cd,md,ud,ln,hd,dn,pd,fd,gd,je,cn,_d,Ct,Td,Bn,vd,bd,Vs,xd,wd,yd,Yt,kd,Kt,zr,Ot,eo,Bs,mn,Ld,Qs,$d,Er,ee,un,Md,Gs,Fd,zd,hn,Ed,pn,qd,Pd,Ad,fn,Cd,gn,Od,Nd,Id,to,jd,De,_n,Dd,Nt,Rd,Qn,Jd,Sd,Zs,Wd,Xd,Ud,oo,Vd,no,qr,It,so,Hs,Tn,Bd,Ys,Qd,Pr,te,vn,Gd,bn,Zd,Ks,Hd,Yd,Kd,xn,ec,wn,tc,oc,nc,yn,sc,kn,rc,ac,ic,ro,lc,ut,Ln,dc,jt,cc,Gn,mc,uc,er,hc,pc,fc,ao,Ar;return c=new Ue({}),M=new Ue({}),fe=new Ue({}),$e=new Ue({}),Me=new C({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/main/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/main/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.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.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.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{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/main/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.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 1/15) &#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.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.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"},{anchor:"transformers.LxmertConfig.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the attentions from the vision, language, and cross-modality layers
should be returned.`,name:"output_attentions"},{anchor:"transformers.LxmertConfig.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the hidden states from the vision, language, and cross-modality
layers should be returned.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/configuration_lxmert.py#L29"}}),fo=new Ue({}),go=new C({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/main/src/transformers/models/lxmert/tokenization_lxmert.py#L67"}}),To=new C({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = 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/main/src/transformers/models/lxmert/tokenization_lxmert.py#L199",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),bo=new C({props:{name:"convert_tokens_to_string",anchor:"transformers.LxmertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/tokenization_lxmert.py#L194"}}),xo=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = 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/main/src/transformers/models/lxmert/tokenization_lxmert.py#L252",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Jt=new cr({props:{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[hu]},$$scope:{ctx:A}}}),wo=new C({props:{name:"get_special_tokens_mask",anchor:"transformers.LxmertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = 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/main/src/transformers/models/lxmert/tokenization_lxmert.py#L224",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ko=new Ue({}),Lo=new C({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/main/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L48"}}),Fo=new C({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/main/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L136",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Eo=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = 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/main/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L160",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Xt=new cr({props:{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[pu]},$$scope:{ctx:A}}}),qo=new Ue({}),Po=new C({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",parameters:[{name:"language_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"vision_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = 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/main/src/transformers/models/lxmert/modeling_lxmert.py#L60"}}),Ao=new C({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": typing.Optional[torch.FloatTensor] = None"},{name:"cross_relationship_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"question_answering_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = 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/main/src/transformers/models/lxmert/modeling_lxmert.py#L146"}}),Oo=new C({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"question_answering_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = 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/main/src/transformers/models/lxmert/modeling_lxmert.py#L106"}}),Io=new C({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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L61"}}),jo=new C({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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L107"}}),Ro=new Ue({}),Jo=new C({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/main/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/main/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/main/src/transformers/models/lxmert/modeling_lxmert.py#L883"}}),Bo=new C({props:{name:"forward",anchor:"transformers.LxmertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_lxmert.py#L898",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bt=new zn({props:{$$slots:{default:[fu]},$$scope:{ctx:A}}}),Qt=new cr({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[gu]},$$scope:{ctx:A}}}),Qo=new Ue({}),Go=new C({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/main/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/main/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/main/src/transformers/models/lxmert/modeling_lxmert.py#L1021"}}),tn=new C({props:{name:"forward",anchor:"transformers.LxmertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"obj_labels",val:": typing.Union[typing.Dict[str, typing.Tuple[torch.FloatTensor, torch.FloatTensor]], NoneType] = None"},{name:"matched_label",val:": typing.Optional[torch.LongTensor] = None"},{name:"ans",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/lxmert/modeling_lxmert.py#L1150",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Zt=new zn({props:{$$slots:{default:[_u]},$$scope:{ctx:A}}}),on=new Ue({}),nn=new C({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/main/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/main/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/main/src/transformers/models/lxmert/modeling_lxmert.py#L1289"}}),cn=new C({props:{name:"forward",anchor:"transformers.LxmertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/lxmert/modeling_lxmert.py#L1381",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yt=new zn({props:{$$slots:{default:[Tu]},$$scope:{ctx:A}}}),Kt=new cr({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[vu]},$$scope:{ctx:A}}}),mn=new Ue({}),un=new C({props:{name:"class transformers.TFLxmertModel",anchor:"transformers.TFLxmertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L927"}}),to=new zn({props:{$$slots:{default:[bu]},$$scope:{ctx:A}}}),_n=new C({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L932",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/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>
`}}),oo=new zn({props:{$$slots:{default:[xu]},$$scope:{ctx:A}}}),no=new cr({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[wu]},$$scope:{ctx:A}}}),Tn=new Ue({}),vn=new C({props:{name:"class transformers.TFLxmertForPreTraining",anchor:"transformers.TFLxmertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1149"}}),ro=new zn({props:{$$slots:{default:[yu]},$$scope:{ctx:A}}}),Ln=new C({props:{name:"call",anchor:"transformers.TFLxmertForPreTraining.call",parameters:[{name:"input_ids",val:" = None"},{name:"visual_feats",val:" = None"},{name:"visual_pos",val:" = None"},{name:"attention_mask",val:" = None"},{name:"visual_attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"masked_lm_labels",val:" = None"},{name:"obj_labels",val:" = None"},{name:"matched_label",val:" = None"},{name:"ans",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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>Torch.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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1249",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/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>
`}}),ao=new zn({props:{$$slots:{default:[ku]},$$scope:{ctx:A}}}),{c(){u=n("meta"),$=l(),g=n("h1"),_=n("a"),v=n("span"),b(c.$$.fragment),f=l(),z=n("span"),Ve=a("LXMERT"),Fe=l(),I=n("h2"),oe=n("a"),ae=n("span"),b(M.$$.fragment),Be=l(),B=n("span"),Qe=a("Overview"),ze=l(),J=n("p"),Ge=a("The LXMERT model was proposed in "),ie=n("a"),le=a("LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),Ze=a(` by Hao Tan & 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.`),Ee=l(),X=n("p"),He=a("The abstract from the paper is the following:"),qe=l(),U=n("p"),we=n("em"),Ye=a(`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`),Te=l(),q=n("p"),j=a("Tips:"),Pe=l(),N=n("ul"),ye=n("li"),Ke=a(`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),de=l(),ke=n("li"),et=a(`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.`),D=l(),Le=n("li"),ce=a(`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.`),Ae=l(),V=n("p"),me=a("This model was contributed by "),ue=n("a"),tt=a("eltoto1219"),Q=a(". The original code can be found "),he=n("a"),pe=a("here"),ot=a("."),ve=l(),P=n("h2"),ne=n("a"),R=n("span"),b(fe.$$.fragment),nt=l(),T=n("span"),F=a("Documentation resources"),at=l(),se=n("ul"),st=n("li"),Ce=n("a"),E=a("Question answering task guide"),it=l(),ge=n("h2"),be=n("a"),rt=n("span"),b($e.$$.fragment),G=l(),Z=n("span"),pt=a("LxmertConfig"),lt=l(),O=n("div"),b(Me.$$.fragment),ft=l(),S=n("p"),gt=a("This is the configuration class to store the configuration of a "),re=n("a"),_t=a("LxmertModel"),ba=a(" or a "),En=n("a"),xa=a("TFLxmertModel"),wa=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
`),po=n("a"),ya=a("unc-nlp/lxmert-base-uncased"),ka=a(" architecture."),La=l(),Tt=n("p"),$a=a("Configuration objects inherit from "),qn=n("a"),Ma=a("PretrainedConfig"),Fa=a(` and can be used to control the model outputs. Read the
documentation from `),Pn=n("a"),za=a("PretrainedConfig"),Ea=a(" for more information."),hr=l(),vt=n("h2"),Dt=n("a"),ms=n("span"),b(fo.$$.fragment),qa=l(),us=n("span"),Pa=a("LxmertTokenizer"),pr=l(),W=n("div"),b(go.$$.fragment),Aa=l(),hs=n("p"),Ca=a("Construct a Lxmert tokenizer. Based on WordPiece."),Oa=l(),_o=n("p"),Na=a("This tokenizer inherits from "),An=n("a"),Ia=a("PreTrainedTokenizer"),ja=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Da=l(),dt=n("div"),b(To.$$.fragment),Ra=l(),ps=n("p"),Ja=a(`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:`),Sa=l(),vo=n("ul"),Cn=n("li"),Wa=a("single sequence: "),fs=n("code"),Xa=a("[CLS] X [SEP]"),Ua=l(),On=n("li"),Va=a("pair of sequences: "),gs=n("code"),Ba=a("[CLS] A [SEP] B [SEP]"),Qa=l(),Rt=n("div"),b(bo.$$.fragment),Ga=l(),_s=n("p"),Za=a("Converts a sequence of tokens (string) in a single string."),Ha=l(),Oe=n("div"),b(xo.$$.fragment),Ya=l(),Ts=n("p"),Ka=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),ei=l(),b(Jt.$$.fragment),ti=l(),bt=n("p"),oi=a("If "),vs=n("code"),ni=a("token_ids_1"),si=a(" is "),bs=n("code"),ri=a("None"),ai=a(", this method only returns the first portion of the mask (0s)."),ii=l(),St=n("div"),b(wo.$$.fragment),li=l(),yo=n("p"),di=a(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),xs=n("code"),ci=a("prepare_for_model"),mi=a(" method."),fr=l(),xt=n("h2"),Wt=n("a"),ws=n("span"),b(ko.$$.fragment),ui=l(),ys=n("span"),hi=a("LxmertTokenizerFast"),gr=l(),_e=n("div"),b(Lo.$$.fragment),pi=l(),$o=n("p"),fi=a("Construct a \u201Cfast\u201D Lxmert tokenizer (backed by HuggingFace\u2019s "),ks=n("em"),gi=a("tokenizers"),_i=a(" library). Based on WordPiece."),Ti=l(),Mo=n("p"),vi=a("This tokenizer inherits from "),Nn=n("a"),bi=a("PreTrainedTokenizerFast"),xi=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),wi=l(),ct=n("div"),b(Fo.$$.fragment),yi=l(),Ls=n("p"),ki=a(`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:`),Li=l(),zo=n("ul"),In=n("li"),$i=a("single sequence: "),$s=n("code"),Mi=a("[CLS] X [SEP]"),Fi=l(),jn=n("li"),zi=a("pair of sequences: "),Ms=n("code"),Ei=a("[CLS] A [SEP] B [SEP]"),qi=l(),Ne=n("div"),b(Eo.$$.fragment),Pi=l(),Fs=n("p"),Ai=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),Ci=l(),b(Xt.$$.fragment),Oi=l(),wt=n("p"),Ni=a("If "),zs=n("code"),Ii=a("token_ids_1"),ji=a(" is "),Es=n("code"),Di=a("None"),Ri=a(", this method only returns the first portion of the mask (0s)."),_r=l(),yt=n("h2"),Ut=n("a"),qs=n("span"),b(qo.$$.fragment),Ji=l(),Ps=n("span"),Si=a("Lxmert specific outputs"),Tr=l(),kt=n("div"),b(Po.$$.fragment),Wi=l(),As=n("p"),Xi=a(`Lxmert\u2019s 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 \u201Crelation-ship\u201D
encoder\u201D)`),vr=l(),Lt=n("div"),b(Ao.$$.fragment),Ui=l(),Co=n("p"),Vi=a("Output type of "),Dn=n("a"),Bi=a("LxmertForPreTraining"),Qi=a("."),br=l(),$t=n("div"),b(Oo.$$.fragment),Gi=l(),No=n("p"),Zi=a("Output type of "),Rn=n("a"),Hi=a("LxmertForQuestionAnswering"),Yi=a("."),xr=l(),Mt=n("div"),b(Io.$$.fragment),Ki=l(),Cs=n("p"),el=a(`Lxmert\u2019s 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 \u201Crelation-ship\u201D
encoder\u201D)`),wr=l(),Ft=n("div"),b(jo.$$.fragment),tl=l(),Do=n("p"),ol=a("Output type of "),Jn=n("a"),nl=a("LxmertForPreTraining"),sl=a("."),yr=l(),zt=n("h2"),Vt=n("a"),Os=n("span"),b(Ro.$$.fragment),rl=l(),Ns=n("span"),al=a("LxmertModel"),kr=l(),H=n("div"),b(Jo.$$.fragment),il=l(),Is=n("p"),ll=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),dl=l(),So=n("p"),cl=a("The LXMERT model was proposed in "),Wo=n("a"),ml=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ul=a(` by Hao Tan and Mohit Bansal. It\u2019s 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.`),hl=l(),Xo=n("p"),pl=a("This model inherits from "),Sn=n("a"),fl=a("PreTrainedModel"),gl=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.)`),_l=l(),Uo=n("p"),Tl=a("This model is also a PyTorch "),Vo=n("a"),vl=a("torch.nn.Module"),bl=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xl=l(),Ie=n("div"),b(Bo.$$.fragment),wl=l(),Et=n("p"),yl=a("The "),Wn=n("a"),kl=a("LxmertModel"),Ll=a(" forward method, overrides the "),js=n("code"),$l=a("__call__"),Ml=a(" special method."),Fl=l(),b(Bt.$$.fragment),zl=l(),b(Qt.$$.fragment),Lr=l(),qt=n("h2"),Gt=n("a"),Ds=n("span"),b(Qo.$$.fragment),El=l(),Rs=n("span"),ql=a("LxmertForPreTraining"),$r=l(),Y=n("div"),b(Go.$$.fragment),Pl=l(),Js=n("p"),Al=a("Lxmert Model with a specified pretraining head on top."),Cl=l(),Zo=n("p"),Ol=a("The LXMERT model was proposed in "),Ho=n("a"),Nl=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Il=a(` by Hao Tan and Mohit Bansal. It\u2019s 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.`),jl=l(),Yo=n("p"),Dl=a("This model inherits from "),Xn=n("a"),Rl=a("PreTrainedModel"),Jl=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.)`),Sl=l(),Ko=n("p"),Wl=a("This model is also a PyTorch "),en=n("a"),Xl=a("torch.nn.Module"),Ul=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vl=l(),mt=n("div"),b(tn.$$.fragment),Bl=l(),Pt=n("p"),Ql=a("The "),Un=n("a"),Gl=a("LxmertForPreTraining"),Zl=a(" forward method, overrides the "),Ss=n("code"),Hl=a("__call__"),Yl=a(" special method."),Kl=l(),b(Zt.$$.fragment),Mr=l(),At=n("h2"),Ht=n("a"),Ws=n("span"),b(on.$$.fragment),ed=l(),Xs=n("span"),td=a("LxmertForQuestionAnswering"),Fr=l(),K=n("div"),b(nn.$$.fragment),od=l(),Us=n("p"),nd=a("Lxmert Model with a visual-answering head on top for downstream QA tasks"),sd=l(),sn=n("p"),rd=a("The LXMERT model was proposed in "),rn=n("a"),ad=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),id=a(` by Hao Tan and Mohit Bansal. It\u2019s 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.`),ld=l(),an=n("p"),dd=a("This model inherits from "),Vn=n("a"),cd=a("PreTrainedModel"),md=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.)`),ud=l(),ln=n("p"),hd=a("This model is also a PyTorch "),dn=n("a"),pd=a("torch.nn.Module"),fd=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gd=l(),je=n("div"),b(cn.$$.fragment),_d=l(),Ct=n("p"),Td=a("The "),Bn=n("a"),vd=a("LxmertForQuestionAnswering"),bd=a(" forward method, overrides the "),Vs=n("code"),xd=a("__call__"),wd=a(" special method."),yd=l(),b(Yt.$$.fragment),kd=l(),b(Kt.$$.fragment),zr=l(),Ot=n("h2"),eo=n("a"),Bs=n("span"),b(mn.$$.fragment),Ld=l(),Qs=n("span"),$d=a("TFLxmertModel"),Er=l(),ee=n("div"),b(un.$$.fragment),Md=l(),Gs=n("p"),Fd=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),zd=l(),hn=n("p"),Ed=a("The LXMERT model was proposed in "),pn=n("a"),qd=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Pd=a(` by Hao Tan and Mohit Bansal. It\u2019s 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.`),Ad=l(),fn=n("p"),Cd=a("This model is also a "),gn=n("a"),Od=a("tf.keras.Model"),Nd=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.`),Id=l(),b(to.$$.fragment),jd=l(),De=n("div"),b(_n.$$.fragment),Dd=l(),Nt=n("p"),Rd=a("The "),Qn=n("a"),Jd=a("TFLxmertModel"),Sd=a(" forward method, overrides the "),Zs=n("code"),Wd=a("__call__"),Xd=a(" special method."),Ud=l(),b(oo.$$.fragment),Vd=l(),b(no.$$.fragment),qr=l(),It=n("h2"),so=n("a"),Hs=n("span"),b(Tn.$$.fragment),Bd=l(),Ys=n("span"),Qd=a("TFLxmertForPreTraining"),Pr=l(),te=n("div"),b(vn.$$.fragment),Gd=l(),bn=n("p"),Zd=a("Lxmert Model with a "),Ks=n("code"),Hd=a("language modeling"),Yd=a(" head on top."),Kd=l(),xn=n("p"),ec=a("The LXMERT model was proposed in "),wn=n("a"),tc=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),oc=a(` by Hao Tan and Mohit Bansal. It\u2019s 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.`),nc=l(),yn=n("p"),sc=a("This model is also a "),kn=n("a"),rc=a("tf.keras.Model"),ac=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.`),ic=l(),b(ro.$$.fragment),lc=l(),ut=n("div"),b(Ln.$$.fragment),dc=l(),jt=n("p"),cc=a("The "),Gn=n("a"),mc=a("TFLxmertForPreTraining"),uc=a(" forward method, overrides the "),er=n("code"),hc=a("__call__"),pc=a(" special method."),fc=l(),b(ao.$$.fragment),this.h()},l(o){const p=mu('[data-svelte="svelte-1phssyn"]',document.head);u=s(p,"META",{name:!0,content:!0}),p.forEach(t),$=d(o),g=s(o,"H1",{class:!0});var $n=r(g);_=s($n,"A",{id:!0,class:!0,href:!0});var tr=r(_);v=s(tr,"SPAN",{});var or=r(v);x(c.$$.fragment,or),or.forEach(t),tr.forEach(t),f=d($n),z=s($n,"SPAN",{});var nr=r(z);Ve=i(nr,"LXMERT"),nr.forEach(t),$n.forEach(t),Fe=d(o),I=s(o,"H2",{class:!0});var Mn=r(I);oe=s(Mn,"A",{id:!0,class:!0,href:!0});var sr=r(oe);ae=s(sr,"SPAN",{});var rr=r(ae);x(M.$$.fragment,rr),rr.forEach(t),sr.forEach(t),Be=d(Mn),B=s(Mn,"SPAN",{});var ar=r(B);Qe=i(ar,"Overview"),ar.forEach(t),Mn.forEach(t),ze=d(o),J=s(o,"P",{});var Fn=r(J);Ge=i(Fn,"The LXMERT model was proposed in "),ie=s(Fn,"A",{href:!0,rel:!0});var ir=r(ie);le=i(ir,"LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),ir.forEach(t),Ze=i(Fn,` by Hao Tan & 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.`),Fn.forEach(t),Ee=d(o),X=s(o,"P",{});var lr=r(X);He=i(lr,"The abstract from the paper is the following:"),lr.forEach(t),qe=d(o),U=s(o,"P",{});var dr=r(U);we=s(dr,"EM",{});var bc=r(we);Ye=i(bc,`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`),bc.forEach(t),dr.forEach(t),Te=d(o),q=s(o,"P",{});var xc=r(q);j=i(xc,"Tips:"),xc.forEach(t),Pe=d(o),N=s(o,"UL",{});var Zn=r(N);ye=s(Zn,"LI",{});var wc=r(ye);Ke=i(wc,`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),wc.forEach(t),de=d(Zn),ke=s(Zn,"LI",{});var yc=r(ke);et=i(yc,`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.`),yc.forEach(t),D=d(Zn),Le=s(Zn,"LI",{});var kc=r(Le);ce=i(kc,`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.`),kc.forEach(t),Zn.forEach(t),Ae=d(o),V=s(o,"P",{});var Hn=r(V);me=i(Hn,"This model was contributed by "),ue=s(Hn,"A",{href:!0,rel:!0});var Lc=r(ue);tt=i(Lc,"eltoto1219"),Lc.forEach(t),Q=i(Hn,". The original code can be found "),he=s(Hn,"A",{href:!0,rel:!0});var $c=r(he);pe=i($c,"here"),$c.forEach(t),ot=i(Hn,"."),Hn.forEach(t),ve=d(o),P=s(o,"H2",{class:!0});var Cr=r(P);ne=s(Cr,"A",{id:!0,class:!0,href:!0});var Mc=r(ne);R=s(Mc,"SPAN",{});var Fc=r(R);x(fe.$$.fragment,Fc),Fc.forEach(t),Mc.forEach(t),nt=d(Cr),T=s(Cr,"SPAN",{});var zc=r(T);F=i(zc,"Documentation resources"),zc.forEach(t),Cr.forEach(t),at=d(o),se=s(o,"UL",{});var Ec=r(se);st=s(Ec,"LI",{});var qc=r(st);Ce=s(qc,"A",{href:!0});var Pc=r(Ce);E=i(Pc,"Question answering task guide"),Pc.forEach(t),qc.forEach(t),Ec.forEach(t),it=d(o),ge=s(o,"H2",{class:!0});var Or=r(ge);be=s(Or,"A",{id:!0,class:!0,href:!0});var Ac=r(be);rt=s(Ac,"SPAN",{});var Cc=r(rt);x($e.$$.fragment,Cc),Cc.forEach(t),Ac.forEach(t),G=d(Or),Z=s(Or,"SPAN",{});var Oc=r(Z);pt=i(Oc,"LxmertConfig"),Oc.forEach(t),Or.forEach(t),lt=d(o),O=s(o,"DIV",{class:!0});var Yn=r(O);x(Me.$$.fragment,Yn),ft=d(Yn),S=s(Yn,"P",{});var io=r(S);gt=i(io,"This is the configuration class to store the configuration of a "),re=s(io,"A",{href:!0});var Nc=r(re);_t=i(Nc,"LxmertModel"),Nc.forEach(t),ba=i(io," or a "),En=s(io,"A",{href:!0});var Ic=r(En);xa=i(Ic,"TFLxmertModel"),Ic.forEach(t),wa=i(io,`. 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
`),po=s(io,"A",{href:!0,rel:!0});var jc=r(po);ya=i(jc,"unc-nlp/lxmert-base-uncased"),jc.forEach(t),ka=i(io," architecture."),io.forEach(t),La=d(Yn),Tt=s(Yn,"P",{});var Kn=r(Tt);$a=i(Kn,"Configuration objects inherit from "),qn=s(Kn,"A",{href:!0});var Dc=r(qn);Ma=i(Dc,"PretrainedConfig"),Dc.forEach(t),Fa=i(Kn,` and can be used to control the model outputs. Read the
documentation from `),Pn=s(Kn,"A",{href:!0});var Rc=r(Pn);za=i(Rc,"PretrainedConfig"),Rc.forEach(t),Ea=i(Kn," for more information."),Kn.forEach(t),Yn.forEach(t),hr=d(o),vt=s(o,"H2",{class:!0});var Nr=r(vt);Dt=s(Nr,"A",{id:!0,class:!0,href:!0});var Jc=r(Dt);ms=s(Jc,"SPAN",{});var Sc=r(ms);x(fo.$$.fragment,Sc),Sc.forEach(t),Jc.forEach(t),qa=d(Nr),us=s(Nr,"SPAN",{});var Wc=r(us);Pa=i(Wc,"LxmertTokenizer"),Wc.forEach(t),Nr.forEach(t),pr=d(o),W=s(o,"DIV",{class:!0});var xe=r(W);x(go.$$.fragment,xe),Aa=d(xe),hs=s(xe,"P",{});var Xc=r(hs);Ca=i(Xc,"Construct a Lxmert tokenizer. Based on WordPiece."),Xc.forEach(t),Oa=d(xe),_o=s(xe,"P",{});var Ir=r(_o);Na=i(Ir,"This tokenizer inherits from "),An=s(Ir,"A",{href:!0});var Uc=r(An);Ia=i(Uc,"PreTrainedTokenizer"),Uc.forEach(t),ja=i(Ir,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ir.forEach(t),Da=d(xe),dt=s(xe,"DIV",{class:!0});var es=r(dt);x(To.$$.fragment,es),Ra=d(es),ps=s(es,"P",{});var Vc=r(ps);Ja=i(Vc,`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:`),Vc.forEach(t),Sa=d(es),vo=s(es,"UL",{});var jr=r(vo);Cn=s(jr,"LI",{});var gc=r(Cn);Wa=i(gc,"single sequence: "),fs=s(gc,"CODE",{});var Bc=r(fs);Xa=i(Bc,"[CLS] X [SEP]"),Bc.forEach(t),gc.forEach(t),Ua=d(jr),On=s(jr,"LI",{});var _c=r(On);Va=i(_c,"pair of sequences: "),gs=s(_c,"CODE",{});var Qc=r(gs);Ba=i(Qc,"[CLS] A [SEP] B [SEP]"),Qc.forEach(t),_c.forEach(t),jr.forEach(t),es.forEach(t),Qa=d(xe),Rt=s(xe,"DIV",{class:!0});var Dr=r(Rt);x(bo.$$.fragment,Dr),Ga=d(Dr),_s=s(Dr,"P",{});var Gc=r(_s);Za=i(Gc,"Converts a sequence of tokens (string) in a single string."),Gc.forEach(t),Dr.forEach(t),Ha=d(xe),Oe=s(xe,"DIV",{class:!0});var lo=r(Oe);x(xo.$$.fragment,lo),Ya=d(lo),Ts=s(lo,"P",{});var Zc=r(Ts);Ka=i(Zc,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),Zc.forEach(t),ei=d(lo),x(Jt.$$.fragment,lo),ti=d(lo),bt=s(lo,"P",{});var ts=r(bt);oi=i(ts,"If "),vs=s(ts,"CODE",{});var Hc=r(vs);ni=i(Hc,"token_ids_1"),Hc.forEach(t),si=i(ts," is "),bs=s(ts,"CODE",{});var Yc=r(bs);ri=i(Yc,"None"),Yc.forEach(t),ai=i(ts,", this method only returns the first portion of the mask (0s)."),ts.forEach(t),lo.forEach(t),ii=d(xe),St=s(xe,"DIV",{class:!0});var Rr=r(St);x(wo.$$.fragment,Rr),li=d(Rr),yo=s(Rr,"P",{});var Jr=r(yo);di=i(Jr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),xs=s(Jr,"CODE",{});var Kc=r(xs);ci=i(Kc,"prepare_for_model"),Kc.forEach(t),mi=i(Jr," method."),Jr.forEach(t),Rr.forEach(t),xe.forEach(t),fr=d(o),xt=s(o,"H2",{class:!0});var Sr=r(xt);Wt=s(Sr,"A",{id:!0,class:!0,href:!0});var em=r(Wt);ws=s(em,"SPAN",{});var tm=r(ws);x(ko.$$.fragment,tm),tm.forEach(t),em.forEach(t),ui=d(Sr),ys=s(Sr,"SPAN",{});var om=r(ys);hi=i(om,"LxmertTokenizerFast"),om.forEach(t),Sr.forEach(t),gr=d(o),_e=s(o,"DIV",{class:!0});var ht=r(_e);x(Lo.$$.fragment,ht),pi=d(ht),$o=s(ht,"P",{});var Wr=r($o);fi=i(Wr,"Construct a \u201Cfast\u201D Lxmert tokenizer (backed by HuggingFace\u2019s "),ks=s(Wr,"EM",{});var nm=r(ks);gi=i(nm,"tokenizers"),nm.forEach(t),_i=i(Wr," library). Based on WordPiece."),Wr.forEach(t),Ti=d(ht),Mo=s(ht,"P",{});var Xr=r(Mo);vi=i(Xr,"This tokenizer inherits from "),Nn=s(Xr,"A",{href:!0});var sm=r(Nn);bi=i(sm,"PreTrainedTokenizerFast"),sm.forEach(t),xi=i(Xr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Xr.forEach(t),wi=d(ht),ct=s(ht,"DIV",{class:!0});var os=r(ct);x(Fo.$$.fragment,os),yi=d(os),Ls=s(os,"P",{});var rm=r(Ls);ki=i(rm,`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:`),rm.forEach(t),Li=d(os),zo=s(os,"UL",{});var Ur=r(zo);In=s(Ur,"LI",{});var Tc=r(In);$i=i(Tc,"single sequence: "),$s=s(Tc,"CODE",{});var am=r($s);Mi=i(am,"[CLS] X [SEP]"),am.forEach(t),Tc.forEach(t),Fi=d(Ur),jn=s(Ur,"LI",{});var vc=r(jn);zi=i(vc,"pair of sequences: "),Ms=s(vc,"CODE",{});var im=r(Ms);Ei=i(im,"[CLS] A [SEP] B [SEP]"),im.forEach(t),vc.forEach(t),Ur.forEach(t),os.forEach(t),qi=d(ht),Ne=s(ht,"DIV",{class:!0});var co=r(Ne);x(Eo.$$.fragment,co),Pi=d(co),Fs=s(co,"P",{});var lm=r(Fs);Ai=i(lm,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),lm.forEach(t),Ci=d(co),x(Xt.$$.fragment,co),Oi=d(co),wt=s(co,"P",{});var ns=r(wt);Ni=i(ns,"If "),zs=s(ns,"CODE",{});var dm=r(zs);Ii=i(dm,"token_ids_1"),dm.forEach(t),ji=i(ns," is "),Es=s(ns,"CODE",{});var cm=r(Es);Di=i(cm,"None"),cm.forEach(t),Ri=i(ns,", this method only returns the first portion of the mask (0s)."),ns.forEach(t),co.forEach(t),ht.forEach(t),_r=d(o),yt=s(o,"H2",{class:!0});var Vr=r(yt);Ut=s(Vr,"A",{id:!0,class:!0,href:!0});var mm=r(Ut);qs=s(mm,"SPAN",{});var um=r(qs);x(qo.$$.fragment,um),um.forEach(t),mm.forEach(t),Ji=d(Vr),Ps=s(Vr,"SPAN",{});var hm=r(Ps);Si=i(hm,"Lxmert specific outputs"),hm.forEach(t),Vr.forEach(t),Tr=d(o),kt=s(o,"DIV",{class:!0});var Br=r(kt);x(Po.$$.fragment,Br),Wi=d(Br),As=s(Br,"P",{});var pm=r(As);Xi=i(pm,`Lxmert\u2019s 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 \u201Crelation-ship\u201D
encoder\u201D)`),pm.forEach(t),Br.forEach(t),vr=d(o),Lt=s(o,"DIV",{class:!0});var Qr=r(Lt);x(Ao.$$.fragment,Qr),Ui=d(Qr),Co=s(Qr,"P",{});var Gr=r(Co);Vi=i(Gr,"Output type of "),Dn=s(Gr,"A",{href:!0});var fm=r(Dn);Bi=i(fm,"LxmertForPreTraining"),fm.forEach(t),Qi=i(Gr,"."),Gr.forEach(t),Qr.forEach(t),br=d(o),$t=s(o,"DIV",{class:!0});var Zr=r($t);x(Oo.$$.fragment,Zr),Gi=d(Zr),No=s(Zr,"P",{});var Hr=r(No);Zi=i(Hr,"Output type of "),Rn=s(Hr,"A",{href:!0});var gm=r(Rn);Hi=i(gm,"LxmertForQuestionAnswering"),gm.forEach(t),Yi=i(Hr,"."),Hr.forEach(t),Zr.forEach(t),xr=d(o),Mt=s(o,"DIV",{class:!0});var Yr=r(Mt);x(Io.$$.fragment,Yr),Ki=d(Yr),Cs=s(Yr,"P",{});var _m=r(Cs);el=i(_m,`Lxmert\u2019s 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 \u201Crelation-ship\u201D
encoder\u201D)`),_m.forEach(t),Yr.forEach(t),wr=d(o),Ft=s(o,"DIV",{class:!0});var Kr=r(Ft);x(jo.$$.fragment,Kr),tl=d(Kr),Do=s(Kr,"P",{});var ea=r(Do);ol=i(ea,"Output type of "),Jn=s(ea,"A",{href:!0});var Tm=r(Jn);nl=i(Tm,"LxmertForPreTraining"),Tm.forEach(t),sl=i(ea,"."),ea.forEach(t),Kr.forEach(t),yr=d(o),zt=s(o,"H2",{class:!0});var ta=r(zt);Vt=s(ta,"A",{id:!0,class:!0,href:!0});var vm=r(Vt);Os=s(vm,"SPAN",{});var bm=r(Os);x(Ro.$$.fragment,bm),bm.forEach(t),vm.forEach(t),rl=d(ta),Ns=s(ta,"SPAN",{});var xm=r(Ns);al=i(xm,"LxmertModel"),xm.forEach(t),ta.forEach(t),kr=d(o),H=s(o,"DIV",{class:!0});var Re=r(H);x(Jo.$$.fragment,Re),il=d(Re),Is=s(Re,"P",{});var wm=r(Is);ll=i(wm,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),wm.forEach(t),dl=d(Re),So=s(Re,"P",{});var oa=r(So);cl=i(oa,"The LXMERT model was proposed in "),Wo=s(oa,"A",{href:!0,rel:!0});var ym=r(Wo);ml=i(ym,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ym.forEach(t),ul=i(oa,` by Hao Tan and Mohit Bansal. It\u2019s 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.`),oa.forEach(t),hl=d(Re),Xo=s(Re,"P",{});var na=r(Xo);pl=i(na,"This model inherits from "),Sn=s(na,"A",{href:!0});var km=r(Sn);fl=i(km,"PreTrainedModel"),km.forEach(t),gl=i(na,`. 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.)`),na.forEach(t),_l=d(Re),Uo=s(Re,"P",{});var sa=r(Uo);Tl=i(sa,"This model is also a PyTorch "),Vo=s(sa,"A",{href:!0,rel:!0});var Lm=r(Vo);vl=i(Lm,"torch.nn.Module"),Lm.forEach(t),bl=i(sa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sa.forEach(t),xl=d(Re),Ie=s(Re,"DIV",{class:!0});var mo=r(Ie);x(Bo.$$.fragment,mo),wl=d(mo),Et=s(mo,"P",{});var ss=r(Et);yl=i(ss,"The "),Wn=s(ss,"A",{href:!0});var $m=r(Wn);kl=i($m,"LxmertModel"),$m.forEach(t),Ll=i(ss," forward method, overrides the "),js=s(ss,"CODE",{});var Mm=r(js);$l=i(Mm,"__call__"),Mm.forEach(t),Ml=i(ss," special method."),ss.forEach(t),Fl=d(mo),x(Bt.$$.fragment,mo),zl=d(mo),x(Qt.$$.fragment,mo),mo.forEach(t),Re.forEach(t),Lr=d(o),qt=s(o,"H2",{class:!0});var ra=r(qt);Gt=s(ra,"A",{id:!0,class:!0,href:!0});var Fm=r(Gt);Ds=s(Fm,"SPAN",{});var zm=r(Ds);x(Qo.$$.fragment,zm),zm.forEach(t),Fm.forEach(t),El=d(ra),Rs=s(ra,"SPAN",{});var Em=r(Rs);ql=i(Em,"LxmertForPreTraining"),Em.forEach(t),ra.forEach(t),$r=d(o),Y=s(o,"DIV",{class:!0});var Je=r(Y);x(Go.$$.fragment,Je),Pl=d(Je),Js=s(Je,"P",{});var qm=r(Js);Al=i(qm,"Lxmert Model with a specified pretraining head on top."),qm.forEach(t),Cl=d(Je),Zo=s(Je,"P",{});var aa=r(Zo);Ol=i(aa,"The LXMERT model was proposed in "),Ho=s(aa,"A",{href:!0,rel:!0});var Pm=r(Ho);Nl=i(Pm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Pm.forEach(t),Il=i(aa,` by Hao Tan and Mohit Bansal. It\u2019s 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.`),aa.forEach(t),jl=d(Je),Yo=s(Je,"P",{});var ia=r(Yo);Dl=i(ia,"This model inherits from "),Xn=s(ia,"A",{href:!0});var Am=r(Xn);Rl=i(Am,"PreTrainedModel"),Am.forEach(t),Jl=i(ia,`. 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.)`),ia.forEach(t),Sl=d(Je),Ko=s(Je,"P",{});var la=r(Ko);Wl=i(la,"This model is also a PyTorch "),en=s(la,"A",{href:!0,rel:!0});var Cm=r(en);Xl=i(Cm,"torch.nn.Module"),Cm.forEach(t),Ul=i(la,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),la.forEach(t),Vl=d(Je),mt=s(Je,"DIV",{class:!0});var rs=r(mt);x(tn.$$.fragment,rs),Bl=d(rs),Pt=s(rs,"P",{});var as=r(Pt);Ql=i(as,"The "),Un=s(as,"A",{href:!0});var Om=r(Un);Gl=i(Om,"LxmertForPreTraining"),Om.forEach(t),Zl=i(as," forward method, overrides the "),Ss=s(as,"CODE",{});var Nm=r(Ss);Hl=i(Nm,"__call__"),Nm.forEach(t),Yl=i(as," special method."),as.forEach(t),Kl=d(rs),x(Zt.$$.fragment,rs),rs.forEach(t),Je.forEach(t),Mr=d(o),At=s(o,"H2",{class:!0});var da=r(At);Ht=s(da,"A",{id:!0,class:!0,href:!0});var Im=r(Ht);Ws=s(Im,"SPAN",{});var jm=r(Ws);x(on.$$.fragment,jm),jm.forEach(t),Im.forEach(t),ed=d(da),Xs=s(da,"SPAN",{});var Dm=r(Xs);td=i(Dm,"LxmertForQuestionAnswering"),Dm.forEach(t),da.forEach(t),Fr=d(o),K=s(o,"DIV",{class:!0});var Se=r(K);x(nn.$$.fragment,Se),od=d(Se),Us=s(Se,"P",{});var Rm=r(Us);nd=i(Rm,"Lxmert Model with a visual-answering head on top for downstream QA tasks"),Rm.forEach(t),sd=d(Se),sn=s(Se,"P",{});var ca=r(sn);rd=i(ca,"The LXMERT model was proposed in "),rn=s(ca,"A",{href:!0,rel:!0});var Jm=r(rn);ad=i(Jm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Jm.forEach(t),id=i(ca,` by Hao Tan and Mohit Bansal. It\u2019s 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.`),ca.forEach(t),ld=d(Se),an=s(Se,"P",{});var ma=r(an);dd=i(ma,"This model inherits from "),Vn=s(ma,"A",{href:!0});var Sm=r(Vn);cd=i(Sm,"PreTrainedModel"),Sm.forEach(t),md=i(ma,`. 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.)`),ma.forEach(t),ud=d(Se),ln=s(Se,"P",{});var ua=r(ln);hd=i(ua,"This model is also a PyTorch "),dn=s(ua,"A",{href:!0,rel:!0});var Wm=r(dn);pd=i(Wm,"torch.nn.Module"),Wm.forEach(t),fd=i(ua,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ua.forEach(t),gd=d(Se),je=s(Se,"DIV",{class:!0});var uo=r(je);x(cn.$$.fragment,uo),_d=d(uo),Ct=s(uo,"P",{});var is=r(Ct);Td=i(is,"The "),Bn=s(is,"A",{href:!0});var Xm=r(Bn);vd=i(Xm,"LxmertForQuestionAnswering"),Xm.forEach(t),bd=i(is," forward method, overrides the "),Vs=s(is,"CODE",{});var Um=r(Vs);xd=i(Um,"__call__"),Um.forEach(t),wd=i(is," special method."),is.forEach(t),yd=d(uo),x(Yt.$$.fragment,uo),kd=d(uo),x(Kt.$$.fragment,uo),uo.forEach(t),Se.forEach(t),zr=d(o),Ot=s(o,"H2",{class:!0});var ha=r(Ot);eo=s(ha,"A",{id:!0,class:!0,href:!0});var Vm=r(eo);Bs=s(Vm,"SPAN",{});var Bm=r(Bs);x(mn.$$.fragment,Bm),Bm.forEach(t),Vm.forEach(t),Ld=d(ha),Qs=s(ha,"SPAN",{});var Qm=r(Qs);$d=i(Qm,"TFLxmertModel"),Qm.forEach(t),ha.forEach(t),Er=d(o),ee=s(o,"DIV",{class:!0});var We=r(ee);x(un.$$.fragment,We),Md=d(We),Gs=s(We,"P",{});var Gm=r(Gs);Fd=i(Gm,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Gm.forEach(t),zd=d(We),hn=s(We,"P",{});var pa=r(hn);Ed=i(pa,"The LXMERT model was proposed in "),pn=s(pa,"A",{href:!0,rel:!0});var Zm=r(pn);qd=i(Zm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Zm.forEach(t),Pd=i(pa,` by Hao Tan and Mohit Bansal. It\u2019s 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.`),pa.forEach(t),Ad=d(We),fn=s(We,"P",{});var fa=r(fn);Cd=i(fa,"This model is also a "),gn=s(fa,"A",{href:!0,rel:!0});var Hm=r(gn);Od=i(Hm,"tf.keras.Model"),Hm.forEach(t),Nd=i(fa,` 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.`),fa.forEach(t),Id=d(We),x(to.$$.fragment,We),jd=d(We),De=s(We,"DIV",{class:!0});var ho=r(De);x(_n.$$.fragment,ho),Dd=d(ho),Nt=s(ho,"P",{});var ls=r(Nt);Rd=i(ls,"The "),Qn=s(ls,"A",{href:!0});var Ym=r(Qn);Jd=i(Ym,"TFLxmertModel"),Ym.forEach(t),Sd=i(ls," forward method, overrides the "),Zs=s(ls,"CODE",{});var Km=r(Zs);Wd=i(Km,"__call__"),Km.forEach(t),Xd=i(ls," special method."),ls.forEach(t),Ud=d(ho),x(oo.$$.fragment,ho),Vd=d(ho),x(no.$$.fragment,ho),ho.forEach(t),We.forEach(t),qr=d(o),It=s(o,"H2",{class:!0});var ga=r(It);so=s(ga,"A",{id:!0,class:!0,href:!0});var eu=r(so);Hs=s(eu,"SPAN",{});var tu=r(Hs);x(Tn.$$.fragment,tu),tu.forEach(t),eu.forEach(t),Bd=d(ga),Ys=s(ga,"SPAN",{});var ou=r(Ys);Qd=i(ou,"TFLxmertForPreTraining"),ou.forEach(t),ga.forEach(t),Pr=d(o),te=s(o,"DIV",{class:!0});var Xe=r(te);x(vn.$$.fragment,Xe),Gd=d(Xe),bn=s(Xe,"P",{});var _a=r(bn);Zd=i(_a,"Lxmert Model with a "),Ks=s(_a,"CODE",{});var nu=r(Ks);Hd=i(nu,"language modeling"),nu.forEach(t),Yd=i(_a," head on top."),_a.forEach(t),Kd=d(Xe),xn=s(Xe,"P",{});var Ta=r(xn);ec=i(Ta,"The LXMERT model was proposed in "),wn=s(Ta,"A",{href:!0,rel:!0});var su=r(wn);tc=i(su,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),su.forEach(t),oc=i(Ta,` by Hao Tan and Mohit Bansal. It\u2019s 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.`),Ta.forEach(t),nc=d(Xe),yn=s(Xe,"P",{});var va=r(yn);sc=i(va,"This model is also a "),kn=s(va,"A",{href:!0,rel:!0});var ru=r(kn);rc=i(ru,"tf.keras.Model"),ru.forEach(t),ac=i(va,` 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.`),va.forEach(t),ic=d(Xe),x(ro.$$.fragment,Xe),lc=d(Xe),ut=s(Xe,"DIV",{class:!0});var ds=r(ut);x(Ln.$$.fragment,ds),dc=d(ds),jt=s(ds,"P",{});var cs=r(jt);cc=i(cs,"The "),Gn=s(cs,"A",{href:!0});var au=r(Gn);mc=i(au,"TFLxmertForPreTraining"),au.forEach(t),uc=i(cs," forward method, overrides the "),er=s(cs,"CODE",{});var iu=r(er);hc=i(iu,"__call__"),iu.forEach(t),pc=i(cs," special method."),cs.forEach(t),fc=d(ds),x(ao.$$.fragment,ds),ds.forEach(t),Xe.forEach(t),this.h()},h(){m(u,"name","hf:doc:metadata"),m(u,"content",JSON.stringify($u)),m(_,"id","lxmert"),m(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(_,"href","#lxmert"),m(g,"class","relative group"),m(oe,"id","overview"),m(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(oe,"href","#overview"),m(I,"class","relative group"),m(ie,"href","https://arxiv.org/abs/1908.07490"),m(ie,"rel","nofollow"),m(ue,"href","https://huggingface.co/eltoto1219"),m(ue,"rel","nofollow"),m(he,"href","https://github.com/airsplay/lxmert"),m(he,"rel","nofollow"),m(ne,"id","documentation-resources"),m(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ne,"href","#documentation-resources"),m(P,"class","relative group"),m(Ce,"href","../tasks/question_answering"),m(be,"id","transformers.LxmertConfig"),m(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(be,"href","#transformers.LxmertConfig"),m(ge,"class","relative group"),m(re,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertModel"),m(En,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.TFLxmertModel"),m(po,"href","https://huggingface.co/unc-nlp/lxmert-base-uncased"),m(po,"rel","nofollow"),m(qn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(Pn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Dt,"id","transformers.LxmertTokenizer"),m(Dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Dt,"href","#transformers.LxmertTokenizer"),m(vt,"class","relative group"),m(An,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Wt,"id","transformers.LxmertTokenizerFast"),m(Wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Wt,"href","#transformers.LxmertTokenizerFast"),m(xt,"class","relative group"),m(Nn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ne,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ut,"id","transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),m(Ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ut,"href","#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),m(yt,"class","relative group"),m(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Dn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertForPreTraining"),m(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),m($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Jn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertForPreTraining"),m(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Vt,"id","transformers.LxmertModel"),m(Vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Vt,"href","#transformers.LxmertModel"),m(zt,"class","relative group"),m(Wo,"href","https://arxiv.org/abs/1908.07490"),m(Wo,"rel","nofollow"),m(Sn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Vo,"rel","nofollow"),m(Wn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertModel"),m(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Gt,"id","transformers.LxmertForPreTraining"),m(Gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Gt,"href","#transformers.LxmertForPreTraining"),m(qt,"class","relative group"),m(Ho,"href","https://arxiv.org/abs/1908.07490"),m(Ho,"rel","nofollow"),m(Xn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(Un,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertForPreTraining"),m(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ht,"id","transformers.LxmertForQuestionAnswering"),m(Ht,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ht,"href","#transformers.LxmertForQuestionAnswering"),m(At,"class","relative group"),m(rn,"href","https://arxiv.org/abs/1908.07490"),m(rn,"rel","nofollow"),m(Vn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(dn,"rel","nofollow"),m(Bn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),m(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(eo,"id","transformers.TFLxmertModel"),m(eo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(eo,"href","#transformers.TFLxmertModel"),m(Ot,"class","relative group"),m(pn,"href","https://arxiv.org/abs/1908.07490"),m(pn,"rel","nofollow"),m(gn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(gn,"rel","nofollow"),m(Qn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.TFLxmertModel"),m(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(so,"id","transformers.TFLxmertForPreTraining"),m(so,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(so,"href","#transformers.TFLxmertForPreTraining"),m(It,"class","relative group"),m(wn,"href","https://arxiv.org/abs/1908.07490"),m(wn,"rel","nofollow"),m(kn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(kn,"rel","nofollow"),m(Gn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.TFLxmertForPreTraining"),m(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,p){e(document.head,u),h(o,$,p),h(o,g,p),e(g,_),e(_,v),w(c,v,null),e(g,f),e(g,z),e(z,Ve),h(o,Fe,p),h(o,I,p),e(I,oe),e(oe,ae),w(M,ae,null),e(I,Be),e(I,B),e(B,Qe),h(o,ze,p),h(o,J,p),e(J,Ge),e(J,ie),e(ie,le),e(J,Ze),h(o,Ee,p),h(o,X,p),e(X,He),h(o,qe,p),h(o,U,p),e(U,we),e(we,Ye),h(o,Te,p),h(o,q,p),e(q,j),h(o,Pe,p),h(o,N,p),e(N,ye),e(ye,Ke),e(N,de),e(N,ke),e(ke,et),e(N,D),e(N,Le),e(Le,ce),h(o,Ae,p),h(o,V,p),e(V,me),e(V,ue),e(ue,tt),e(V,Q),e(V,he),e(he,pe),e(V,ot),h(o,ve,p),h(o,P,p),e(P,ne),e(ne,R),w(fe,R,null),e(P,nt),e(P,T),e(T,F),h(o,at,p),h(o,se,p),e(se,st),e(st,Ce),e(Ce,E),h(o,it,p),h(o,ge,p),e(ge,be),e(be,rt),w($e,rt,null),e(ge,G),e(ge,Z),e(Z,pt),h(o,lt,p),h(o,O,p),w(Me,O,null),e(O,ft),e(O,S),e(S,gt),e(S,re),e(re,_t),e(S,ba),e(S,En),e(En,xa),e(S,wa),e(S,po),e(po,ya),e(S,ka),e(O,La),e(O,Tt),e(Tt,$a),e(Tt,qn),e(qn,Ma),e(Tt,Fa),e(Tt,Pn),e(Pn,za),e(Tt,Ea),h(o,hr,p),h(o,vt,p),e(vt,Dt),e(Dt,ms),w(fo,ms,null),e(vt,qa),e(vt,us),e(us,Pa),h(o,pr,p),h(o,W,p),w(go,W,null),e(W,Aa),e(W,hs),e(hs,Ca),e(W,Oa),e(W,_o),e(_o,Na),e(_o,An),e(An,Ia),e(_o,ja),e(W,Da),e(W,dt),w(To,dt,null),e(dt,Ra),e(dt,ps),e(ps,Ja),e(dt,Sa),e(dt,vo),e(vo,Cn),e(Cn,Wa),e(Cn,fs),e(fs,Xa),e(vo,Ua),e(vo,On),e(On,Va),e(On,gs),e(gs,Ba),e(W,Qa),e(W,Rt),w(bo,Rt,null),e(Rt,Ga),e(Rt,_s),e(_s,Za),e(W,Ha),e(W,Oe),w(xo,Oe,null),e(Oe,Ya),e(Oe,Ts),e(Ts,Ka),e(Oe,ei),w(Jt,Oe,null),e(Oe,ti),e(Oe,bt),e(bt,oi),e(bt,vs),e(vs,ni),e(bt,si),e(bt,bs),e(bs,ri),e(bt,ai),e(W,ii),e(W,St),w(wo,St,null),e(St,li),e(St,yo),e(yo,di),e(yo,xs),e(xs,ci),e(yo,mi),h(o,fr,p),h(o,xt,p),e(xt,Wt),e(Wt,ws),w(ko,ws,null),e(xt,ui),e(xt,ys),e(ys,hi),h(o,gr,p),h(o,_e,p),w(Lo,_e,null),e(_e,pi),e(_e,$o),e($o,fi),e($o,ks),e(ks,gi),e($o,_i),e(_e,Ti),e(_e,Mo),e(Mo,vi),e(Mo,Nn),e(Nn,bi),e(Mo,xi),e(_e,wi),e(_e,ct),w(Fo,ct,null),e(ct,yi),e(ct,Ls),e(Ls,ki),e(ct,Li),e(ct,zo),e(zo,In),e(In,$i),e(In,$s),e($s,Mi),e(zo,Fi),e(zo,jn),e(jn,zi),e(jn,Ms),e(Ms,Ei),e(_e,qi),e(_e,Ne),w(Eo,Ne,null),e(Ne,Pi),e(Ne,Fs),e(Fs,Ai),e(Ne,Ci),w(Xt,Ne,null),e(Ne,Oi),e(Ne,wt),e(wt,Ni),e(wt,zs),e(zs,Ii),e(wt,ji),e(wt,Es),e(Es,Di),e(wt,Ri),h(o,_r,p),h(o,yt,p),e(yt,Ut),e(Ut,qs),w(qo,qs,null),e(yt,Ji),e(yt,Ps),e(Ps,Si),h(o,Tr,p),h(o,kt,p),w(Po,kt,null),e(kt,Wi),e(kt,As),e(As,Xi),h(o,vr,p),h(o,Lt,p),w(Ao,Lt,null),e(Lt,Ui),e(Lt,Co),e(Co,Vi),e(Co,Dn),e(Dn,Bi),e(Co,Qi),h(o,br,p),h(o,$t,p),w(Oo,$t,null),e($t,Gi),e($t,No),e(No,Zi),e(No,Rn),e(Rn,Hi),e(No,Yi),h(o,xr,p),h(o,Mt,p),w(Io,Mt,null),e(Mt,Ki),e(Mt,Cs),e(Cs,el),h(o,wr,p),h(o,Ft,p),w(jo,Ft,null),e(Ft,tl),e(Ft,Do),e(Do,ol),e(Do,Jn),e(Jn,nl),e(Do,sl),h(o,yr,p),h(o,zt,p),e(zt,Vt),e(Vt,Os),w(Ro,Os,null),e(zt,rl),e(zt,Ns),e(Ns,al),h(o,kr,p),h(o,H,p),w(Jo,H,null),e(H,il),e(H,Is),e(Is,ll),e(H,dl),e(H,So),e(So,cl),e(So,Wo),e(Wo,ml),e(So,ul),e(H,hl),e(H,Xo),e(Xo,pl),e(Xo,Sn),e(Sn,fl),e(Xo,gl),e(H,_l),e(H,Uo),e(Uo,Tl),e(Uo,Vo),e(Vo,vl),e(Uo,bl),e(H,xl),e(H,Ie),w(Bo,Ie,null),e(Ie,wl),e(Ie,Et),e(Et,yl),e(Et,Wn),e(Wn,kl),e(Et,Ll),e(Et,js),e(js,$l),e(Et,Ml),e(Ie,Fl),w(Bt,Ie,null),e(Ie,zl),w(Qt,Ie,null),h(o,Lr,p),h(o,qt,p),e(qt,Gt),e(Gt,Ds),w(Qo,Ds,null),e(qt,El),e(qt,Rs),e(Rs,ql),h(o,$r,p),h(o,Y,p),w(Go,Y,null),e(Y,Pl),e(Y,Js),e(Js,Al),e(Y,Cl),e(Y,Zo),e(Zo,Ol),e(Zo,Ho),e(Ho,Nl),e(Zo,Il),e(Y,jl),e(Y,Yo),e(Yo,Dl),e(Yo,Xn),e(Xn,Rl),e(Yo,Jl),e(Y,Sl),e(Y,Ko),e(Ko,Wl),e(Ko,en),e(en,Xl),e(Ko,Ul),e(Y,Vl),e(Y,mt),w(tn,mt,null),e(mt,Bl),e(mt,Pt),e(Pt,Ql),e(Pt,Un),e(Un,Gl),e(Pt,Zl),e(Pt,Ss),e(Ss,Hl),e(Pt,Yl),e(mt,Kl),w(Zt,mt,null),h(o,Mr,p),h(o,At,p),e(At,Ht),e(Ht,Ws),w(on,Ws,null),e(At,ed),e(At,Xs),e(Xs,td),h(o,Fr,p),h(o,K,p),w(nn,K,null),e(K,od),e(K,Us),e(Us,nd),e(K,sd),e(K,sn),e(sn,rd),e(sn,rn),e(rn,ad),e(sn,id),e(K,ld),e(K,an),e(an,dd),e(an,Vn),e(Vn,cd),e(an,md),e(K,ud),e(K,ln),e(ln,hd),e(ln,dn),e(dn,pd),e(ln,fd),e(K,gd),e(K,je),w(cn,je,null),e(je,_d),e(je,Ct),e(Ct,Td),e(Ct,Bn),e(Bn,vd),e(Ct,bd),e(Ct,Vs),e(Vs,xd),e(Ct,wd),e(je,yd),w(Yt,je,null),e(je,kd),w(Kt,je,null),h(o,zr,p),h(o,Ot,p),e(Ot,eo),e(eo,Bs),w(mn,Bs,null),e(Ot,Ld),e(Ot,Qs),e(Qs,$d),h(o,Er,p),h(o,ee,p),w(un,ee,null),e(ee,Md),e(ee,Gs),e(Gs,Fd),e(ee,zd),e(ee,hn),e(hn,Ed),e(hn,pn),e(pn,qd),e(hn,Pd),e(ee,Ad),e(ee,fn),e(fn,Cd),e(fn,gn),e(gn,Od),e(fn,Nd),e(ee,Id),w(to,ee,null),e(ee,jd),e(ee,De),w(_n,De,null),e(De,Dd),e(De,Nt),e(Nt,Rd),e(Nt,Qn),e(Qn,Jd),e(Nt,Sd),e(Nt,Zs),e(Zs,Wd),e(Nt,Xd),e(De,Ud),w(oo,De,null),e(De,Vd),w(no,De,null),h(o,qr,p),h(o,It,p),e(It,so),e(so,Hs),w(Tn,Hs,null),e(It,Bd),e(It,Ys),e(Ys,Qd),h(o,Pr,p),h(o,te,p),w(vn,te,null),e(te,Gd),e(te,bn),e(bn,Zd),e(bn,Ks),e(Ks,Hd),e(bn,Yd),e(te,Kd),e(te,xn),e(xn,ec),e(xn,wn),e(wn,tc),e(xn,oc),e(te,nc),e(te,yn),e(yn,sc),e(yn,kn),e(kn,rc),e(yn,ac),e(te,ic),w(ro,te,null),e(te,lc),e(te,ut),w(Ln,ut,null),e(ut,dc),e(ut,jt),e(jt,cc),e(jt,Gn),e(Gn,mc),e(jt,uc),e(jt,er),e(er,hc),e(jt,pc),e(ut,fc),w(ao,ut,null),Ar=!0},p(o,[p]){const $n={};p&2&&($n.$$scope={dirty:p,ctx:o}),Jt.$set($n);const tr={};p&2&&(tr.$$scope={dirty:p,ctx:o}),Xt.$set(tr);const or={};p&2&&(or.$$scope={dirty:p,ctx:o}),Bt.$set(or);const nr={};p&2&&(nr.$$scope={dirty:p,ctx:o}),Qt.$set(nr);const Mn={};p&2&&(Mn.$$scope={dirty:p,ctx:o}),Zt.$set(Mn);const sr={};p&2&&(sr.$$scope={dirty:p,ctx:o}),Yt.$set(sr);const rr={};p&2&&(rr.$$scope={dirty:p,ctx:o}),Kt.$set(rr);const ar={};p&2&&(ar.$$scope={dirty:p,ctx:o}),to.$set(ar);const Fn={};p&2&&(Fn.$$scope={dirty:p,ctx:o}),oo.$set(Fn);const ir={};p&2&&(ir.$$scope={dirty:p,ctx:o}),no.$set(ir);const lr={};p&2&&(lr.$$scope={dirty:p,ctx:o}),ro.$set(lr);const dr={};p&2&&(dr.$$scope={dirty:p,ctx:o}),ao.$set(dr)},i(o){Ar||(y(c.$$.fragment,o),y(M.$$.fragment,o),y(fe.$$.fragment,o),y($e.$$.fragment,o),y(Me.$$.fragment,o),y(fo.$$.fragment,o),y(go.$$.fragment,o),y(To.$$.fragment,o),y(bo.$$.fragment,o),y(xo.$$.fragment,o),y(Jt.$$.fragment,o),y(wo.$$.fragment,o),y(ko.$$.fragment,o),y(Lo.$$.fragment,o),y(Fo.$$.fragment,o),y(Eo.$$.fragment,o),y(Xt.$$.fragment,o),y(qo.$$.fragment,o),y(Po.$$.fragment,o),y(Ao.$$.fragment,o),y(Oo.$$.fragment,o),y(Io.$$.fragment,o),y(jo.$$.fragment,o),y(Ro.$$.fragment,o),y(Jo.$$.fragment,o),y(Bo.$$.fragment,o),y(Bt.$$.fragment,o),y(Qt.$$.fragment,o),y(Qo.$$.fragment,o),y(Go.$$.fragment,o),y(tn.$$.fragment,o),y(Zt.$$.fragment,o),y(on.$$.fragment,o),y(nn.$$.fragment,o),y(cn.$$.fragment,o),y(Yt.$$.fragment,o),y(Kt.$$.fragment,o),y(mn.$$.fragment,o),y(un.$$.fragment,o),y(to.$$.fragment,o),y(_n.$$.fragment,o),y(oo.$$.fragment,o),y(no.$$.fragment,o),y(Tn.$$.fragment,o),y(vn.$$.fragment,o),y(ro.$$.fragment,o),y(Ln.$$.fragment,o),y(ao.$$.fragment,o),Ar=!0)},o(o){k(c.$$.fragment,o),k(M.$$.fragment,o),k(fe.$$.fragment,o),k($e.$$.fragment,o),k(Me.$$.fragment,o),k(fo.$$.fragment,o),k(go.$$.fragment,o),k(To.$$.fragment,o),k(bo.$$.fragment,o),k(xo.$$.fragment,o),k(Jt.$$.fragment,o),k(wo.$$.fragment,o),k(ko.$$.fragment,o),k(Lo.$$.fragment,o),k(Fo.$$.fragment,o),k(Eo.$$.fragment,o),k(Xt.$$.fragment,o),k(qo.$$.fragment,o),k(Po.$$.fragment,o),k(Ao.$$.fragment,o),k(Oo.$$.fragment,o),k(Io.$$.fragment,o),k(jo.$$.fragment,o),k(Ro.$$.fragment,o),k(Jo.$$.fragment,o),k(Bo.$$.fragment,o),k(Bt.$$.fragment,o),k(Qt.$$.fragment,o),k(Qo.$$.fragment,o),k(Go.$$.fragment,o),k(tn.$$.fragment,o),k(Zt.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(cn.$$.fragment,o),k(Yt.$$.fragment,o),k(Kt.$$.fragment,o),k(mn.$$.fragment,o),k(un.$$.fragment,o),k(to.$$.fragment,o),k(_n.$$.fragment,o),k(oo.$$.fragment,o),k(no.$$.fragment,o),k(Tn.$$.fragment,o),k(vn.$$.fragment,o),k(ro.$$.fragment,o),k(Ln.$$.fragment,o),k(ao.$$.fragment,o),Ar=!1},d(o){t(u),o&&t($),o&&t(g),L(c),o&&t(Fe),o&&t(I),L(M),o&&t(ze),o&&t(J),o&&t(Ee),o&&t(X),o&&t(qe),o&&t(U),o&&t(Te),o&&t(q),o&&t(Pe),o&&t(N),o&&t(Ae),o&&t(V),o&&t(ve),o&&t(P),L(fe),o&&t(at),o&&t(se),o&&t(it),o&&t(ge),L($e),o&&t(lt),o&&t(O),L(Me),o&&t(hr),o&&t(vt),L(fo),o&&t(pr),o&&t(W),L(go),L(To),L(bo),L(xo),L(Jt),L(wo),o&&t(fr),o&&t(xt),L(ko),o&&t(gr),o&&t(_e),L(Lo),L(Fo),L(Eo),L(Xt),o&&t(_r),o&&t(yt),L(qo),o&&t(Tr),o&&t(kt),L(Po),o&&t(vr),o&&t(Lt),L(Ao),o&&t(br),o&&t($t),L(Oo),o&&t(xr),o&&t(Mt),L(Io),o&&t(wr),o&&t(Ft),L(jo),o&&t(yr),o&&t(zt),L(Ro),o&&t(kr),o&&t(H),L(Jo),L(Bo),L(Bt),L(Qt),o&&t(Lr),o&&t(qt),L(Qo),o&&t($r),o&&t(Y),L(Go),L(tn),L(Zt),o&&t(Mr),o&&t(At),L(on),o&&t(Fr),o&&t(K),L(nn),L(cn),L(Yt),L(Kt),o&&t(zr),o&&t(Ot),L(mn),o&&t(Er),o&&t(ee),L(un),L(to),L(_n),L(oo),L(no),o&&t(qr),o&&t(It),L(Tn),o&&t(Pr),o&&t(te),L(vn),L(ro),L(Ln),L(ao)}}}const $u={local:"lxmert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.LxmertConfig",title:"LxmertConfig"},{local:"transformers.LxmertTokenizer",title:"LxmertTokenizer"},{local:"transformers.LxmertTokenizerFast",title:"LxmertTokenizerFast"},{local:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",title:"Lxmert specific outputs"},{local:"transformers.LxmertModel",title:"LxmertModel"},{local:"transformers.LxmertForPreTraining",title:"LxmertForPreTraining"},{local:"transformers.LxmertForQuestionAnswering",title:"LxmertForQuestionAnswering"},{local:"transformers.TFLxmertModel",title:"TFLxmertModel"},{local:"transformers.TFLxmertForPreTraining",title:"TFLxmertForPreTraining"}],title:"LXMERT"};function Mu(A){return uu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cu extends lu{constructor(u){super();du(this,u,Mu,Lu,cu,{})}}export{Cu as default,$u as metadata};
