import{S as pu,i as hu,s as uu,e as a,k as h,w as Q,t as n,M as mu,c as r,d as o,m as u,a as i,x as v,h as s,b as p,G as e,g as _,y as w,q as T,o as y,B as $,v as fu,L as pe}from"../../chunks/vendor-hf-doc-builder.js";import{T as $t}from"../../chunks/Tip-hf-doc-builder.js";import{D as B}from"../../chunks/Docstring-hf-doc-builder.js";import{C as H}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ce}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function gu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import QDQBertModel, QDQBertConfig

# Initializing a QDQBERT bert-base-uncased style configuration
configuration = QDQBertConfig()

# Initializing a model from the bert-base-uncased style configuration
model = QDQBertModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> QDQBertModel, QDQBertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a QDQBERT bert-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = QDQBertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the bert-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=a("p"),k=n("Examples:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Examples:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function _u(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function bu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertModel
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertModel.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertModel
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertModel.from_pretrained(<span class="hljs-string">&quot;bert-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(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function ku(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function Qu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertLMHeadModel, QDQBertConfig
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
config = QDQBertConfig.from_pretrained("bert-base-cased")
config.is_decoder = True
model = QDQBertLMHeadModel.from_pretrained("bert-base-cased", config=config)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertLMHeadModel, QDQBertConfig
<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;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = QDQBertConfig.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>, config=config)

<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>prediction_logits = outputs.logits`}}),{c(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function vu(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function wu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForMaskedLM.from_pretrained("bert-base-uncased")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# retrieve index of [MASK]
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)

labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-[MASK] tokens
labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForMaskedLM
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function Tu(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function yu(q){let d,k,g,m,b;return m=new H({props:{code:`import torch
from transformers import AutoTokenizer, QDQBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForSequenceClassification.from_pretrained("bert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = QDQBertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),k=n("Example of single-label classification:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example of single-label classification:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function $u(q){let d,k,g,m,b;return m=new H({props:{code:`import torch
from transformers import AutoTokenizer, QDQBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForSequenceClassification.from_pretrained("bert-base-uncased", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = QDQBertForSequenceClassification.from_pretrained(
    "bert-base-uncased", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bert-base-uncased&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),k=n("Example of multi-label classification:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example of multi-label classification:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function qu(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function Du(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertForNextSentencePrediction
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForNextSentencePrediction.from_pretrained("bert-base-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
next_sentence = "The sky is blue due to the shorter wavelength of blue light."
encoding = tokenizer(prompt, next_sentence, return_tensors="pt")

outputs = model(**encoding, labels=torch.LongTensor([1]))
logits = outputs.logits
assert logits[0, 0] < logits[0, 1]  # next sentence was random`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForNextSentencePrediction
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function zu(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function Mu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForMultipleChoice.from_pretrained("bert-base-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForMultipleChoice
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function Bu(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function xu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForTokenClassification.from_pretrained("bert-base-uncased")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForTokenClassification
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function Fu(q){let d,k,g,m,b;return{c(){d=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(c,"CODE",{});var D=i(g);m=s(D,"Module"),D.forEach(o),b=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(l,c){_(l,d,c),e(d,k),e(d,g),e(g,m),e(d,b)},d(l){l&&o(d)}}}function Eu(q){let d,k,g,m,b;return m=new H({props:{code:`from transformers import AutoTokenizer, QDQBertForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = QDQBertForQuestionAnswering.from_pretrained("bert-base-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, QDQBertForQuestionAnswering
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = QDQBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;bert-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(){d=a("p"),k=n("Example:"),g=h(),Q(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);k=s(c,"Example:"),c.forEach(o),g=u(l),v(m.$$.fragment,l)},m(l,c){_(l,d,c),e(d,k),_(l,g,c),w(m,l,c),b=!0},p:pe,i(l){b||(T(m.$$.fragment,l),b=!0)},o(l){y(m.$$.fragment,l),b=!1},d(l){l&&o(d),l&&o(g),$(m,l)}}}function ju(q){let d,k,g,m,b,l,c,D,kr,ea,he,Ce,Fn,qt,Qr,En,vr,ta,Ae,wr,Dt,Tr,yr,oa,Xo,$r,na,Jo,jn,qr,sa,Ko,Dr,aa,R,Pn,Cn,zr,Mr,An,Ne,Br,zt,xr,Fr,Nn,Er,jr,Ln,Mt,Pr,On,Cr,Ar,Nr,Sn,Bt,Lr,Go,Or,Sr,ra,Le,Ir,xt,Wr,Hr,ia,ue,Oe,In,Ft,Rr,Wn,Ur,la,x,Vr,Hn,Xr,Jr,Et,Kr,Gr,Rn,Yr,Zr,Un,ei,ti,jt,oi,ni,da,Se,si,Vn,ai,ri,ca,Yo,ii,pa,Pt,ha,me,Ie,Xn,Ct,li,Jn,di,ua,Zo,ci,ma,At,fa,fe,We,Kn,Nt,pi,Gn,hi,ga,te,ui,Lt,mi,fi,Ot,gi,_i,_a,St,ba,ge,He,Yn,It,bi,Zn,ki,ka,W,Wt,Qi,_e,vi,en,wi,Ti,Ht,yi,$i,qi,be,Di,tn,zi,Mi,on,Bi,xi,Fi,Re,Qa,ke,Ue,es,Rt,Ei,ts,ji,va,z,Ut,Pi,os,Ci,Ai,Vt,Ni,nn,Li,Oi,Si,Xt,Ii,Jt,Wi,Hi,Ri,Kt,Ui,Gt,Vi,Xi,Ji,M,Ki,ns,Gi,Yi,ss,Zi,el,as,tl,ol,rs,nl,sl,is,al,rl,ls,il,ll,dl,U,Yt,cl,Qe,pl,sn,hl,ul,ds,ml,fl,gl,Ve,_l,Xe,wa,ve,Je,cs,Zt,bl,ps,kl,Ta,F,eo,Ql,to,vl,hs,wl,Tl,yl,oo,$l,an,ql,Dl,zl,no,Ml,so,Bl,xl,Fl,V,ao,El,we,jl,rn,Pl,Cl,us,Al,Nl,Ll,Ke,Ol,Ge,ya,Te,Ye,ms,ro,Sl,fs,Il,$a,E,io,Wl,lo,Hl,gs,Rl,Ul,Vl,co,Xl,ln,Jl,Kl,Gl,po,Yl,ho,Zl,ed,td,X,uo,od,ye,nd,dn,sd,ad,_s,rd,id,ld,Ze,dd,et,qa,$e,tt,bs,mo,cd,ks,pd,Da,j,fo,hd,Qs,ud,md,go,fd,cn,gd,_d,bd,_o,kd,bo,Qd,vd,wd,L,ko,Td,qe,yd,pn,$d,qd,vs,Dd,zd,Md,ot,Bd,nt,xd,st,za,De,at,ws,Qo,Fd,Ts,Ed,Ma,P,vo,jd,wo,Pd,ys,Cd,Ad,Nd,To,Ld,hn,Od,Sd,Id,yo,Wd,$o,Hd,Rd,Ud,J,qo,Vd,ze,Xd,un,Jd,Kd,$s,Gd,Yd,Zd,rt,ec,it,Ba,Me,lt,qs,Do,tc,Ds,oc,xa,C,zo,nc,zs,sc,ac,Mo,rc,mn,ic,lc,dc,Bo,cc,xo,pc,hc,uc,K,Fo,mc,Be,fc,fn,gc,_c,Ms,bc,kc,Qc,dt,vc,ct,Fa,xe,pt,Bs,Eo,wc,xs,Tc,Ea,A,jo,yc,Fs,$c,qc,Po,Dc,gn,zc,Mc,Bc,Co,xc,Ao,Fc,Ec,jc,G,No,Pc,Fe,Cc,_n,Ac,Nc,Es,Lc,Oc,Sc,ht,Ic,ut,ja,Ee,mt,js,Lo,Wc,Ps,Hc,Pa,N,Oo,Rc,je,Uc,Cs,Vc,Xc,As,Jc,Kc,Gc,So,Yc,bn,Zc,ep,tp,Io,op,Wo,np,sp,ap,Y,Ho,rp,Pe,ip,kn,lp,dp,Ns,cp,pp,hp,ft,up,gt,Ca;return l=new I({}),qt=new I({}),Ft=new I({}),Pt=new H({props:{code:`import pytorch_quantization.nn as quant_nn
from pytorch_quantization.tensor_quant import QuantDescriptor

# The default tensor quantizer is set to use Max calibration method
input_desc = QuantDescriptor(num_bits=8, calib_method="max")
# The default tensor quantizer is set to be per-channel quantization for weights
weight_desc = QuantDescriptor(num_bits=8, axis=((0,)))
quant_nn.QuantLinear.set_default_quant_desc_input(input_desc)
quant_nn.QuantLinear.set_default_quant_desc_weight(weight_desc)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> pytorch_quantization.nn <span class="hljs-keyword">as</span> quant_nn
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> pytorch_quantization.tensor_quant <span class="hljs-keyword">import</span> QuantDescriptor

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># The default tensor quantizer is set to use Max calibration method</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_desc = QuantDescriptor(num_bits=<span class="hljs-number">8</span>, calib_method=<span class="hljs-string">&quot;max&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># The default tensor quantizer is set to be per-channel quantization for weights</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>weight_desc = QuantDescriptor(num_bits=<span class="hljs-number">8</span>, axis=((<span class="hljs-number">0</span>,)))
<span class="hljs-meta">&gt;&gt;&gt; </span>quant_nn.QuantLinear.set_default_quant_desc_input(input_desc)
<span class="hljs-meta">&gt;&gt;&gt; </span>quant_nn.QuantLinear.set_default_quant_desc_weight(weight_desc)`}}),Ct=new I({}),At=new H({props:{code:`# Find the TensorQuantizer and enable calibration
for name, module in model.named_modules():
    if name.endswith("_input_quantizer"):
        module.enable_calib()
        module.disable_quant()  # Use full precision data to calibrate

# Feeding data samples
model(x)
# ...

# Finalize calibration
for name, module in model.named_modules():
    if name.endswith("_input_quantizer"):
        module.load_calib_amax()
        module.enable_quant()

# If running on GPU, it needs to call .cuda() again because new tensors will be created by calibration process
model.cuda()

# Keep running the quantized model
# ...`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Find the TensorQuantizer and enable calibration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> name, module <span class="hljs-keyword">in</span> model.named_modules():
<span class="hljs-meta">... </span>    <span class="hljs-keyword">if</span> name.endswith(<span class="hljs-string">&quot;_input_quantizer&quot;</span>):
<span class="hljs-meta">... </span>        module.enable_calib()
<span class="hljs-meta">... </span>        module.disable_quant()  <span class="hljs-comment"># Use full precision data to calibrate</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Feeding data samples</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model(x)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># ...</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Finalize calibration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> name, module <span class="hljs-keyword">in</span> model.named_modules():
<span class="hljs-meta">... </span>    <span class="hljs-keyword">if</span> name.endswith(<span class="hljs-string">&quot;_input_quantizer&quot;</span>):
<span class="hljs-meta">... </span>        module.load_calib_amax()
<span class="hljs-meta">... </span>        module.enable_quant()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If running on GPU, it needs to call .cuda() again because new tensors will be created by calibration process</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.cuda()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Keep running the quantized model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># ...</span>`}}),Nt=new I({}),St=new H({props:{code:`from pytorch_quantization.nn import TensorQuantizer

TensorQuantizer.use_fb_fake_quant = True

# Load the calibrated model
...
# ONNX export
torch.onnx.export(...)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> pytorch_quantization.nn <span class="hljs-keyword">import</span> TensorQuantizer

<span class="hljs-meta">&gt;&gt;&gt; </span>TensorQuantizer.use_fb_fake_quant = <span class="hljs-literal">True</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Load the calibrated model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>...
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># ONNX export</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>torch.onnx.export(...)`}}),It=new I({}),Wt=new B({props:{name:"class transformers.QDQBertConfig",anchor:"transformers.QDQBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.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:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.QDQBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the QDQBERT 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/qdqbert#transformers.QDQBertModel">QDQBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.QDQBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.QDQBertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.QDQBertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.QDQBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.QDQBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.QDQBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.QDQBertConfig.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.QDQBertConfig.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.QDQBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertModel">QDQBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.QDQBertConfig.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.QDQBertConfig.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.QDQBertConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.QDQBertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/configuration_qdqbert.py#L29"}}),Re=new ce({props:{anchor:"transformers.QDQBertConfig.example",$$slots:{default:[gu]},$$scope:{ctx:q}}}),Rt=new I({}),Ut=new B({props:{name:"class transformers.QDQBertModel",anchor:"transformers.QDQBertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.QDQBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L835"}}),Yt=new B({props:{name:"forward",anchor:"transformers.QDQBertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = 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.QDQBertModel.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.QDQBertModel.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.QDQBertModel.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.QDQBertModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertModel.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.QDQBertModel.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.QDQBertModel.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.QDQBertModel.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.QDQBertModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.QDQBertModel.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.QDQBertModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.QDQBertModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L875",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new $t({props:{$$slots:{default:[_u]},$$scope:{ctx:q}}}),Xe=new ce({props:{anchor:"transformers.QDQBertModel.forward.example",$$slots:{default:[bu]},$$scope:{ctx:q}}}),Zt=new I({}),eo=new B({props:{name:"class transformers.QDQBertLMHeadModel",anchor:"transformers.QDQBertLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1015"}}),ao=new B({props:{name:"forward",anchor:"transformers.QDQBertLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.LongTensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = 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.QDQBertLMHeadModel.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.QDQBertLMHeadModel.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.QDQBertLMHeadModel.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.QDQBertLMHeadModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertLMHeadModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertLMHeadModel.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.QDQBertLMHeadModel.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.QDQBertLMHeadModel.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.QDQBertLMHeadModel.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.QDQBertLMHeadModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.QDQBertLMHeadModel.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.QDQBertLMHeadModel.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 left-to-right language modeling loss (next word prediction). 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 n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.QDQBertLMHeadModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.QDQBertLMHeadModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1038",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>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).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new $t({props:{$$slots:{default:[ku]},$$scope:{ctx:q}}}),Ge=new ce({props:{anchor:"transformers.QDQBertLMHeadModel.forward.example",$$slots:{default:[Qu]},$$scope:{ctx:q}}}),ro=new I({}),io=new B({props:{name:"class transformers.QDQBertForMaskedLM",anchor:"transformers.QDQBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1169"}}),uo=new B({props:{name:"forward",anchor:"transformers.QDQBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.QDQBertForMaskedLM.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.QDQBertForMaskedLM.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.QDQBertForMaskedLM.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.QDQBertForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertForMaskedLM.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.QDQBertForMaskedLM.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.QDQBertForMaskedLM.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.QDQBertForMaskedLM.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.QDQBertForMaskedLM.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1195",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>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).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new $t({props:{$$slots:{default:[vu]},$$scope:{ctx:q}}}),et=new ce({props:{anchor:"transformers.QDQBertForMaskedLM.forward.example",$$slots:{default:[wu]},$$scope:{ctx:q}}}),mo=new I({}),fo=new B({props:{name:"class transformers.QDQBertForSequenceClassification",anchor:"transformers.QDQBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1385"}}),ko=new B({props:{name:"forward",anchor:"transformers.QDQBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.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.QDQBertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1397",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ot=new $t({props:{$$slots:{default:[Tu]},$$scope:{ctx:q}}}),nt=new ce({props:{anchor:"transformers.QDQBertForSequenceClassification.forward.example",$$slots:{default:[yu]},$$scope:{ctx:q}}}),st=new ce({props:{anchor:"transformers.QDQBertForSequenceClassification.forward.example-2",$$slots:{default:[$u]},$$scope:{ctx:q}}}),Qo=new I({}),vo=new B({props:{name:"class transformers.QDQBertForNextSentencePrediction",anchor:"transformers.QDQBertForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1281"}}),qo=new B({props:{name:"forward",anchor:"transformers.QDQBertForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertForNextSentencePrediction.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.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.QDQBertForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (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 sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1291",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rt=new $t({props:{$$slots:{default:[qu]},$$scope:{ctx:q}}}),it=new ce({props:{anchor:"transformers.QDQBertForNextSentencePrediction.forward.example",$$slots:{default:[Du]},$$scope:{ctx:q}}}),Do=new I({}),zo=new B({props:{name:"class transformers.QDQBertForMultipleChoice",anchor:"transformers.QDQBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1482"}}),Fo=new B({props:{name:"forward",anchor:"transformers.QDQBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.QDQBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, 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.QDQBertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.QDQBertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, 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.QDQBertForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.QDQBertForMultipleChoice.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.QDQBertForMultipleChoice.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.QDQBertForMultipleChoice.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.QDQBertForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1493",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),dt=new $t({props:{$$slots:{default:[zu]},$$scope:{ctx:q}}}),ct=new ce({props:{anchor:"transformers.QDQBertForMultipleChoice.forward.example",$$slots:{default:[Mu]},$$scope:{ctx:q}}}),Eo=new I({}),jo=new B({props:{name:"class transformers.QDQBertForTokenClassification",anchor:"transformers.QDQBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1573"}}),No=new B({props:{name:"forward",anchor:"transformers.QDQBertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.QDQBertForTokenClassification.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.QDQBertForTokenClassification.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.QDQBertForTokenClassification.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.QDQBertForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertForTokenClassification.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.QDQBertForTokenClassification.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.QDQBertForTokenClassification.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.QDQBertForTokenClassification.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.QDQBertForTokenClassification.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 token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1588",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ht=new $t({props:{$$slots:{default:[Bu]},$$scope:{ctx:q}}}),ut=new ce({props:{anchor:"transformers.QDQBertForTokenClassification.forward.example",$$slots:{default:[xu]},$$scope:{ctx:q}}}),Lo=new I({}),Oo=new B({props:{name:"class transformers.QDQBertForQuestionAnswering",anchor:"transformers.QDQBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.QDQBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertConfig">QDQBertConfig</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/qdqbert/modeling_qdqbert.py#L1654"}}),Ho=new B({props:{name:"forward",anchor:"transformers.QDQBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = 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.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.QDQBertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.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.QDQBertForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.QDQBertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qdqbert/modeling_qdqbert.py#L1668",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</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/qdqbert#transformers.QDQBertConfig"
>QDQBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new $t({props:{$$slots:{default:[Fu]},$$scope:{ctx:q}}}),gt=new ce({props:{anchor:"transformers.QDQBertForQuestionAnswering.forward.example",$$slots:{default:[Eu]},$$scope:{ctx:q}}}),{c(){d=a("meta"),k=h(),g=a("h1"),m=a("a"),b=a("span"),Q(l.$$.fragment),c=h(),D=a("span"),kr=n("QDQBERT"),ea=h(),he=a("h2"),Ce=a("a"),Fn=a("span"),Q(qt.$$.fragment),Qr=h(),En=a("span"),vr=n("Overview"),ta=h(),Ae=a("p"),wr=n("The QDQBERT model can be referenced in "),Dt=a("a"),Tr=n(`Integer Quantization for Deep Learning Inference: Principles and Empirical
Evaluation`),yr=n(` by Hao Wu, Patrick Judd, Xiaojie Zhang, Mikhail Isaev and Paulius
Micikevicius.`),oa=h(),Xo=a("p"),$r=n("The abstract from the paper is the following:"),na=h(),Jo=a("p"),jn=a("em"),qr=n(`Quantization techniques can reduce the size of Deep Neural Networks and improve inference latency and throughput by
taking advantage of high throughput integer instructions. In this paper we review the mathematical aspects of
quantization parameters and evaluate their choices on a wide range of neural network models for different application
domains, including vision, speech, and language. We focus on quantization techniques that are amenable to acceleration
by processors with high-throughput integer math pipelines. We also present a workflow for 8-bit quantization that is
able to maintain accuracy within 1% of the floating-point baseline on all networks studied, including models that are
more difficult to quantize, such as MobileNets and BERT-large.`),sa=h(),Ko=a("p"),Dr=n("Tips:"),aa=h(),R=a("ul"),Pn=a("li"),Cn=a("p"),zr=n(`QDQBERT model adds fake quantization operations (pair of QuantizeLinear/DequantizeLinear ops) to (i) linear layer
inputs and weights, (ii) matmul inputs, (iii) residual add inputs, in BERT model.`),Mr=h(),An=a("li"),Ne=a("p"),Br=n("QDQBERT requires the dependency of "),zt=a("a"),xr=n("Pytorch Quantization Toolkit"),Fr=n(". To install "),Nn=a("code"),Er=n("pip install pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com"),jr=h(),Ln=a("li"),Mt=a("p"),Pr=n("QDQBERT model can be loaded from any checkpoint of HuggingFace BERT model (for example "),On=a("em"),Cr=n("bert-base-uncased"),Ar=n(`), and
perform Quantization Aware Training/Post Training Quantization.`),Nr=h(),Sn=a("li"),Bt=a("p"),Lr=n(`A complete example of using QDQBERT model to perform Quatization Aware Training and Post Training Quantization for
SQUAD task can be found at `),Go=a("a"),Or=n("transformers/examples/research_projects/quantization-qdqbert/"),Sr=n("."),ra=h(),Le=a("p"),Ir=n("This model was contributed by "),xt=a("a"),Wr=n("shangz"),Hr=n("."),ia=h(),ue=a("h3"),Oe=a("a"),In=a("span"),Q(Ft.$$.fragment),Rr=h(),Wn=a("span"),Ur=n("Set default quantizers"),la=h(),x=a("p"),Vr=n(`QDQBERT model adds fake quantization operations (pair of QuantizeLinear/DequantizeLinear ops) to BERT by
`),Hn=a("code"),Xr=n("TensorQuantizer"),Jr=n(" in "),Et=a("a"),Kr=n("Pytorch Quantization Toolkit"),Gr=n(". "),Rn=a("code"),Yr=n("TensorQuantizer"),Zr=n(` is the module
for quantizing tensors, with `),Un=a("code"),ei=n("QuantDescriptor"),ti=n(" defining how the tensor should be quantized. Refer to "),jt=a("a"),oi=n(`Pytorch
Quantization Toolkit userguide`),ni=n(" for more details."),da=h(),Se=a("p"),si=n("Before creating QDQBERT model, one has to set the default "),Vn=a("code"),ai=n("QuantDescriptor"),ri=n(" defining default tensor quantizers."),ca=h(),Yo=a("p"),ii=n("Example:"),pa=h(),Q(Pt.$$.fragment),ha=h(),me=a("h3"),Ie=a("a"),Xn=a("span"),Q(Ct.$$.fragment),li=h(),Jn=a("span"),di=n("Calibration"),ua=h(),Zo=a("p"),ci=n(`Calibration is the terminology of passing data samples to the quantizer and deciding the best scaling factors for
tensors. After setting up the tensor quantizers, one can use the following example to calibrate the model:`),ma=h(),Q(At.$$.fragment),fa=h(),fe=a("h3"),We=a("a"),Kn=a("span"),Q(Nt.$$.fragment),pi=h(),Gn=a("span"),hi=n("Export to ONNX"),ga=h(),te=a("p"),ui=n("The goal of exporting to ONNX is to deploy inference by "),Lt=a("a"),mi=n("TensorRT"),fi=n(`. Fake
quantization will be broken into a pair of QuantizeLinear/DequantizeLinear ONNX ops. After setting static member of
TensorQuantizer to use Pytorch\u2019s own fake quantization functions, fake quantized model can be exported to ONNX, follow
the instructions in `),Ot=a("a"),gi=n("torch.onnx"),_i=n(". Example:"),_a=h(),Q(St.$$.fragment),ba=h(),ge=a("h2"),He=a("a"),Yn=a("span"),Q(It.$$.fragment),bi=h(),Zn=a("span"),ki=n("QDQBertConfig"),ka=h(),W=a("div"),Q(Wt.$$.fragment),Qi=h(),_e=a("p"),vi=n("This is the configuration class to store the configuration of a "),en=a("a"),wi=n("QDQBertModel"),Ti=n(`. It is used to instantiate an
QDQBERT 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 BERT
`),Ht=a("a"),yi=n("bert-base-uncased"),$i=n(" architecture."),qi=h(),be=a("p"),Di=n("Configuration objects inherit from "),tn=a("a"),zi=n("PretrainedConfig"),Mi=n(` and can be used to control the model outputs. Read the
documentation from `),on=a("a"),Bi=n("PretrainedConfig"),xi=n(" for more information."),Fi=h(),Q(Re.$$.fragment),Qa=h(),ke=a("h2"),Ue=a("a"),es=a("span"),Q(Rt.$$.fragment),Ei=h(),ts=a("span"),ji=n("QDQBertModel"),va=h(),z=a("div"),Q(Ut.$$.fragment),Pi=h(),os=a("p"),Ci=n("The bare QDQBERT Model transformer outputting raw hidden-states without any specific head on top."),Ai=h(),Vt=a("p"),Ni=n("This model inherits from "),nn=a("a"),Li=n("PreTrainedModel"),Oi=n(`. 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.)`),Si=h(),Xt=a("p"),Ii=n("This model is also a PyTorch "),Jt=a("a"),Wi=n("torch.nn.Module"),Hi=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ri=h(),Kt=a("p"),Ui=n(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Gt=a("a"),Vi=n(`Attention is
all you need`),Xi=n(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Ji=h(),M=a("p"),Ki=n("To behave as an decoder the model needs to be initialized with the "),ns=a("code"),Gi=n("is_decoder"),Yi=n(` argument of the configuration set
to `),ss=a("code"),Zi=n("True"),el=n(". To be used in a Seq2Seq model, the model needs to initialized with both "),as=a("code"),tl=n("is_decoder"),ol=n(` argument and
`),rs=a("code"),nl=n("add_cross_attention"),sl=n(" set to "),is=a("code"),al=n("True"),rl=n("; an "),ls=a("code"),il=n("encoder_hidden_states"),ll=n(" is then expected as an input to the forward pass."),dl=h(),U=a("div"),Q(Yt.$$.fragment),cl=h(),Qe=a("p"),pl=n("The "),sn=a("a"),hl=n("QDQBertModel"),ul=n(" forward method, overrides the "),ds=a("code"),ml=n("__call__"),fl=n(" special method."),gl=h(),Q(Ve.$$.fragment),_l=h(),Q(Xe.$$.fragment),wa=h(),ve=a("h2"),Je=a("a"),cs=a("span"),Q(Zt.$$.fragment),bl=h(),ps=a("span"),kl=n("QDQBertLMHeadModel"),Ta=h(),F=a("div"),Q(eo.$$.fragment),Ql=h(),to=a("p"),vl=n("QDQBERT Model with a "),hs=a("code"),wl=n("language modeling"),Tl=n(" head on top for CLM fine-tuning."),yl=h(),oo=a("p"),$l=n("This model inherits from "),an=a("a"),ql=n("PreTrainedModel"),Dl=n(`. 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.)`),zl=h(),no=a("p"),Ml=n("This model is also a PyTorch "),so=a("a"),Bl=n("torch.nn.Module"),xl=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fl=h(),V=a("div"),Q(ao.$$.fragment),El=h(),we=a("p"),jl=n("The "),rn=a("a"),Pl=n("QDQBertLMHeadModel"),Cl=n(" forward method, overrides the "),us=a("code"),Al=n("__call__"),Nl=n(" special method."),Ll=h(),Q(Ke.$$.fragment),Ol=h(),Q(Ge.$$.fragment),ya=h(),Te=a("h2"),Ye=a("a"),ms=a("span"),Q(ro.$$.fragment),Sl=h(),fs=a("span"),Il=n("QDQBertForMaskedLM"),$a=h(),E=a("div"),Q(io.$$.fragment),Wl=h(),lo=a("p"),Hl=n("QDQBERT Model with a "),gs=a("code"),Rl=n("language modeling"),Ul=n(" head on top."),Vl=h(),co=a("p"),Xl=n("This model inherits from "),ln=a("a"),Jl=n("PreTrainedModel"),Kl=n(`. 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.)`),Gl=h(),po=a("p"),Yl=n("This model is also a PyTorch "),ho=a("a"),Zl=n("torch.nn.Module"),ed=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),td=h(),X=a("div"),Q(uo.$$.fragment),od=h(),ye=a("p"),nd=n("The "),dn=a("a"),sd=n("QDQBertForMaskedLM"),ad=n(" forward method, overrides the "),_s=a("code"),rd=n("__call__"),id=n(" special method."),ld=h(),Q(Ze.$$.fragment),dd=h(),Q(et.$$.fragment),qa=h(),$e=a("h2"),tt=a("a"),bs=a("span"),Q(mo.$$.fragment),cd=h(),ks=a("span"),pd=n("QDQBertForSequenceClassification"),Da=h(),j=a("div"),Q(fo.$$.fragment),hd=h(),Qs=a("p"),ud=n(`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),md=h(),go=a("p"),fd=n("This model inherits from "),cn=a("a"),gd=n("PreTrainedModel"),_d=n(`. 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.)`),bd=h(),_o=a("p"),kd=n("This model is also a PyTorch "),bo=a("a"),Qd=n("torch.nn.Module"),vd=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wd=h(),L=a("div"),Q(ko.$$.fragment),Td=h(),qe=a("p"),yd=n("The "),pn=a("a"),$d=n("QDQBertForSequenceClassification"),qd=n(" forward method, overrides the "),vs=a("code"),Dd=n("__call__"),zd=n(" special method."),Md=h(),Q(ot.$$.fragment),Bd=h(),Q(nt.$$.fragment),xd=h(),Q(st.$$.fragment),za=h(),De=a("h2"),at=a("a"),ws=a("span"),Q(Qo.$$.fragment),Fd=h(),Ts=a("span"),Ed=n("QDQBertForNextSentencePrediction"),Ma=h(),P=a("div"),Q(vo.$$.fragment),jd=h(),wo=a("p"),Pd=n("Bert Model with a "),ys=a("code"),Cd=n("next sentence prediction (classification)"),Ad=n(" head on top."),Nd=h(),To=a("p"),Ld=n("This model inherits from "),hn=a("a"),Od=n("PreTrainedModel"),Sd=n(`. 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.)`),Id=h(),yo=a("p"),Wd=n("This model is also a PyTorch "),$o=a("a"),Hd=n("torch.nn.Module"),Rd=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ud=h(),J=a("div"),Q(qo.$$.fragment),Vd=h(),ze=a("p"),Xd=n("The "),un=a("a"),Jd=n("QDQBertForNextSentencePrediction"),Kd=n(" forward method, overrides the "),$s=a("code"),Gd=n("__call__"),Yd=n(" special method."),Zd=h(),Q(rt.$$.fragment),ec=h(),Q(it.$$.fragment),Ba=h(),Me=a("h2"),lt=a("a"),qs=a("span"),Q(Do.$$.fragment),tc=h(),Ds=a("span"),oc=n("QDQBertForMultipleChoice"),xa=h(),C=a("div"),Q(zo.$$.fragment),nc=h(),zs=a("p"),sc=n(`Bert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),ac=h(),Mo=a("p"),rc=n("This model inherits from "),mn=a("a"),ic=n("PreTrainedModel"),lc=n(`. 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.)`),dc=h(),Bo=a("p"),cc=n("This model is also a PyTorch "),xo=a("a"),pc=n("torch.nn.Module"),hc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),uc=h(),K=a("div"),Q(Fo.$$.fragment),mc=h(),Be=a("p"),fc=n("The "),fn=a("a"),gc=n("QDQBertForMultipleChoice"),_c=n(" forward method, overrides the "),Ms=a("code"),bc=n("__call__"),kc=n(" special method."),Qc=h(),Q(dt.$$.fragment),vc=h(),Q(ct.$$.fragment),Fa=h(),xe=a("h2"),pt=a("a"),Bs=a("span"),Q(Eo.$$.fragment),wc=h(),xs=a("span"),Tc=n("QDQBertForTokenClassification"),Ea=h(),A=a("div"),Q(jo.$$.fragment),yc=h(),Fs=a("p"),$c=n(`QDQBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),qc=h(),Po=a("p"),Dc=n("This model inherits from "),gn=a("a"),zc=n("PreTrainedModel"),Mc=n(`. 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.)`),Bc=h(),Co=a("p"),xc=n("This model is also a PyTorch "),Ao=a("a"),Fc=n("torch.nn.Module"),Ec=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jc=h(),G=a("div"),Q(No.$$.fragment),Pc=h(),Fe=a("p"),Cc=n("The "),_n=a("a"),Ac=n("QDQBertForTokenClassification"),Nc=n(" forward method, overrides the "),Es=a("code"),Lc=n("__call__"),Oc=n(" special method."),Sc=h(),Q(ht.$$.fragment),Ic=h(),Q(ut.$$.fragment),ja=h(),Ee=a("h2"),mt=a("a"),js=a("span"),Q(Lo.$$.fragment),Wc=h(),Ps=a("span"),Hc=n("QDQBertForQuestionAnswering"),Pa=h(),N=a("div"),Q(Oo.$$.fragment),Rc=h(),je=a("p"),Uc=n(`QDQBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),Cs=a("code"),Vc=n("span start logits"),Xc=n(" and "),As=a("code"),Jc=n("span end logits"),Kc=n(")."),Gc=h(),So=a("p"),Yc=n("This model inherits from "),bn=a("a"),Zc=n("PreTrainedModel"),ep=n(`. 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.)`),tp=h(),Io=a("p"),op=n("This model is also a PyTorch "),Wo=a("a"),np=n("torch.nn.Module"),sp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ap=h(),Y=a("div"),Q(Ho.$$.fragment),rp=h(),Pe=a("p"),ip=n("The "),kn=a("a"),lp=n("QDQBertForQuestionAnswering"),dp=n(" forward method, overrides the "),Ns=a("code"),cp=n("__call__"),pp=n(" special method."),hp=h(),Q(ft.$$.fragment),up=h(),Q(gt.$$.fragment),this.h()},l(t){const f=mu('[data-svelte="svelte-1phssyn"]',document.head);d=r(f,"META",{name:!0,content:!0}),f.forEach(o),k=u(t),g=r(t,"H1",{class:!0});var Ro=i(g);m=r(Ro,"A",{id:!0,class:!0,href:!0});var Ls=i(m);b=r(Ls,"SPAN",{});var Os=i(b);v(l.$$.fragment,Os),Os.forEach(o),Ls.forEach(o),c=u(Ro),D=r(Ro,"SPAN",{});var Ss=i(D);kr=s(Ss,"QDQBERT"),Ss.forEach(o),Ro.forEach(o),ea=u(t),he=r(t,"H2",{class:!0});var Uo=i(he);Ce=r(Uo,"A",{id:!0,class:!0,href:!0});var Is=i(Ce);Fn=r(Is,"SPAN",{});var Ws=i(Fn);v(qt.$$.fragment,Ws),Ws.forEach(o),Is.forEach(o),Qr=u(Uo),En=r(Uo,"SPAN",{});var Hs=i(En);vr=s(Hs,"Overview"),Hs.forEach(o),Uo.forEach(o),ta=u(t),Ae=r(t,"P",{});var Vo=i(Ae);wr=s(Vo,"The QDQBERT model can be referenced in "),Dt=r(Vo,"A",{href:!0,rel:!0});var Rs=i(Dt);Tr=s(Rs,`Integer Quantization for Deep Learning Inference: Principles and Empirical
Evaluation`),Rs.forEach(o),yr=s(Vo,` by Hao Wu, Patrick Judd, Xiaojie Zhang, Mikhail Isaev and Paulius
Micikevicius.`),Vo.forEach(o),oa=u(t),Xo=r(t,"P",{});var Us=i(Xo);$r=s(Us,"The abstract from the paper is the following:"),Us.forEach(o),na=u(t),Jo=r(t,"P",{});var Vs=i(Jo);jn=r(Vs,"EM",{});var Xs=i(jn);qr=s(Xs,`Quantization techniques can reduce the size of Deep Neural Networks and improve inference latency and throughput by
taking advantage of high throughput integer instructions. In this paper we review the mathematical aspects of
quantization parameters and evaluate their choices on a wide range of neural network models for different application
domains, including vision, speech, and language. We focus on quantization techniques that are amenable to acceleration
by processors with high-throughput integer math pipelines. We also present a workflow for 8-bit quantization that is
able to maintain accuracy within 1% of the floating-point baseline on all networks studied, including models that are
more difficult to quantize, such as MobileNets and BERT-large.`),Xs.forEach(o),Vs.forEach(o),sa=u(t),Ko=r(t,"P",{});var Js=i(Ko);Dr=s(Js,"Tips:"),Js.forEach(o),aa=u(t),R=r(t,"UL",{});var ee=i(R);Pn=r(ee,"LI",{});var Ks=i(Pn);Cn=r(Ks,"P",{});var Gs=i(Cn);zr=s(Gs,`QDQBERT model adds fake quantization operations (pair of QuantizeLinear/DequantizeLinear ops) to (i) linear layer
inputs and weights, (ii) matmul inputs, (iii) residual add inputs, in BERT model.`),Gs.forEach(o),Ks.forEach(o),Mr=u(ee),An=r(ee,"LI",{});var Ys=i(An);Ne=r(Ys,"P",{});var Zs=i(Ne);Br=s(Zs,"QDQBERT requires the dependency of "),zt=r(Zs,"A",{href:!0,rel:!0});var mp=i(zt);xr=s(mp,"Pytorch Quantization Toolkit"),mp.forEach(o),Fr=s(Zs,". To install "),Nn=r(Zs,"CODE",{});var fp=i(Nn);Er=s(fp,"pip install pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com"),fp.forEach(o),Zs.forEach(o),Ys.forEach(o),jr=u(ee),Ln=r(ee,"LI",{});var gp=i(Ln);Mt=r(gp,"P",{});var Aa=i(Mt);Pr=s(Aa,"QDQBERT model can be loaded from any checkpoint of HuggingFace BERT model (for example "),On=r(Aa,"EM",{});var _p=i(On);Cr=s(_p,"bert-base-uncased"),_p.forEach(o),Ar=s(Aa,`), and
perform Quantization Aware Training/Post Training Quantization.`),Aa.forEach(o),gp.forEach(o),Nr=u(ee),Sn=r(ee,"LI",{});var bp=i(Sn);Bt=r(bp,"P",{});var Na=i(Bt);Lr=s(Na,`A complete example of using QDQBERT model to perform Quatization Aware Training and Post Training Quantization for
SQUAD task can be found at `),Go=r(Na,"A",{href:!0});var kp=i(Go);Or=s(kp,"transformers/examples/research_projects/quantization-qdqbert/"),kp.forEach(o),Sr=s(Na,"."),Na.forEach(o),bp.forEach(o),ee.forEach(o),ra=u(t),Le=r(t,"P",{});var La=i(Le);Ir=s(La,"This model was contributed by "),xt=r(La,"A",{href:!0,rel:!0});var Qp=i(xt);Wr=s(Qp,"shangz"),Qp.forEach(o),Hr=s(La,"."),La.forEach(o),ia=u(t),ue=r(t,"H3",{class:!0});var Oa=i(ue);Oe=r(Oa,"A",{id:!0,class:!0,href:!0});var vp=i(Oe);In=r(vp,"SPAN",{});var wp=i(In);v(Ft.$$.fragment,wp),wp.forEach(o),vp.forEach(o),Rr=u(Oa),Wn=r(Oa,"SPAN",{});var Tp=i(Wn);Ur=s(Tp,"Set default quantizers"),Tp.forEach(o),Oa.forEach(o),la=u(t),x=r(t,"P",{});var Z=i(x);Vr=s(Z,`QDQBERT model adds fake quantization operations (pair of QuantizeLinear/DequantizeLinear ops) to BERT by
`),Hn=r(Z,"CODE",{});var yp=i(Hn);Xr=s(yp,"TensorQuantizer"),yp.forEach(o),Jr=s(Z," in "),Et=r(Z,"A",{href:!0,rel:!0});var $p=i(Et);Kr=s($p,"Pytorch Quantization Toolkit"),$p.forEach(o),Gr=s(Z,". "),Rn=r(Z,"CODE",{});var qp=i(Rn);Yr=s(qp,"TensorQuantizer"),qp.forEach(o),Zr=s(Z,` is the module
for quantizing tensors, with `),Un=r(Z,"CODE",{});var Dp=i(Un);ei=s(Dp,"QuantDescriptor"),Dp.forEach(o),ti=s(Z," defining how the tensor should be quantized. Refer to "),jt=r(Z,"A",{href:!0,rel:!0});var zp=i(jt);oi=s(zp,`Pytorch
Quantization Toolkit userguide`),zp.forEach(o),ni=s(Z," for more details."),Z.forEach(o),da=u(t),Se=r(t,"P",{});var Sa=i(Se);si=s(Sa,"Before creating QDQBERT model, one has to set the default "),Vn=r(Sa,"CODE",{});var Mp=i(Vn);ai=s(Mp,"QuantDescriptor"),Mp.forEach(o),ri=s(Sa," defining default tensor quantizers."),Sa.forEach(o),ca=u(t),Yo=r(t,"P",{});var Bp=i(Yo);ii=s(Bp,"Example:"),Bp.forEach(o),pa=u(t),v(Pt.$$.fragment,t),ha=u(t),me=r(t,"H3",{class:!0});var Ia=i(me);Ie=r(Ia,"A",{id:!0,class:!0,href:!0});var xp=i(Ie);Xn=r(xp,"SPAN",{});var Fp=i(Xn);v(Ct.$$.fragment,Fp),Fp.forEach(o),xp.forEach(o),li=u(Ia),Jn=r(Ia,"SPAN",{});var Ep=i(Jn);di=s(Ep,"Calibration"),Ep.forEach(o),Ia.forEach(o),ua=u(t),Zo=r(t,"P",{});var jp=i(Zo);ci=s(jp,`Calibration is the terminology of passing data samples to the quantizer and deciding the best scaling factors for
tensors. After setting up the tensor quantizers, one can use the following example to calibrate the model:`),jp.forEach(o),ma=u(t),v(At.$$.fragment,t),fa=u(t),fe=r(t,"H3",{class:!0});var Wa=i(fe);We=r(Wa,"A",{id:!0,class:!0,href:!0});var Pp=i(We);Kn=r(Pp,"SPAN",{});var Cp=i(Kn);v(Nt.$$.fragment,Cp),Cp.forEach(o),Pp.forEach(o),pi=u(Wa),Gn=r(Wa,"SPAN",{});var Ap=i(Gn);hi=s(Ap,"Export to ONNX"),Ap.forEach(o),Wa.forEach(o),ga=u(t),te=r(t,"P",{});var Qn=i(te);ui=s(Qn,"The goal of exporting to ONNX is to deploy inference by "),Lt=r(Qn,"A",{href:!0,rel:!0});var Np=i(Lt);mi=s(Np,"TensorRT"),Np.forEach(o),fi=s(Qn,`. Fake
quantization will be broken into a pair of QuantizeLinear/DequantizeLinear ONNX ops. After setting static member of
TensorQuantizer to use Pytorch\u2019s own fake quantization functions, fake quantized model can be exported to ONNX, follow
the instructions in `),Ot=r(Qn,"A",{href:!0,rel:!0});var Lp=i(Ot);gi=s(Lp,"torch.onnx"),Lp.forEach(o),_i=s(Qn,". Example:"),Qn.forEach(o),_a=u(t),v(St.$$.fragment,t),ba=u(t),ge=r(t,"H2",{class:!0});var Ha=i(ge);He=r(Ha,"A",{id:!0,class:!0,href:!0});var Op=i(He);Yn=r(Op,"SPAN",{});var Sp=i(Yn);v(It.$$.fragment,Sp),Sp.forEach(o),Op.forEach(o),bi=u(Ha),Zn=r(Ha,"SPAN",{});var Ip=i(Zn);ki=s(Ip,"QDQBertConfig"),Ip.forEach(o),Ha.forEach(o),ka=u(t),W=r(t,"DIV",{class:!0});var _t=i(W);v(Wt.$$.fragment,_t),Qi=u(_t),_e=r(_t,"P",{});var vn=i(_e);vi=s(vn,"This is the configuration class to store the configuration of a "),en=r(vn,"A",{href:!0});var Wp=i(en);wi=s(Wp,"QDQBertModel"),Wp.forEach(o),Ti=s(vn,`. It is used to instantiate an
QDQBERT 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 BERT
`),Ht=r(vn,"A",{href:!0,rel:!0});var Hp=i(Ht);yi=s(Hp,"bert-base-uncased"),Hp.forEach(o),$i=s(vn," architecture."),vn.forEach(o),qi=u(_t),be=r(_t,"P",{});var wn=i(be);Di=s(wn,"Configuration objects inherit from "),tn=r(wn,"A",{href:!0});var Rp=i(tn);zi=s(Rp,"PretrainedConfig"),Rp.forEach(o),Mi=s(wn,` and can be used to control the model outputs. Read the
documentation from `),on=r(wn,"A",{href:!0});var Up=i(on);Bi=s(Up,"PretrainedConfig"),Up.forEach(o),xi=s(wn," for more information."),wn.forEach(o),Fi=u(_t),v(Re.$$.fragment,_t),_t.forEach(o),Qa=u(t),ke=r(t,"H2",{class:!0});var Ra=i(ke);Ue=r(Ra,"A",{id:!0,class:!0,href:!0});var Vp=i(Ue);es=r(Vp,"SPAN",{});var Xp=i(es);v(Rt.$$.fragment,Xp),Xp.forEach(o),Vp.forEach(o),Ei=u(Ra),ts=r(Ra,"SPAN",{});var Jp=i(ts);ji=s(Jp,"QDQBertModel"),Jp.forEach(o),Ra.forEach(o),va=u(t),z=r(t,"DIV",{class:!0});var O=i(z);v(Ut.$$.fragment,O),Pi=u(O),os=r(O,"P",{});var Kp=i(os);Ci=s(Kp,"The bare QDQBERT Model transformer outputting raw hidden-states without any specific head on top."),Kp.forEach(o),Ai=u(O),Vt=r(O,"P",{});var Ua=i(Vt);Ni=s(Ua,"This model inherits from "),nn=r(Ua,"A",{href:!0});var Gp=i(nn);Li=s(Gp,"PreTrainedModel"),Gp.forEach(o),Oi=s(Ua,`. 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.)`),Ua.forEach(o),Si=u(O),Xt=r(O,"P",{});var Va=i(Xt);Ii=s(Va,"This model is also a PyTorch "),Jt=r(Va,"A",{href:!0,rel:!0});var Yp=i(Jt);Wi=s(Yp,"torch.nn.Module"),Yp.forEach(o),Hi=s(Va,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Va.forEach(o),Ri=u(O),Kt=r(O,"P",{});var Xa=i(Kt);Ui=s(Xa,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Gt=r(Xa,"A",{href:!0,rel:!0});var Zp=i(Gt);Vi=s(Zp,`Attention is
all you need`),Zp.forEach(o),Xi=s(Xa,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Xa.forEach(o),Ji=u(O),M=r(O,"P",{});var S=i(M);Ki=s(S,"To behave as an decoder the model needs to be initialized with the "),ns=r(S,"CODE",{});var eh=i(ns);Gi=s(eh,"is_decoder"),eh.forEach(o),Yi=s(S,` argument of the configuration set
to `),ss=r(S,"CODE",{});var th=i(ss);Zi=s(th,"True"),th.forEach(o),el=s(S,". To be used in a Seq2Seq model, the model needs to initialized with both "),as=r(S,"CODE",{});var oh=i(as);tl=s(oh,"is_decoder"),oh.forEach(o),ol=s(S,` argument and
`),rs=r(S,"CODE",{});var nh=i(rs);nl=s(nh,"add_cross_attention"),nh.forEach(o),sl=s(S," set to "),is=r(S,"CODE",{});var sh=i(is);al=s(sh,"True"),sh.forEach(o),rl=s(S,"; an "),ls=r(S,"CODE",{});var ah=i(ls);il=s(ah,"encoder_hidden_states"),ah.forEach(o),ll=s(S," is then expected as an input to the forward pass."),S.forEach(o),dl=u(O),U=r(O,"DIV",{class:!0});var bt=i(U);v(Yt.$$.fragment,bt),cl=u(bt),Qe=r(bt,"P",{});var Tn=i(Qe);pl=s(Tn,"The "),sn=r(Tn,"A",{href:!0});var rh=i(sn);hl=s(rh,"QDQBertModel"),rh.forEach(o),ul=s(Tn," forward method, overrides the "),ds=r(Tn,"CODE",{});var ih=i(ds);ml=s(ih,"__call__"),ih.forEach(o),fl=s(Tn," special method."),Tn.forEach(o),gl=u(bt),v(Ve.$$.fragment,bt),_l=u(bt),v(Xe.$$.fragment,bt),bt.forEach(o),O.forEach(o),wa=u(t),ve=r(t,"H2",{class:!0});var Ja=i(ve);Je=r(Ja,"A",{id:!0,class:!0,href:!0});var lh=i(Je);cs=r(lh,"SPAN",{});var dh=i(cs);v(Zt.$$.fragment,dh),dh.forEach(o),lh.forEach(o),bl=u(Ja),ps=r(Ja,"SPAN",{});var ch=i(ps);kl=s(ch,"QDQBertLMHeadModel"),ch.forEach(o),Ja.forEach(o),Ta=u(t),F=r(t,"DIV",{class:!0});var oe=i(F);v(eo.$$.fragment,oe),Ql=u(oe),to=r(oe,"P",{});var Ka=i(to);vl=s(Ka,"QDQBERT Model with a "),hs=r(Ka,"CODE",{});var ph=i(hs);wl=s(ph,"language modeling"),ph.forEach(o),Tl=s(Ka," head on top for CLM fine-tuning."),Ka.forEach(o),yl=u(oe),oo=r(oe,"P",{});var Ga=i(oo);$l=s(Ga,"This model inherits from "),an=r(Ga,"A",{href:!0});var hh=i(an);ql=s(hh,"PreTrainedModel"),hh.forEach(o),Dl=s(Ga,`. 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.)`),Ga.forEach(o),zl=u(oe),no=r(oe,"P",{});var Ya=i(no);Ml=s(Ya,"This model is also a PyTorch "),so=r(Ya,"A",{href:!0,rel:!0});var uh=i(so);Bl=s(uh,"torch.nn.Module"),uh.forEach(o),xl=s(Ya,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ya.forEach(o),Fl=u(oe),V=r(oe,"DIV",{class:!0});var kt=i(V);v(ao.$$.fragment,kt),El=u(kt),we=r(kt,"P",{});var yn=i(we);jl=s(yn,"The "),rn=r(yn,"A",{href:!0});var mh=i(rn);Pl=s(mh,"QDQBertLMHeadModel"),mh.forEach(o),Cl=s(yn," forward method, overrides the "),us=r(yn,"CODE",{});var fh=i(us);Al=s(fh,"__call__"),fh.forEach(o),Nl=s(yn," special method."),yn.forEach(o),Ll=u(kt),v(Ke.$$.fragment,kt),Ol=u(kt),v(Ge.$$.fragment,kt),kt.forEach(o),oe.forEach(o),ya=u(t),Te=r(t,"H2",{class:!0});var Za=i(Te);Ye=r(Za,"A",{id:!0,class:!0,href:!0});var gh=i(Ye);ms=r(gh,"SPAN",{});var _h=i(ms);v(ro.$$.fragment,_h),_h.forEach(o),gh.forEach(o),Sl=u(Za),fs=r(Za,"SPAN",{});var bh=i(fs);Il=s(bh,"QDQBertForMaskedLM"),bh.forEach(o),Za.forEach(o),$a=u(t),E=r(t,"DIV",{class:!0});var ne=i(E);v(io.$$.fragment,ne),Wl=u(ne),lo=r(ne,"P",{});var er=i(lo);Hl=s(er,"QDQBERT Model with a "),gs=r(er,"CODE",{});var kh=i(gs);Rl=s(kh,"language modeling"),kh.forEach(o),Ul=s(er," head on top."),er.forEach(o),Vl=u(ne),co=r(ne,"P",{});var tr=i(co);Xl=s(tr,"This model inherits from "),ln=r(tr,"A",{href:!0});var Qh=i(ln);Jl=s(Qh,"PreTrainedModel"),Qh.forEach(o),Kl=s(tr,`. 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.)`),tr.forEach(o),Gl=u(ne),po=r(ne,"P",{});var or=i(po);Yl=s(or,"This model is also a PyTorch "),ho=r(or,"A",{href:!0,rel:!0});var vh=i(ho);Zl=s(vh,"torch.nn.Module"),vh.forEach(o),ed=s(or,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),or.forEach(o),td=u(ne),X=r(ne,"DIV",{class:!0});var Qt=i(X);v(uo.$$.fragment,Qt),od=u(Qt),ye=r(Qt,"P",{});var $n=i(ye);nd=s($n,"The "),dn=r($n,"A",{href:!0});var wh=i(dn);sd=s(wh,"QDQBertForMaskedLM"),wh.forEach(o),ad=s($n," forward method, overrides the "),_s=r($n,"CODE",{});var Th=i(_s);rd=s(Th,"__call__"),Th.forEach(o),id=s($n," special method."),$n.forEach(o),ld=u(Qt),v(Ze.$$.fragment,Qt),dd=u(Qt),v(et.$$.fragment,Qt),Qt.forEach(o),ne.forEach(o),qa=u(t),$e=r(t,"H2",{class:!0});var nr=i($e);tt=r(nr,"A",{id:!0,class:!0,href:!0});var yh=i(tt);bs=r(yh,"SPAN",{});var $h=i(bs);v(mo.$$.fragment,$h),$h.forEach(o),yh.forEach(o),cd=u(nr),ks=r(nr,"SPAN",{});var qh=i(ks);pd=s(qh,"QDQBertForSequenceClassification"),qh.forEach(o),nr.forEach(o),Da=u(t),j=r(t,"DIV",{class:!0});var se=i(j);v(fo.$$.fragment,se),hd=u(se),Qs=r(se,"P",{});var Dh=i(Qs);ud=s(Dh,`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Dh.forEach(o),md=u(se),go=r(se,"P",{});var sr=i(go);fd=s(sr,"This model inherits from "),cn=r(sr,"A",{href:!0});var zh=i(cn);gd=s(zh,"PreTrainedModel"),zh.forEach(o),_d=s(sr,`. 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.)`),sr.forEach(o),bd=u(se),_o=r(se,"P",{});var ar=i(_o);kd=s(ar,"This model is also a PyTorch "),bo=r(ar,"A",{href:!0,rel:!0});var Mh=i(bo);Qd=s(Mh,"torch.nn.Module"),Mh.forEach(o),vd=s(ar,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ar.forEach(o),wd=u(se),L=r(se,"DIV",{class:!0});var ae=i(L);v(ko.$$.fragment,ae),Td=u(ae),qe=r(ae,"P",{});var qn=i(qe);yd=s(qn,"The "),pn=r(qn,"A",{href:!0});var Bh=i(pn);$d=s(Bh,"QDQBertForSequenceClassification"),Bh.forEach(o),qd=s(qn," forward method, overrides the "),vs=r(qn,"CODE",{});var xh=i(vs);Dd=s(xh,"__call__"),xh.forEach(o),zd=s(qn," special method."),qn.forEach(o),Md=u(ae),v(ot.$$.fragment,ae),Bd=u(ae),v(nt.$$.fragment,ae),xd=u(ae),v(st.$$.fragment,ae),ae.forEach(o),se.forEach(o),za=u(t),De=r(t,"H2",{class:!0});var rr=i(De);at=r(rr,"A",{id:!0,class:!0,href:!0});var Fh=i(at);ws=r(Fh,"SPAN",{});var Eh=i(ws);v(Qo.$$.fragment,Eh),Eh.forEach(o),Fh.forEach(o),Fd=u(rr),Ts=r(rr,"SPAN",{});var jh=i(Ts);Ed=s(jh,"QDQBertForNextSentencePrediction"),jh.forEach(o),rr.forEach(o),Ma=u(t),P=r(t,"DIV",{class:!0});var re=i(P);v(vo.$$.fragment,re),jd=u(re),wo=r(re,"P",{});var ir=i(wo);Pd=s(ir,"Bert Model with a "),ys=r(ir,"CODE",{});var Ph=i(ys);Cd=s(Ph,"next sentence prediction (classification)"),Ph.forEach(o),Ad=s(ir," head on top."),ir.forEach(o),Nd=u(re),To=r(re,"P",{});var lr=i(To);Ld=s(lr,"This model inherits from "),hn=r(lr,"A",{href:!0});var Ch=i(hn);Od=s(Ch,"PreTrainedModel"),Ch.forEach(o),Sd=s(lr,`. 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.)`),lr.forEach(o),Id=u(re),yo=r(re,"P",{});var dr=i(yo);Wd=s(dr,"This model is also a PyTorch "),$o=r(dr,"A",{href:!0,rel:!0});var Ah=i($o);Hd=s(Ah,"torch.nn.Module"),Ah.forEach(o),Rd=s(dr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dr.forEach(o),Ud=u(re),J=r(re,"DIV",{class:!0});var vt=i(J);v(qo.$$.fragment,vt),Vd=u(vt),ze=r(vt,"P",{});var Dn=i(ze);Xd=s(Dn,"The "),un=r(Dn,"A",{href:!0});var Nh=i(un);Jd=s(Nh,"QDQBertForNextSentencePrediction"),Nh.forEach(o),Kd=s(Dn," forward method, overrides the "),$s=r(Dn,"CODE",{});var Lh=i($s);Gd=s(Lh,"__call__"),Lh.forEach(o),Yd=s(Dn," special method."),Dn.forEach(o),Zd=u(vt),v(rt.$$.fragment,vt),ec=u(vt),v(it.$$.fragment,vt),vt.forEach(o),re.forEach(o),Ba=u(t),Me=r(t,"H2",{class:!0});var cr=i(Me);lt=r(cr,"A",{id:!0,class:!0,href:!0});var Oh=i(lt);qs=r(Oh,"SPAN",{});var Sh=i(qs);v(Do.$$.fragment,Sh),Sh.forEach(o),Oh.forEach(o),tc=u(cr),Ds=r(cr,"SPAN",{});var Ih=i(Ds);oc=s(Ih,"QDQBertForMultipleChoice"),Ih.forEach(o),cr.forEach(o),xa=u(t),C=r(t,"DIV",{class:!0});var ie=i(C);v(zo.$$.fragment,ie),nc=u(ie),zs=r(ie,"P",{});var Wh=i(zs);sc=s(Wh,`Bert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),Wh.forEach(o),ac=u(ie),Mo=r(ie,"P",{});var pr=i(Mo);rc=s(pr,"This model inherits from "),mn=r(pr,"A",{href:!0});var Hh=i(mn);ic=s(Hh,"PreTrainedModel"),Hh.forEach(o),lc=s(pr,`. 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.)`),pr.forEach(o),dc=u(ie),Bo=r(ie,"P",{});var hr=i(Bo);cc=s(hr,"This model is also a PyTorch "),xo=r(hr,"A",{href:!0,rel:!0});var Rh=i(xo);pc=s(Rh,"torch.nn.Module"),Rh.forEach(o),hc=s(hr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hr.forEach(o),uc=u(ie),K=r(ie,"DIV",{class:!0});var wt=i(K);v(Fo.$$.fragment,wt),mc=u(wt),Be=r(wt,"P",{});var zn=i(Be);fc=s(zn,"The "),fn=r(zn,"A",{href:!0});var Uh=i(fn);gc=s(Uh,"QDQBertForMultipleChoice"),Uh.forEach(o),_c=s(zn," forward method, overrides the "),Ms=r(zn,"CODE",{});var Vh=i(Ms);bc=s(Vh,"__call__"),Vh.forEach(o),kc=s(zn," special method."),zn.forEach(o),Qc=u(wt),v(dt.$$.fragment,wt),vc=u(wt),v(ct.$$.fragment,wt),wt.forEach(o),ie.forEach(o),Fa=u(t),xe=r(t,"H2",{class:!0});var ur=i(xe);pt=r(ur,"A",{id:!0,class:!0,href:!0});var Xh=i(pt);Bs=r(Xh,"SPAN",{});var Jh=i(Bs);v(Eo.$$.fragment,Jh),Jh.forEach(o),Xh.forEach(o),wc=u(ur),xs=r(ur,"SPAN",{});var Kh=i(xs);Tc=s(Kh,"QDQBertForTokenClassification"),Kh.forEach(o),ur.forEach(o),Ea=u(t),A=r(t,"DIV",{class:!0});var le=i(A);v(jo.$$.fragment,le),yc=u(le),Fs=r(le,"P",{});var Gh=i(Fs);$c=s(Gh,`QDQBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Gh.forEach(o),qc=u(le),Po=r(le,"P",{});var mr=i(Po);Dc=s(mr,"This model inherits from "),gn=r(mr,"A",{href:!0});var Yh=i(gn);zc=s(Yh,"PreTrainedModel"),Yh.forEach(o),Mc=s(mr,`. 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.)`),mr.forEach(o),Bc=u(le),Co=r(le,"P",{});var fr=i(Co);xc=s(fr,"This model is also a PyTorch "),Ao=r(fr,"A",{href:!0,rel:!0});var Zh=i(Ao);Fc=s(Zh,"torch.nn.Module"),Zh.forEach(o),Ec=s(fr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fr.forEach(o),jc=u(le),G=r(le,"DIV",{class:!0});var Tt=i(G);v(No.$$.fragment,Tt),Pc=u(Tt),Fe=r(Tt,"P",{});var Mn=i(Fe);Cc=s(Mn,"The "),_n=r(Mn,"A",{href:!0});var eu=i(_n);Ac=s(eu,"QDQBertForTokenClassification"),eu.forEach(o),Nc=s(Mn," forward method, overrides the "),Es=r(Mn,"CODE",{});var tu=i(Es);Lc=s(tu,"__call__"),tu.forEach(o),Oc=s(Mn," special method."),Mn.forEach(o),Sc=u(Tt),v(ht.$$.fragment,Tt),Ic=u(Tt),v(ut.$$.fragment,Tt),Tt.forEach(o),le.forEach(o),ja=u(t),Ee=r(t,"H2",{class:!0});var gr=i(Ee);mt=r(gr,"A",{id:!0,class:!0,href:!0});var ou=i(mt);js=r(ou,"SPAN",{});var nu=i(js);v(Lo.$$.fragment,nu),nu.forEach(o),ou.forEach(o),Wc=u(gr),Ps=r(gr,"SPAN",{});var su=i(Ps);Hc=s(su,"QDQBertForQuestionAnswering"),su.forEach(o),gr.forEach(o),Pa=u(t),N=r(t,"DIV",{class:!0});var de=i(N);v(Oo.$$.fragment,de),Rc=u(de),je=r(de,"P",{});var Bn=i(je);Uc=s(Bn,`QDQBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),Cs=r(Bn,"CODE",{});var au=i(Cs);Vc=s(au,"span start logits"),au.forEach(o),Xc=s(Bn," and "),As=r(Bn,"CODE",{});var ru=i(As);Jc=s(ru,"span end logits"),ru.forEach(o),Kc=s(Bn,")."),Bn.forEach(o),Gc=u(de),So=r(de,"P",{});var _r=i(So);Yc=s(_r,"This model inherits from "),bn=r(_r,"A",{href:!0});var iu=i(bn);Zc=s(iu,"PreTrainedModel"),iu.forEach(o),ep=s(_r,`. 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.)`),_r.forEach(o),tp=u(de),Io=r(de,"P",{});var br=i(Io);op=s(br,"This model is also a PyTorch "),Wo=r(br,"A",{href:!0,rel:!0});var lu=i(Wo);np=s(lu,"torch.nn.Module"),lu.forEach(o),sp=s(br,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),br.forEach(o),ap=u(de),Y=r(de,"DIV",{class:!0});var yt=i(Y);v(Ho.$$.fragment,yt),rp=u(yt),Pe=r(yt,"P",{});var xn=i(Pe);ip=s(xn,"The "),kn=r(xn,"A",{href:!0});var du=i(kn);lp=s(du,"QDQBertForQuestionAnswering"),du.forEach(o),dp=s(xn," forward method, overrides the "),Ns=r(xn,"CODE",{});var cu=i(Ns);cp=s(cu,"__call__"),cu.forEach(o),pp=s(xn," special method."),xn.forEach(o),hp=u(yt),v(ft.$$.fragment,yt),up=u(yt),v(gt.$$.fragment,yt),yt.forEach(o),de.forEach(o),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(Pu)),p(m,"id","qdqbert"),p(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"),p(m,"href","#qdqbert"),p(g,"class","relative group"),p(Ce,"id","overview"),p(Ce,"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"),p(Ce,"href","#overview"),p(he,"class","relative group"),p(Dt,"href","https://arxiv.org/abs/2004.09602"),p(Dt,"rel","nofollow"),p(zt,"href","https://github.com/NVIDIA/TensorRT/tree/master/tools/pytorch-quantization"),p(zt,"rel","nofollow"),p(Go,"href","examples/research_projects/quantization-qdqbert/"),p(xt,"href","https://huggingface.co/shangz"),p(xt,"rel","nofollow"),p(Oe,"id","set-default-quantizers"),p(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"),p(Oe,"href","#set-default-quantizers"),p(ue,"class","relative group"),p(Et,"href","https://github.com/NVIDIA/TensorRT/tree/master/tools/pytorch-quantization"),p(Et,"rel","nofollow"),p(jt,"href","https://docs.nvidia.com/deeplearning/tensorrt/pytorch-quantization-toolkit/docs/userguide.html"),p(jt,"rel","nofollow"),p(Ie,"id","calibration"),p(Ie,"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"),p(Ie,"href","#calibration"),p(me,"class","relative group"),p(We,"id","export-to-onnx"),p(We,"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"),p(We,"href","#export-to-onnx"),p(fe,"class","relative group"),p(Lt,"href","https://developer.nvidia.com/tensorrt"),p(Lt,"rel","nofollow"),p(Ot,"href","https://pytorch.org/docs/stable/onnx.html"),p(Ot,"rel","nofollow"),p(He,"id","transformers.QDQBertConfig"),p(He,"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"),p(He,"href","#transformers.QDQBertConfig"),p(ge,"class","relative group"),p(en,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertModel"),p(Ht,"href","https://huggingface.co/bert-base-uncased"),p(Ht,"rel","nofollow"),p(tn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(on,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ue,"id","transformers.QDQBertModel"),p(Ue,"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"),p(Ue,"href","#transformers.QDQBertModel"),p(ke,"class","relative group"),p(nn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Jt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Jt,"rel","nofollow"),p(Gt,"href","https://arxiv.org/abs/1706.03762"),p(Gt,"rel","nofollow"),p(sn,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertModel"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Je,"id","transformers.QDQBertLMHeadModel"),p(Je,"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"),p(Je,"href","#transformers.QDQBertLMHeadModel"),p(ve,"class","relative group"),p(an,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(so,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(so,"rel","nofollow"),p(rn,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertLMHeadModel"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ye,"id","transformers.QDQBertForMaskedLM"),p(Ye,"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"),p(Ye,"href","#transformers.QDQBertForMaskedLM"),p(Te,"class","relative group"),p(ln,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(ho,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ho,"rel","nofollow"),p(dn,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertForMaskedLM"),p(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(tt,"id","transformers.QDQBertForSequenceClassification"),p(tt,"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"),p(tt,"href","#transformers.QDQBertForSequenceClassification"),p($e,"class","relative group"),p(cn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(bo,"rel","nofollow"),p(pn,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertForSequenceClassification"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(at,"id","transformers.QDQBertForNextSentencePrediction"),p(at,"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"),p(at,"href","#transformers.QDQBertForNextSentencePrediction"),p(De,"class","relative group"),p(hn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p($o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p($o,"rel","nofollow"),p(un,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertForNextSentencePrediction"),p(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(lt,"id","transformers.QDQBertForMultipleChoice"),p(lt,"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"),p(lt,"href","#transformers.QDQBertForMultipleChoice"),p(Me,"class","relative group"),p(mn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(xo,"rel","nofollow"),p(fn,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertForMultipleChoice"),p(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(pt,"id","transformers.QDQBertForTokenClassification"),p(pt,"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"),p(pt,"href","#transformers.QDQBertForTokenClassification"),p(xe,"class","relative group"),p(gn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Ao,"rel","nofollow"),p(_n,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertForTokenClassification"),p(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(mt,"id","transformers.QDQBertForQuestionAnswering"),p(mt,"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"),p(mt,"href","#transformers.QDQBertForQuestionAnswering"),p(Ee,"class","relative group"),p(bn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Wo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Wo,"rel","nofollow"),p(kn,"href","/docs/transformers/main/en/model_doc/qdqbert#transformers.QDQBertForQuestionAnswering"),p(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,f){e(document.head,d),_(t,k,f),_(t,g,f),e(g,m),e(m,b),w(l,b,null),e(g,c),e(g,D),e(D,kr),_(t,ea,f),_(t,he,f),e(he,Ce),e(Ce,Fn),w(qt,Fn,null),e(he,Qr),e(he,En),e(En,vr),_(t,ta,f),_(t,Ae,f),e(Ae,wr),e(Ae,Dt),e(Dt,Tr),e(Ae,yr),_(t,oa,f),_(t,Xo,f),e(Xo,$r),_(t,na,f),_(t,Jo,f),e(Jo,jn),e(jn,qr),_(t,sa,f),_(t,Ko,f),e(Ko,Dr),_(t,aa,f),_(t,R,f),e(R,Pn),e(Pn,Cn),e(Cn,zr),e(R,Mr),e(R,An),e(An,Ne),e(Ne,Br),e(Ne,zt),e(zt,xr),e(Ne,Fr),e(Ne,Nn),e(Nn,Er),e(R,jr),e(R,Ln),e(Ln,Mt),e(Mt,Pr),e(Mt,On),e(On,Cr),e(Mt,Ar),e(R,Nr),e(R,Sn),e(Sn,Bt),e(Bt,Lr),e(Bt,Go),e(Go,Or),e(Bt,Sr),_(t,ra,f),_(t,Le,f),e(Le,Ir),e(Le,xt),e(xt,Wr),e(Le,Hr),_(t,ia,f),_(t,ue,f),e(ue,Oe),e(Oe,In),w(Ft,In,null),e(ue,Rr),e(ue,Wn),e(Wn,Ur),_(t,la,f),_(t,x,f),e(x,Vr),e(x,Hn),e(Hn,Xr),e(x,Jr),e(x,Et),e(Et,Kr),e(x,Gr),e(x,Rn),e(Rn,Yr),e(x,Zr),e(x,Un),e(Un,ei),e(x,ti),e(x,jt),e(jt,oi),e(x,ni),_(t,da,f),_(t,Se,f),e(Se,si),e(Se,Vn),e(Vn,ai),e(Se,ri),_(t,ca,f),_(t,Yo,f),e(Yo,ii),_(t,pa,f),w(Pt,t,f),_(t,ha,f),_(t,me,f),e(me,Ie),e(Ie,Xn),w(Ct,Xn,null),e(me,li),e(me,Jn),e(Jn,di),_(t,ua,f),_(t,Zo,f),e(Zo,ci),_(t,ma,f),w(At,t,f),_(t,fa,f),_(t,fe,f),e(fe,We),e(We,Kn),w(Nt,Kn,null),e(fe,pi),e(fe,Gn),e(Gn,hi),_(t,ga,f),_(t,te,f),e(te,ui),e(te,Lt),e(Lt,mi),e(te,fi),e(te,Ot),e(Ot,gi),e(te,_i),_(t,_a,f),w(St,t,f),_(t,ba,f),_(t,ge,f),e(ge,He),e(He,Yn),w(It,Yn,null),e(ge,bi),e(ge,Zn),e(Zn,ki),_(t,ka,f),_(t,W,f),w(Wt,W,null),e(W,Qi),e(W,_e),e(_e,vi),e(_e,en),e(en,wi),e(_e,Ti),e(_e,Ht),e(Ht,yi),e(_e,$i),e(W,qi),e(W,be),e(be,Di),e(be,tn),e(tn,zi),e(be,Mi),e(be,on),e(on,Bi),e(be,xi),e(W,Fi),w(Re,W,null),_(t,Qa,f),_(t,ke,f),e(ke,Ue),e(Ue,es),w(Rt,es,null),e(ke,Ei),e(ke,ts),e(ts,ji),_(t,va,f),_(t,z,f),w(Ut,z,null),e(z,Pi),e(z,os),e(os,Ci),e(z,Ai),e(z,Vt),e(Vt,Ni),e(Vt,nn),e(nn,Li),e(Vt,Oi),e(z,Si),e(z,Xt),e(Xt,Ii),e(Xt,Jt),e(Jt,Wi),e(Xt,Hi),e(z,Ri),e(z,Kt),e(Kt,Ui),e(Kt,Gt),e(Gt,Vi),e(Kt,Xi),e(z,Ji),e(z,M),e(M,Ki),e(M,ns),e(ns,Gi),e(M,Yi),e(M,ss),e(ss,Zi),e(M,el),e(M,as),e(as,tl),e(M,ol),e(M,rs),e(rs,nl),e(M,sl),e(M,is),e(is,al),e(M,rl),e(M,ls),e(ls,il),e(M,ll),e(z,dl),e(z,U),w(Yt,U,null),e(U,cl),e(U,Qe),e(Qe,pl),e(Qe,sn),e(sn,hl),e(Qe,ul),e(Qe,ds),e(ds,ml),e(Qe,fl),e(U,gl),w(Ve,U,null),e(U,_l),w(Xe,U,null),_(t,wa,f),_(t,ve,f),e(ve,Je),e(Je,cs),w(Zt,cs,null),e(ve,bl),e(ve,ps),e(ps,kl),_(t,Ta,f),_(t,F,f),w(eo,F,null),e(F,Ql),e(F,to),e(to,vl),e(to,hs),e(hs,wl),e(to,Tl),e(F,yl),e(F,oo),e(oo,$l),e(oo,an),e(an,ql),e(oo,Dl),e(F,zl),e(F,no),e(no,Ml),e(no,so),e(so,Bl),e(no,xl),e(F,Fl),e(F,V),w(ao,V,null),e(V,El),e(V,we),e(we,jl),e(we,rn),e(rn,Pl),e(we,Cl),e(we,us),e(us,Al),e(we,Nl),e(V,Ll),w(Ke,V,null),e(V,Ol),w(Ge,V,null),_(t,ya,f),_(t,Te,f),e(Te,Ye),e(Ye,ms),w(ro,ms,null),e(Te,Sl),e(Te,fs),e(fs,Il),_(t,$a,f),_(t,E,f),w(io,E,null),e(E,Wl),e(E,lo),e(lo,Hl),e(lo,gs),e(gs,Rl),e(lo,Ul),e(E,Vl),e(E,co),e(co,Xl),e(co,ln),e(ln,Jl),e(co,Kl),e(E,Gl),e(E,po),e(po,Yl),e(po,ho),e(ho,Zl),e(po,ed),e(E,td),e(E,X),w(uo,X,null),e(X,od),e(X,ye),e(ye,nd),e(ye,dn),e(dn,sd),e(ye,ad),e(ye,_s),e(_s,rd),e(ye,id),e(X,ld),w(Ze,X,null),e(X,dd),w(et,X,null),_(t,qa,f),_(t,$e,f),e($e,tt),e(tt,bs),w(mo,bs,null),e($e,cd),e($e,ks),e(ks,pd),_(t,Da,f),_(t,j,f),w(fo,j,null),e(j,hd),e(j,Qs),e(Qs,ud),e(j,md),e(j,go),e(go,fd),e(go,cn),e(cn,gd),e(go,_d),e(j,bd),e(j,_o),e(_o,kd),e(_o,bo),e(bo,Qd),e(_o,vd),e(j,wd),e(j,L),w(ko,L,null),e(L,Td),e(L,qe),e(qe,yd),e(qe,pn),e(pn,$d),e(qe,qd),e(qe,vs),e(vs,Dd),e(qe,zd),e(L,Md),w(ot,L,null),e(L,Bd),w(nt,L,null),e(L,xd),w(st,L,null),_(t,za,f),_(t,De,f),e(De,at),e(at,ws),w(Qo,ws,null),e(De,Fd),e(De,Ts),e(Ts,Ed),_(t,Ma,f),_(t,P,f),w(vo,P,null),e(P,jd),e(P,wo),e(wo,Pd),e(wo,ys),e(ys,Cd),e(wo,Ad),e(P,Nd),e(P,To),e(To,Ld),e(To,hn),e(hn,Od),e(To,Sd),e(P,Id),e(P,yo),e(yo,Wd),e(yo,$o),e($o,Hd),e(yo,Rd),e(P,Ud),e(P,J),w(qo,J,null),e(J,Vd),e(J,ze),e(ze,Xd),e(ze,un),e(un,Jd),e(ze,Kd),e(ze,$s),e($s,Gd),e(ze,Yd),e(J,Zd),w(rt,J,null),e(J,ec),w(it,J,null),_(t,Ba,f),_(t,Me,f),e(Me,lt),e(lt,qs),w(Do,qs,null),e(Me,tc),e(Me,Ds),e(Ds,oc),_(t,xa,f),_(t,C,f),w(zo,C,null),e(C,nc),e(C,zs),e(zs,sc),e(C,ac),e(C,Mo),e(Mo,rc),e(Mo,mn),e(mn,ic),e(Mo,lc),e(C,dc),e(C,Bo),e(Bo,cc),e(Bo,xo),e(xo,pc),e(Bo,hc),e(C,uc),e(C,K),w(Fo,K,null),e(K,mc),e(K,Be),e(Be,fc),e(Be,fn),e(fn,gc),e(Be,_c),e(Be,Ms),e(Ms,bc),e(Be,kc),e(K,Qc),w(dt,K,null),e(K,vc),w(ct,K,null),_(t,Fa,f),_(t,xe,f),e(xe,pt),e(pt,Bs),w(Eo,Bs,null),e(xe,wc),e(xe,xs),e(xs,Tc),_(t,Ea,f),_(t,A,f),w(jo,A,null),e(A,yc),e(A,Fs),e(Fs,$c),e(A,qc),e(A,Po),e(Po,Dc),e(Po,gn),e(gn,zc),e(Po,Mc),e(A,Bc),e(A,Co),e(Co,xc),e(Co,Ao),e(Ao,Fc),e(Co,Ec),e(A,jc),e(A,G),w(No,G,null),e(G,Pc),e(G,Fe),e(Fe,Cc),e(Fe,_n),e(_n,Ac),e(Fe,Nc),e(Fe,Es),e(Es,Lc),e(Fe,Oc),e(G,Sc),w(ht,G,null),e(G,Ic),w(ut,G,null),_(t,ja,f),_(t,Ee,f),e(Ee,mt),e(mt,js),w(Lo,js,null),e(Ee,Wc),e(Ee,Ps),e(Ps,Hc),_(t,Pa,f),_(t,N,f),w(Oo,N,null),e(N,Rc),e(N,je),e(je,Uc),e(je,Cs),e(Cs,Vc),e(je,Xc),e(je,As),e(As,Jc),e(je,Kc),e(N,Gc),e(N,So),e(So,Yc),e(So,bn),e(bn,Zc),e(So,ep),e(N,tp),e(N,Io),e(Io,op),e(Io,Wo),e(Wo,np),e(Io,sp),e(N,ap),e(N,Y),w(Ho,Y,null),e(Y,rp),e(Y,Pe),e(Pe,ip),e(Pe,kn),e(kn,lp),e(Pe,dp),e(Pe,Ns),e(Ns,cp),e(Pe,pp),e(Y,hp),w(ft,Y,null),e(Y,up),w(gt,Y,null),Ca=!0},p(t,[f]){const Ro={};f&2&&(Ro.$$scope={dirty:f,ctx:t}),Re.$set(Ro);const Ls={};f&2&&(Ls.$$scope={dirty:f,ctx:t}),Ve.$set(Ls);const Os={};f&2&&(Os.$$scope={dirty:f,ctx:t}),Xe.$set(Os);const Ss={};f&2&&(Ss.$$scope={dirty:f,ctx:t}),Ke.$set(Ss);const Uo={};f&2&&(Uo.$$scope={dirty:f,ctx:t}),Ge.$set(Uo);const Is={};f&2&&(Is.$$scope={dirty:f,ctx:t}),Ze.$set(Is);const Ws={};f&2&&(Ws.$$scope={dirty:f,ctx:t}),et.$set(Ws);const Hs={};f&2&&(Hs.$$scope={dirty:f,ctx:t}),ot.$set(Hs);const Vo={};f&2&&(Vo.$$scope={dirty:f,ctx:t}),nt.$set(Vo);const Rs={};f&2&&(Rs.$$scope={dirty:f,ctx:t}),st.$set(Rs);const Us={};f&2&&(Us.$$scope={dirty:f,ctx:t}),rt.$set(Us);const Vs={};f&2&&(Vs.$$scope={dirty:f,ctx:t}),it.$set(Vs);const Xs={};f&2&&(Xs.$$scope={dirty:f,ctx:t}),dt.$set(Xs);const Js={};f&2&&(Js.$$scope={dirty:f,ctx:t}),ct.$set(Js);const ee={};f&2&&(ee.$$scope={dirty:f,ctx:t}),ht.$set(ee);const Ks={};f&2&&(Ks.$$scope={dirty:f,ctx:t}),ut.$set(Ks);const Gs={};f&2&&(Gs.$$scope={dirty:f,ctx:t}),ft.$set(Gs);const Ys={};f&2&&(Ys.$$scope={dirty:f,ctx:t}),gt.$set(Ys)},i(t){Ca||(T(l.$$.fragment,t),T(qt.$$.fragment,t),T(Ft.$$.fragment,t),T(Pt.$$.fragment,t),T(Ct.$$.fragment,t),T(At.$$.fragment,t),T(Nt.$$.fragment,t),T(St.$$.fragment,t),T(It.$$.fragment,t),T(Wt.$$.fragment,t),T(Re.$$.fragment,t),T(Rt.$$.fragment,t),T(Ut.$$.fragment,t),T(Yt.$$.fragment,t),T(Ve.$$.fragment,t),T(Xe.$$.fragment,t),T(Zt.$$.fragment,t),T(eo.$$.fragment,t),T(ao.$$.fragment,t),T(Ke.$$.fragment,t),T(Ge.$$.fragment,t),T(ro.$$.fragment,t),T(io.$$.fragment,t),T(uo.$$.fragment,t),T(Ze.$$.fragment,t),T(et.$$.fragment,t),T(mo.$$.fragment,t),T(fo.$$.fragment,t),T(ko.$$.fragment,t),T(ot.$$.fragment,t),T(nt.$$.fragment,t),T(st.$$.fragment,t),T(Qo.$$.fragment,t),T(vo.$$.fragment,t),T(qo.$$.fragment,t),T(rt.$$.fragment,t),T(it.$$.fragment,t),T(Do.$$.fragment,t),T(zo.$$.fragment,t),T(Fo.$$.fragment,t),T(dt.$$.fragment,t),T(ct.$$.fragment,t),T(Eo.$$.fragment,t),T(jo.$$.fragment,t),T(No.$$.fragment,t),T(ht.$$.fragment,t),T(ut.$$.fragment,t),T(Lo.$$.fragment,t),T(Oo.$$.fragment,t),T(Ho.$$.fragment,t),T(ft.$$.fragment,t),T(gt.$$.fragment,t),Ca=!0)},o(t){y(l.$$.fragment,t),y(qt.$$.fragment,t),y(Ft.$$.fragment,t),y(Pt.$$.fragment,t),y(Ct.$$.fragment,t),y(At.$$.fragment,t),y(Nt.$$.fragment,t),y(St.$$.fragment,t),y(It.$$.fragment,t),y(Wt.$$.fragment,t),y(Re.$$.fragment,t),y(Rt.$$.fragment,t),y(Ut.$$.fragment,t),y(Yt.$$.fragment,t),y(Ve.$$.fragment,t),y(Xe.$$.fragment,t),y(Zt.$$.fragment,t),y(eo.$$.fragment,t),y(ao.$$.fragment,t),y(Ke.$$.fragment,t),y(Ge.$$.fragment,t),y(ro.$$.fragment,t),y(io.$$.fragment,t),y(uo.$$.fragment,t),y(Ze.$$.fragment,t),y(et.$$.fragment,t),y(mo.$$.fragment,t),y(fo.$$.fragment,t),y(ko.$$.fragment,t),y(ot.$$.fragment,t),y(nt.$$.fragment,t),y(st.$$.fragment,t),y(Qo.$$.fragment,t),y(vo.$$.fragment,t),y(qo.$$.fragment,t),y(rt.$$.fragment,t),y(it.$$.fragment,t),y(Do.$$.fragment,t),y(zo.$$.fragment,t),y(Fo.$$.fragment,t),y(dt.$$.fragment,t),y(ct.$$.fragment,t),y(Eo.$$.fragment,t),y(jo.$$.fragment,t),y(No.$$.fragment,t),y(ht.$$.fragment,t),y(ut.$$.fragment,t),y(Lo.$$.fragment,t),y(Oo.$$.fragment,t),y(Ho.$$.fragment,t),y(ft.$$.fragment,t),y(gt.$$.fragment,t),Ca=!1},d(t){o(d),t&&o(k),t&&o(g),$(l),t&&o(ea),t&&o(he),$(qt),t&&o(ta),t&&o(Ae),t&&o(oa),t&&o(Xo),t&&o(na),t&&o(Jo),t&&o(sa),t&&o(Ko),t&&o(aa),t&&o(R),t&&o(ra),t&&o(Le),t&&o(ia),t&&o(ue),$(Ft),t&&o(la),t&&o(x),t&&o(da),t&&o(Se),t&&o(ca),t&&o(Yo),t&&o(pa),$(Pt,t),t&&o(ha),t&&o(me),$(Ct),t&&o(ua),t&&o(Zo),t&&o(ma),$(At,t),t&&o(fa),t&&o(fe),$(Nt),t&&o(ga),t&&o(te),t&&o(_a),$(St,t),t&&o(ba),t&&o(ge),$(It),t&&o(ka),t&&o(W),$(Wt),$(Re),t&&o(Qa),t&&o(ke),$(Rt),t&&o(va),t&&o(z),$(Ut),$(Yt),$(Ve),$(Xe),t&&o(wa),t&&o(ve),$(Zt),t&&o(Ta),t&&o(F),$(eo),$(ao),$(Ke),$(Ge),t&&o(ya),t&&o(Te),$(ro),t&&o($a),t&&o(E),$(io),$(uo),$(Ze),$(et),t&&o(qa),t&&o($e),$(mo),t&&o(Da),t&&o(j),$(fo),$(ko),$(ot),$(nt),$(st),t&&o(za),t&&o(De),$(Qo),t&&o(Ma),t&&o(P),$(vo),$(qo),$(rt),$(it),t&&o(Ba),t&&o(Me),$(Do),t&&o(xa),t&&o(C),$(zo),$(Fo),$(dt),$(ct),t&&o(Fa),t&&o(xe),$(Eo),t&&o(Ea),t&&o(A),$(jo),$(No),$(ht),$(ut),t&&o(ja),t&&o(Ee),$(Lo),t&&o(Pa),t&&o(N),$(Oo),$(Ho),$(ft),$(gt)}}}const Pu={local:"qdqbert",sections:[{local:"overview",sections:[{local:"set-default-quantizers",title:"Set default quantizers"},{local:"calibration",title:"Calibration"},{local:"export-to-onnx",title:"Export to ONNX"}],title:"Overview"},{local:"transformers.QDQBertConfig",title:"QDQBertConfig"},{local:"transformers.QDQBertModel",title:"QDQBertModel"},{local:"transformers.QDQBertLMHeadModel",title:"QDQBertLMHeadModel"},{local:"transformers.QDQBertForMaskedLM",title:"QDQBertForMaskedLM"},{local:"transformers.QDQBertForSequenceClassification",title:"QDQBertForSequenceClassification"},{local:"transformers.QDQBertForNextSentencePrediction",title:"QDQBertForNextSentencePrediction"},{local:"transformers.QDQBertForMultipleChoice",title:"QDQBertForMultipleChoice"},{local:"transformers.QDQBertForTokenClassification",title:"QDQBertForTokenClassification"},{local:"transformers.QDQBertForQuestionAnswering",title:"QDQBertForQuestionAnswering"}],title:"QDQBERT"};function Cu(q){return fu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wu extends pu{constructor(d){super();hu(this,d,Cu,ju,uu,{})}}export{Wu as default,Pu as metadata};
