import{S as Ei,i as Pi,s as Oi,e as n,k as h,w as k,t as l,M as Si,c as r,d as t,m as u,a,x as v,h as d,b as p,G as e,g as y,y as w,q as $,o as T,B as N,v as Li,L as Ve}from"../../chunks/vendor-hf-doc-builder.js";import{T as mt}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ge}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as R}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Re}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ii(M){let i,b,f,m,_;return m=new Ge({props:{code:`from transformers import NystromformerModel, NystromformerConfig

# Initializing a Nystromformer uw-madison/nystromformer-512 style configuration
configuration = NystromformerConfig()

# Initializing a model from the uw-madison/nystromformer-512 style configuration
model = NystromformerModel(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> NystromformerModel, NystromformerConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Nystromformer uw-madison/nystromformer-512 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = NystromformerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the uw-madison/nystromformer-512 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerModel(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(){i=n("p"),b=l("Example:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Di(M){let i,b,f,m,_;return{c(){i=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(s){i=r(s,"P",{});var c=a(i);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=a(f);m=d(F,"Module"),F.forEach(t),_=d(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(t)},m(s,c){y(s,i,c),e(i,b),e(i,f),e(f,m),e(i,_)},d(s){s&&t(i)}}}function Wi(M){let i,b,f,m,_;return m=new Ge({props:{code:`from transformers import AutoTokenizer, NystromformerModel
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerModel.from_pretrained("uw-madison/nystromformer-512")

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, NystromformerModel
<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;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerModel.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Qi(M){let i,b,f,m,_;return{c(){i=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(s){i=r(s,"P",{});var c=a(i);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=a(f);m=d(F,"Module"),F.forEach(t),_=d(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(t)},m(s,c){y(s,i,c),e(i,b),e(i,f),e(f,m),e(i,_)},d(s){s&&t(i)}}}function Hi(M){let i,b,f,m,_;return m=new Ge({props:{code:`from transformers import AutoTokenizer, NystromformerForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerForMaskedLM.from_pretrained("uw-madison/nystromformer-512")

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, NystromformerForMaskedLM
<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;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerForMaskedLM.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Ui(M){let i,b,f,m,_;return{c(){i=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(s){i=r(s,"P",{});var c=a(i);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=a(f);m=d(F,"Module"),F.forEach(t),_=d(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(t)},m(s,c){y(s,i,c),e(i,b),e(i,f),e(f,m),e(i,_)},d(s){s&&t(i)}}}function Bi(M){let i,b,f,m,_;return m=new Ge({props:{code:`import torch
from transformers import AutoTokenizer, NystromformerForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerForSequenceClassification.from_pretrained("uw-madison/nystromformer-512")

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 = NystromformerForSequenceClassification.from_pretrained("uw-madison/nystromformer-512", 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, NystromformerForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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 = NystromformerForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example of single-label classification:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example of single-label classification:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Ri(M){let i,b,f,m,_;return m=new Ge({props:{code:`import torch
from transformers import AutoTokenizer, NystromformerForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerForSequenceClassification.from_pretrained("uw-madison/nystromformer-512", 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 = NystromformerForSequenceClassification.from_pretrained(
    "uw-madison/nystromformer-512", 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, NystromformerForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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 = NystromformerForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example of multi-label classification:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example of multi-label classification:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Vi(M){let i,b,f,m,_;return{c(){i=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(s){i=r(s,"P",{});var c=a(i);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=a(f);m=d(F,"Module"),F.forEach(t),_=d(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(t)},m(s,c){y(s,i,c),e(i,b),e(i,f),e(f,m),e(i,_)},d(s){s&&t(i)}}}function Gi(M){let i,b,f,m,_;return m=new Ge({props:{code:`from transformers import AutoTokenizer, NystromformerForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerForMultipleChoice.from_pretrained("uw-madison/nystromformer-512")

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, NystromformerForMultipleChoice
<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;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Ki(M){let i,b,f,m,_;return{c(){i=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(s){i=r(s,"P",{});var c=a(i);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=a(f);m=d(F,"Module"),F.forEach(t),_=d(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(t)},m(s,c){y(s,i,c),e(i,b),e(i,f),e(f,m),e(i,_)},d(s){s&&t(i)}}}function Yi(M){let i,b,f,m,_;return m=new Ge({props:{code:`from transformers import AutoTokenizer, NystromformerForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerForTokenClassification.from_pretrained("uw-madison/nystromformer-512")

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, NystromformerForTokenClassification
<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;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerForTokenClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Ji(M){let i,b,f,m,_;return{c(){i=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(s){i=r(s,"P",{});var c=a(i);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=a(f);m=d(F,"Module"),F.forEach(t),_=d(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(t)},m(s,c){y(s,i,c),e(i,b),e(i,f),e(f,m),e(i,_)},d(s){s&&t(i)}}}function Zi(M){let i,b,f,m,_;return m=new Ge({props:{code:`from transformers import AutoTokenizer, NystromformerForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/nystromformer-512")
model = NystromformerForQuestionAnswering.from_pretrained("uw-madison/nystromformer-512")

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, NystromformerForQuestionAnswering
<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;uw-madison/nystromformer-512&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NystromformerForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;uw-madison/nystromformer-512&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(){i=n("p"),b=l("Example:"),f=h(),k(m.$$.fragment)},l(s){i=r(s,"P",{});var c=a(i);b=d(c,"Example:"),c.forEach(t),f=u(s),v(m.$$.fragment,s)},m(s,c){y(s,i,c),e(i,b),y(s,f,c),w(m,s,c),_=!0},p:Ve,i(s){_||($(m.$$.fragment,s),_=!0)},o(s){T(m.$$.fragment,s),_=!1},d(s){s&&t(i),s&&t(f),N(m,s)}}}function Xi(M){let i,b,f,m,_,s,c,F,Ws,as,V,pe,pt,Ke,Qs,ft,Hs,is,fe,Us,Ye,ht,Bs,Rs,ls,Oo,Vs,ds,So,ut,Gs,cs,H,Ks,Je,Ys,Js,Ze,Zs,Xs,ms,G,he,gt,Xe,en,_t,on,ps,q,yt,Lo,tn,sn,bt,Io,nn,rn,kt,Do,an,ln,vt,Wo,dn,cn,wt,Qo,mn,fs,K,ue,$t,eo,pn,Tt,fn,hs,x,oo,hn,Y,un,Ho,gn,_n,to,yn,bn,kn,J,vn,Uo,wn,$n,Bo,Tn,Nn,Mn,ge,us,Z,_e,Nt,so,Fn,Mt,qn,gs,W,no,zn,ro,xn,ao,jn,Cn,An,O,io,En,X,Pn,Ro,On,Sn,Ft,Ln,In,Dn,ye,Wn,be,_s,ee,ke,qt,lo,Qn,zt,Hn,ys,Q,co,Un,oe,Bn,xt,Rn,Vn,mo,Gn,Kn,Yn,S,po,Jn,te,Zn,Vo,Xn,er,jt,or,tr,sr,ve,nr,we,bs,se,$e,Ct,fo,rr,At,ar,ks,j,ho,ir,Et,lr,dr,uo,cr,go,mr,pr,fr,z,_o,hr,ne,ur,Go,gr,_r,Pt,yr,br,kr,Te,vr,Ne,wr,Me,vs,re,Fe,Ot,yo,$r,St,Tr,ws,C,bo,Nr,Lt,Mr,Fr,ko,qr,vo,zr,xr,jr,L,wo,Cr,ae,Ar,Ko,Er,Pr,It,Or,Sr,Lr,qe,Ir,ze,$s,ie,xe,Dt,$o,Dr,Wt,Wr,Ts,A,To,Qr,Qt,Hr,Ur,No,Br,Mo,Rr,Vr,Gr,I,Fo,Kr,le,Yr,Yo,Jr,Zr,Ht,Xr,ea,oa,je,ta,Ce,Ns,de,Ae,Ut,qo,sa,Bt,na,Ms,E,zo,ra,ce,aa,Rt,ia,la,Vt,da,ca,ma,xo,pa,jo,fa,ha,ua,D,Co,ga,me,_a,Jo,ya,ba,Gt,ka,va,wa,Ee,$a,Pe,Fs;return s=new R({}),Ke=new R({}),Xe=new R({}),eo=new R({}),oo=new P({props:{name:"class transformers.NystromformerConfig",anchor:"transformers.NystromformerConfig",parameters:[{name:"vocab_size",val:" = 30000"},{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_new'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 510"},{name:"type_vocab_size",val:" = 2"},{name:"segment_means_seq_len",val:" = 64"},{name:"num_landmarks",val:" = 64"},{name:"conv_kernel_size",val:" = 65"},{name:"inv_coeff_init_option",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NystromformerConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30000) &#x2014;
Vocabulary size of the Nystromformer model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerModel">NystromformerModel</a>.`,name:"vocab_size"},{anchor:"transformers.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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.NystromformerConfig.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/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerModel">NystromformerModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.NystromformerConfig.segment_means_seq_len",description:`<strong>segment_means_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Sequence length used in segment-means.`,name:"segment_means_seq_len"},{anchor:"transformers.NystromformerConfig.num_landmarks",description:`<strong>num_landmarks</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
The number of landmark (or Nystrom) points to use in Nystrom approximation of the softmax self-attention
matrix.`,name:"num_landmarks"},{anchor:"transformers.NystromformerConfig.conv_kernel_size",description:`<strong>conv_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 65) &#x2014;
The kernel size of depthwise convolution used in Nystrom approximation.`,name:"conv_kernel_size"},{anchor:"transformers.NystromformerConfig.inv_coeff_init_option",description:`<strong>inv_coeff_init_option</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use exact coefficient computation for the initial values for the iterative method of
calculating the Moore-Penrose inverse of a matrix.`,name:"inv_coeff_init_option"},{anchor:"transformers.NystromformerConfig.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.NystromformerConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/configuration_nystromformer.py#L29"}}),ge=new Re({props:{anchor:"transformers.NystromformerConfig.example",$$slots:{default:[Ii]},$$scope:{ctx:M}}}),so=new R({}),no=new P({props:{name:"class transformers.NystromformerModel",anchor:"transformers.NystromformerModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NystromformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig">NystromformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L549"}}),io=new P({props:{name:"forward",anchor:"transformers.NystromformerModel.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:"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.NystromformerModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.NystromformerModel.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.NystromformerModel.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.NystromformerModel.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.NystromformerModel.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.NystromformerModel.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NystromformerModel.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.NystromformerModel.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.NystromformerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L574",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig"
>NystromformerConfig</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>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</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>
<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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new mt({props:{$$slots:{default:[Di]},$$scope:{ctx:M}}}),be=new Re({props:{anchor:"transformers.NystromformerModel.forward.example",$$slots:{default:[Wi]},$$scope:{ctx:M}}}),lo=new R({}),co=new P({props:{name:"class transformers.NystromformerForMaskedLM",anchor:"transformers.NystromformerForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NystromformerForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig">NystromformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L660"}}),po=new P({props:{name:"forward",anchor:"transformers.NystromformerForMaskedLM.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.NystromformerForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.NystromformerForMaskedLM.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.NystromformerForMaskedLM.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.NystromformerForMaskedLM.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.NystromformerForMaskedLM.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.NystromformerForMaskedLM.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NystromformerForMaskedLM.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.NystromformerForMaskedLM.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.NystromformerForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NystromformerForMaskedLM.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/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L678",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig"
>NystromformerConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new mt({props:{$$slots:{default:[Qi]},$$scope:{ctx:M}}}),we=new Re({props:{anchor:"transformers.NystromformerForMaskedLM.forward.example",$$slots:{default:[Hi]},$$scope:{ctx:M}}}),fo=new R({}),ho=new P({props:{name:"class transformers.NystromformerForSequenceClassification",anchor:"transformers.NystromformerForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NystromformerForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig">NystromformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L765"}}),_o=new P({props:{name:"forward",anchor:"transformers.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.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.NystromformerForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NystromformerForSequenceClassification.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/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L775",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig"
>NystromformerConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new mt({props:{$$slots:{default:[Ui]},$$scope:{ctx:M}}}),Ne=new Re({props:{anchor:"transformers.NystromformerForSequenceClassification.forward.example",$$slots:{default:[Bi]},$$scope:{ctx:M}}}),Me=new Re({props:{anchor:"transformers.NystromformerForSequenceClassification.forward.example-2",$$slots:{default:[Ri]},$$scope:{ctx:M}}}),yo=new R({}),bo=new P({props:{name:"class transformers.NystromformerForMultipleChoice",anchor:"transformers.NystromformerForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NystromformerForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig">NystromformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L858"}}),wo=new P({props:{name:"forward",anchor:"transformers.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.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.NystromformerForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NystromformerForMultipleChoice.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/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L869",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig"
>NystromformerConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new mt({props:{$$slots:{default:[Vi]},$$scope:{ctx:M}}}),ze=new Re({props:{anchor:"transformers.NystromformerForMultipleChoice.forward.example",$$slots:{default:[Gi]},$$scope:{ctx:M}}}),$o=new R({}),To=new P({props:{name:"class transformers.NystromformerForTokenClassification",anchor:"transformers.NystromformerForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NystromformerForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig">NystromformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L953"}}),Fo=new P({props:{name:"forward",anchor:"transformers.NystromformerForTokenClassification.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.NystromformerForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.NystromformerForTokenClassification.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.NystromformerForTokenClassification.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.NystromformerForTokenClassification.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.NystromformerForTokenClassification.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.NystromformerForTokenClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NystromformerForTokenClassification.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.NystromformerForTokenClassification.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.NystromformerForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NystromformerForTokenClassification.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/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L965",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig"
>NystromformerConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new mt({props:{$$slots:{default:[Ki]},$$scope:{ctx:M}}}),Ce=new Re({props:{anchor:"transformers.NystromformerForTokenClassification.forward.example",$$slots:{default:[Yi]},$$scope:{ctx:M}}}),qo=new R({}),zo=new P({props:{name:"class transformers.NystromformerForQuestionAnswering",anchor:"transformers.NystromformerForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NystromformerForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig">NystromformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L1031"}}),Co=new P({props:{name:"forward",anchor:"transformers.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NystromformerForQuestionAnswering.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.NystromformerForQuestionAnswering.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/v4.29.0/src/transformers/models/nystromformer/modeling_nystromformer.py#L1044",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerConfig"
>NystromformerConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ee=new mt({props:{$$slots:{default:[Ji]},$$scope:{ctx:M}}}),Pe=new Re({props:{anchor:"transformers.NystromformerForQuestionAnswering.forward.example",$$slots:{default:[Zi]},$$scope:{ctx:M}}}),{c(){i=n("meta"),b=h(),f=n("h1"),m=n("a"),_=n("span"),k(s.$$.fragment),c=h(),F=n("span"),Ws=l("Nystr\xF6mformer"),as=h(),V=n("h2"),pe=n("a"),pt=n("span"),k(Ke.$$.fragment),Qs=h(),ft=n("span"),Hs=l("Overview"),is=h(),fe=n("p"),Us=l("The Nystr\xF6mformer model was proposed in "),Ye=n("a"),ht=n("em"),Bs=l("Nystr\xF6mformer: A Nystr\xF6m-Based Algorithm for Approximating Self-Attention"),Rs=l(` by Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn
Fung, Yin Li, and Vikas Singh.`),ls=h(),Oo=n("p"),Vs=l("The abstract from the paper is the following:"),ds=h(),So=n("p"),ut=n("em"),Gs=l(`Transformers have emerged as a powerful tool for a broad range of natural language processing tasks. A key component
that drives the impressive performance of Transformers is the self-attention mechanism that encodes the influence or
dependence of other tokens on each specific token. While beneficial, the quadratic complexity of self-attention on the
input sequence length has limited its application to longer sequences \u2014 a topic being actively studied in the
community. To address this limitation, we propose Nystr\xF6mformer \u2014 a model that exhibits favorable scalability as a
function of sequence length. Our idea is based on adapting the Nystr\xF6m method to approximate standard self-attention
with O(n) complexity. The scalability of Nystr\xF6mformer enables application to longer sequences with thousands of
tokens. We perform evaluations on multiple downstream tasks on the GLUE benchmark and IMDB reviews with standard
sequence length, and find that our Nystr\xF6mformer performs comparably, or in a few cases, even slightly better, than
standard self-attention. On longer sequence tasks in the Long Range Arena (LRA) benchmark, Nystr\xF6mformer performs
favorably relative to other efficient self-attention methods. Our code is available at this https URL.`),cs=h(),H=n("p"),Ks=l("This model was contributed by "),Je=n("a"),Ys=l("novice03"),Js=l(". The original code can be found "),Ze=n("a"),Zs=l("here"),Xs=l("."),ms=h(),G=n("h2"),he=n("a"),gt=n("span"),k(Xe.$$.fragment),en=h(),_t=n("span"),on=l("Documentation resources"),ps=h(),q=n("ul"),yt=n("li"),Lo=n("a"),tn=l("Text classification task guide"),sn=h(),bt=n("li"),Io=n("a"),nn=l("Token classification task guide"),rn=h(),kt=n("li"),Do=n("a"),an=l("Question answering task guide"),ln=h(),vt=n("li"),Wo=n("a"),dn=l("Masked language modeling task guide"),cn=h(),wt=n("li"),Qo=n("a"),mn=l("Multiple choice task guide"),fs=h(),K=n("h2"),ue=n("a"),$t=n("span"),k(eo.$$.fragment),pn=h(),Tt=n("span"),fn=l("NystromformerConfig"),hs=h(),x=n("div"),k(oo.$$.fragment),hn=h(),Y=n("p"),un=l("This is the configuration class to store the configuration of a "),Ho=n("a"),gn=l("NystromformerModel"),_n=l(`. It is used to instantiate
an Nystromformer 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 Nystromformer
`),to=n("a"),yn=l("uw-madison/nystromformer-512"),bn=l(" architecture."),kn=h(),J=n("p"),vn=l("Configuration objects inherit from "),Uo=n("a"),wn=l("PretrainedConfig"),$n=l(` and can be used to control the model outputs. Read the
documentation from `),Bo=n("a"),Tn=l("PretrainedConfig"),Nn=l(" for more information."),Mn=h(),k(ge.$$.fragment),us=h(),Z=n("h2"),_e=n("a"),Nt=n("span"),k(so.$$.fragment),Fn=h(),Mt=n("span"),qn=l("NystromformerModel"),gs=h(),W=n("div"),k(no.$$.fragment),zn=h(),ro=n("p"),xn=l(`The bare Nystr\xF6mformer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ao=n("a"),jn=l("torch.nn.Module"),Cn=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),An=h(),O=n("div"),k(io.$$.fragment),En=h(),X=n("p"),Pn=l("The "),Ro=n("a"),On=l("NystromformerModel"),Sn=l(" forward method, overrides the "),Ft=n("code"),Ln=l("__call__"),In=l(" special method."),Dn=h(),k(ye.$$.fragment),Wn=h(),k(be.$$.fragment),_s=h(),ee=n("h2"),ke=n("a"),qt=n("span"),k(lo.$$.fragment),Qn=h(),zt=n("span"),Hn=l("NystromformerForMaskedLM"),ys=h(),Q=n("div"),k(co.$$.fragment),Un=h(),oe=n("p"),Bn=l("Nystr\xF6mformer Model with a "),xt=n("code"),Rn=l("language modeling"),Vn=l(` head on top.
This model is a PyTorch `),mo=n("a"),Gn=l("torch.nn.Module"),Kn=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yn=h(),S=n("div"),k(po.$$.fragment),Jn=h(),te=n("p"),Zn=l("The "),Vo=n("a"),Xn=l("NystromformerForMaskedLM"),er=l(" forward method, overrides the "),jt=n("code"),or=l("__call__"),tr=l(" special method."),sr=h(),k(ve.$$.fragment),nr=h(),k(we.$$.fragment),bs=h(),se=n("h2"),$e=n("a"),Ct=n("span"),k(fo.$$.fragment),rr=h(),At=n("span"),ar=l("NystromformerForSequenceClassification"),ks=h(),j=n("div"),k(ho.$$.fragment),ir=h(),Et=n("p"),lr=l(`Nystr\xF6mformer Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),dr=h(),uo=n("p"),cr=l("This model is a PyTorch "),go=n("a"),mr=l("torch.nn.Module"),pr=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fr=h(),z=n("div"),k(_o.$$.fragment),hr=h(),ne=n("p"),ur=l("The "),Go=n("a"),gr=l("NystromformerForSequenceClassification"),_r=l(" forward method, overrides the "),Pt=n("code"),yr=l("__call__"),br=l(" special method."),kr=h(),k(Te.$$.fragment),vr=h(),k(Ne.$$.fragment),wr=h(),k(Me.$$.fragment),vs=h(),re=n("h2"),Fe=n("a"),Ot=n("span"),k(yo.$$.fragment),$r=h(),St=n("span"),Tr=l("NystromformerForMultipleChoice"),ws=h(),C=n("div"),k(bo.$$.fragment),Nr=h(),Lt=n("p"),Mr=l(`Nystr\xF6mformer 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.`),Fr=h(),ko=n("p"),qr=l("This model is a PyTorch "),vo=n("a"),zr=l("torch.nn.Module"),xr=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),jr=h(),L=n("div"),k(wo.$$.fragment),Cr=h(),ae=n("p"),Ar=l("The "),Ko=n("a"),Er=l("NystromformerForMultipleChoice"),Pr=l(" forward method, overrides the "),It=n("code"),Or=l("__call__"),Sr=l(" special method."),Lr=h(),k(qe.$$.fragment),Ir=h(),k(ze.$$.fragment),$s=h(),ie=n("h2"),xe=n("a"),Dt=n("span"),k($o.$$.fragment),Dr=h(),Wt=n("span"),Wr=l("NystromformerForTokenClassification"),Ts=h(),A=n("div"),k(To.$$.fragment),Qr=h(),Qt=n("p"),Hr=l(`Nystr\xF6mformer 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.`),Ur=h(),No=n("p"),Br=l("This model is a PyTorch "),Mo=n("a"),Rr=l("torch.nn.Module"),Vr=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gr=h(),I=n("div"),k(Fo.$$.fragment),Kr=h(),le=n("p"),Yr=l("The "),Yo=n("a"),Jr=l("NystromformerForTokenClassification"),Zr=l(" forward method, overrides the "),Ht=n("code"),Xr=l("__call__"),ea=l(" special method."),oa=h(),k(je.$$.fragment),ta=h(),k(Ce.$$.fragment),Ns=h(),de=n("h2"),Ae=n("a"),Ut=n("span"),k(qo.$$.fragment),sa=h(),Bt=n("span"),na=l("NystromformerForQuestionAnswering"),Ms=h(),E=n("div"),k(zo.$$.fragment),ra=h(),ce=n("p"),aa=l(`Nystr\xF6mformer 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 `),Rt=n("code"),ia=l("span start logits"),la=l(" and "),Vt=n("code"),da=l("span end logits"),ca=l(")."),ma=h(),xo=n("p"),pa=l("This model is a PyTorch "),jo=n("a"),fa=l("torch.nn.Module"),ha=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ua=h(),D=n("div"),k(Co.$$.fragment),ga=h(),me=n("p"),_a=l("The "),Jo=n("a"),ya=l("NystromformerForQuestionAnswering"),ba=l(" forward method, overrides the "),Gt=n("code"),ka=l("__call__"),va=l(" special method."),wa=h(),k(Ee.$$.fragment),$a=h(),k(Pe.$$.fragment),this.h()},l(o){const g=Si('[data-svelte="svelte-1phssyn"]',document.head);i=r(g,"META",{name:!0,content:!0}),g.forEach(t),b=u(o),f=r(o,"H1",{class:!0});var Ao=a(f);m=r(Ao,"A",{id:!0,class:!0,href:!0});var Kt=a(m);_=r(Kt,"SPAN",{});var Yt=a(_);v(s.$$.fragment,Yt),Yt.forEach(t),Kt.forEach(t),c=u(Ao),F=r(Ao,"SPAN",{});var Jt=a(F);Ws=d(Jt,"Nystr\xF6mformer"),Jt.forEach(t),Ao.forEach(t),as=u(o),V=r(o,"H2",{class:!0});var Eo=a(V);pe=r(Eo,"A",{id:!0,class:!0,href:!0});var Zt=a(pe);pt=r(Zt,"SPAN",{});var Xt=a(pt);v(Ke.$$.fragment,Xt),Xt.forEach(t),Zt.forEach(t),Qs=u(Eo),ft=r(Eo,"SPAN",{});var es=a(ft);Hs=d(es,"Overview"),es.forEach(t),Eo.forEach(t),is=u(o),fe=r(o,"P",{});var Po=a(fe);Us=d(Po,"The Nystr\xF6mformer model was proposed in "),Ye=r(Po,"A",{href:!0,rel:!0});var os=a(Ye);ht=r(os,"EM",{});var ts=a(ht);Bs=d(ts,"Nystr\xF6mformer: A Nystr\xF6m-Based Algorithm for Approximating Self-Attention"),ts.forEach(t),os.forEach(t),Rs=d(Po,` by Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn
Fung, Yin Li, and Vikas Singh.`),Po.forEach(t),ls=u(o),Oo=r(o,"P",{});var ss=a(Oo);Vs=d(ss,"The abstract from the paper is the following:"),ss.forEach(t),ds=u(o),So=r(o,"P",{});var ns=a(So);ut=r(ns,"EM",{});var rs=a(ut);Gs=d(rs,`Transformers have emerged as a powerful tool for a broad range of natural language processing tasks. A key component
that drives the impressive performance of Transformers is the self-attention mechanism that encodes the influence or
dependence of other tokens on each specific token. While beneficial, the quadratic complexity of self-attention on the
input sequence length has limited its application to longer sequences \u2014 a topic being actively studied in the
community. To address this limitation, we propose Nystr\xF6mformer \u2014 a model that exhibits favorable scalability as a
function of sequence length. Our idea is based on adapting the Nystr\xF6m method to approximate standard self-attention
with O(n) complexity. The scalability of Nystr\xF6mformer enables application to longer sequences with thousands of
tokens. We perform evaluations on multiple downstream tasks on the GLUE benchmark and IMDB reviews with standard
sequence length, and find that our Nystr\xF6mformer performs comparably, or in a few cases, even slightly better, than
standard self-attention. On longer sequence tasks in the Long Range Arena (LRA) benchmark, Nystr\xF6mformer performs
favorably relative to other efficient self-attention methods. Our code is available at this https URL.`),rs.forEach(t),ns.forEach(t),cs=u(o),H=r(o,"P",{});var Zo=a(H);Ks=d(Zo,"This model was contributed by "),Je=r(Zo,"A",{href:!0,rel:!0});var Ta=a(Je);Ys=d(Ta,"novice03"),Ta.forEach(t),Js=d(Zo,". The original code can be found "),Ze=r(Zo,"A",{href:!0,rel:!0});var Na=a(Ze);Zs=d(Na,"here"),Na.forEach(t),Xs=d(Zo,"."),Zo.forEach(t),ms=u(o),G=r(o,"H2",{class:!0});var qs=a(G);he=r(qs,"A",{id:!0,class:!0,href:!0});var Ma=a(he);gt=r(Ma,"SPAN",{});var Fa=a(gt);v(Xe.$$.fragment,Fa),Fa.forEach(t),Ma.forEach(t),en=u(qs),_t=r(qs,"SPAN",{});var qa=a(_t);on=d(qa,"Documentation resources"),qa.forEach(t),qs.forEach(t),ps=u(o),q=r(o,"UL",{});var U=a(q);yt=r(U,"LI",{});var za=a(yt);Lo=r(za,"A",{href:!0});var xa=a(Lo);tn=d(xa,"Text classification task guide"),xa.forEach(t),za.forEach(t),sn=u(U),bt=r(U,"LI",{});var ja=a(bt);Io=r(ja,"A",{href:!0});var Ca=a(Io);nn=d(Ca,"Token classification task guide"),Ca.forEach(t),ja.forEach(t),rn=u(U),kt=r(U,"LI",{});var Aa=a(kt);Do=r(Aa,"A",{href:!0});var Ea=a(Do);an=d(Ea,"Question answering task guide"),Ea.forEach(t),Aa.forEach(t),ln=u(U),vt=r(U,"LI",{});var Pa=a(vt);Wo=r(Pa,"A",{href:!0});var Oa=a(Wo);dn=d(Oa,"Masked language modeling task guide"),Oa.forEach(t),Pa.forEach(t),cn=u(U),wt=r(U,"LI",{});var Sa=a(wt);Qo=r(Sa,"A",{href:!0});var La=a(Qo);mn=d(La,"Multiple choice task guide"),La.forEach(t),Sa.forEach(t),U.forEach(t),fs=u(o),K=r(o,"H2",{class:!0});var zs=a(K);ue=r(zs,"A",{id:!0,class:!0,href:!0});var Ia=a(ue);$t=r(Ia,"SPAN",{});var Da=a($t);v(eo.$$.fragment,Da),Da.forEach(t),Ia.forEach(t),pn=u(zs),Tt=r(zs,"SPAN",{});var Wa=a(Tt);fn=d(Wa,"NystromformerConfig"),Wa.forEach(t),zs.forEach(t),hs=u(o),x=r(o,"DIV",{class:!0});var Oe=a(x);v(oo.$$.fragment,Oe),hn=u(Oe),Y=r(Oe,"P",{});var Xo=a(Y);un=d(Xo,"This is the configuration class to store the configuration of a "),Ho=r(Xo,"A",{href:!0});var Qa=a(Ho);gn=d(Qa,"NystromformerModel"),Qa.forEach(t),_n=d(Xo,`. It is used to instantiate
an Nystromformer 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 Nystromformer
`),to=r(Xo,"A",{href:!0,rel:!0});var Ha=a(to);yn=d(Ha,"uw-madison/nystromformer-512"),Ha.forEach(t),bn=d(Xo," architecture."),Xo.forEach(t),kn=u(Oe),J=r(Oe,"P",{});var et=a(J);vn=d(et,"Configuration objects inherit from "),Uo=r(et,"A",{href:!0});var Ua=a(Uo);wn=d(Ua,"PretrainedConfig"),Ua.forEach(t),$n=d(et,` and can be used to control the model outputs. Read the
documentation from `),Bo=r(et,"A",{href:!0});var Ba=a(Bo);Tn=d(Ba,"PretrainedConfig"),Ba.forEach(t),Nn=d(et," for more information."),et.forEach(t),Mn=u(Oe),v(ge.$$.fragment,Oe),Oe.forEach(t),us=u(o),Z=r(o,"H2",{class:!0});var xs=a(Z);_e=r(xs,"A",{id:!0,class:!0,href:!0});var Ra=a(_e);Nt=r(Ra,"SPAN",{});var Va=a(Nt);v(so.$$.fragment,Va),Va.forEach(t),Ra.forEach(t),Fn=u(xs),Mt=r(xs,"SPAN",{});var Ga=a(Mt);qn=d(Ga,"NystromformerModel"),Ga.forEach(t),xs.forEach(t),gs=u(o),W=r(o,"DIV",{class:!0});var ot=a(W);v(no.$$.fragment,ot),zn=u(ot),ro=r(ot,"P",{});var js=a(ro);xn=d(js,`The bare Nystr\xF6mformer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ao=r(js,"A",{href:!0,rel:!0});var Ka=a(ao);jn=d(Ka,"torch.nn.Module"),Ka.forEach(t),Cn=d(js,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),js.forEach(t),An=u(ot),O=r(ot,"DIV",{class:!0});var Se=a(O);v(io.$$.fragment,Se),En=u(Se),X=r(Se,"P",{});var tt=a(X);Pn=d(tt,"The "),Ro=r(tt,"A",{href:!0});var Ya=a(Ro);On=d(Ya,"NystromformerModel"),Ya.forEach(t),Sn=d(tt," forward method, overrides the "),Ft=r(tt,"CODE",{});var Ja=a(Ft);Ln=d(Ja,"__call__"),Ja.forEach(t),In=d(tt," special method."),tt.forEach(t),Dn=u(Se),v(ye.$$.fragment,Se),Wn=u(Se),v(be.$$.fragment,Se),Se.forEach(t),ot.forEach(t),_s=u(o),ee=r(o,"H2",{class:!0});var Cs=a(ee);ke=r(Cs,"A",{id:!0,class:!0,href:!0});var Za=a(ke);qt=r(Za,"SPAN",{});var Xa=a(qt);v(lo.$$.fragment,Xa),Xa.forEach(t),Za.forEach(t),Qn=u(Cs),zt=r(Cs,"SPAN",{});var ei=a(zt);Hn=d(ei,"NystromformerForMaskedLM"),ei.forEach(t),Cs.forEach(t),ys=u(o),Q=r(o,"DIV",{class:!0});var st=a(Q);v(co.$$.fragment,st),Un=u(st),oe=r(st,"P",{});var nt=a(oe);Bn=d(nt,"Nystr\xF6mformer Model with a "),xt=r(nt,"CODE",{});var oi=a(xt);Rn=d(oi,"language modeling"),oi.forEach(t),Vn=d(nt,` head on top.
This model is a PyTorch `),mo=r(nt,"A",{href:!0,rel:!0});var ti=a(mo);Gn=d(ti,"torch.nn.Module"),ti.forEach(t),Kn=d(nt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),nt.forEach(t),Yn=u(st),S=r(st,"DIV",{class:!0});var Le=a(S);v(po.$$.fragment,Le),Jn=u(Le),te=r(Le,"P",{});var rt=a(te);Zn=d(rt,"The "),Vo=r(rt,"A",{href:!0});var si=a(Vo);Xn=d(si,"NystromformerForMaskedLM"),si.forEach(t),er=d(rt," forward method, overrides the "),jt=r(rt,"CODE",{});var ni=a(jt);or=d(ni,"__call__"),ni.forEach(t),tr=d(rt," special method."),rt.forEach(t),sr=u(Le),v(ve.$$.fragment,Le),nr=u(Le),v(we.$$.fragment,Le),Le.forEach(t),st.forEach(t),bs=u(o),se=r(o,"H2",{class:!0});var As=a(se);$e=r(As,"A",{id:!0,class:!0,href:!0});var ri=a($e);Ct=r(ri,"SPAN",{});var ai=a(Ct);v(fo.$$.fragment,ai),ai.forEach(t),ri.forEach(t),rr=u(As),At=r(As,"SPAN",{});var ii=a(At);ar=d(ii,"NystromformerForSequenceClassification"),ii.forEach(t),As.forEach(t),ks=u(o),j=r(o,"DIV",{class:!0});var Ie=a(j);v(ho.$$.fragment,Ie),ir=u(Ie),Et=r(Ie,"P",{});var li=a(Et);lr=d(li,`Nystr\xF6mformer Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),li.forEach(t),dr=u(Ie),uo=r(Ie,"P",{});var Es=a(uo);cr=d(Es,"This model is a PyTorch "),go=r(Es,"A",{href:!0,rel:!0});var di=a(go);mr=d(di,"torch.nn.Module"),di.forEach(t),pr=d(Es,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Es.forEach(t),fr=u(Ie),z=r(Ie,"DIV",{class:!0});var B=a(z);v(_o.$$.fragment,B),hr=u(B),ne=r(B,"P",{});var at=a(ne);ur=d(at,"The "),Go=r(at,"A",{href:!0});var ci=a(Go);gr=d(ci,"NystromformerForSequenceClassification"),ci.forEach(t),_r=d(at," forward method, overrides the "),Pt=r(at,"CODE",{});var mi=a(Pt);yr=d(mi,"__call__"),mi.forEach(t),br=d(at," special method."),at.forEach(t),kr=u(B),v(Te.$$.fragment,B),vr=u(B),v(Ne.$$.fragment,B),wr=u(B),v(Me.$$.fragment,B),B.forEach(t),Ie.forEach(t),vs=u(o),re=r(o,"H2",{class:!0});var Ps=a(re);Fe=r(Ps,"A",{id:!0,class:!0,href:!0});var pi=a(Fe);Ot=r(pi,"SPAN",{});var fi=a(Ot);v(yo.$$.fragment,fi),fi.forEach(t),pi.forEach(t),$r=u(Ps),St=r(Ps,"SPAN",{});var hi=a(St);Tr=d(hi,"NystromformerForMultipleChoice"),hi.forEach(t),Ps.forEach(t),ws=u(o),C=r(o,"DIV",{class:!0});var De=a(C);v(bo.$$.fragment,De),Nr=u(De),Lt=r(De,"P",{});var ui=a(Lt);Mr=d(ui,`Nystr\xF6mformer 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.`),ui.forEach(t),Fr=u(De),ko=r(De,"P",{});var Os=a(ko);qr=d(Os,"This model is a PyTorch "),vo=r(Os,"A",{href:!0,rel:!0});var gi=a(vo);zr=d(gi,"torch.nn.Module"),gi.forEach(t),xr=d(Os,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Os.forEach(t),jr=u(De),L=r(De,"DIV",{class:!0});var We=a(L);v(wo.$$.fragment,We),Cr=u(We),ae=r(We,"P",{});var it=a(ae);Ar=d(it,"The "),Ko=r(it,"A",{href:!0});var _i=a(Ko);Er=d(_i,"NystromformerForMultipleChoice"),_i.forEach(t),Pr=d(it," forward method, overrides the "),It=r(it,"CODE",{});var yi=a(It);Or=d(yi,"__call__"),yi.forEach(t),Sr=d(it," special method."),it.forEach(t),Lr=u(We),v(qe.$$.fragment,We),Ir=u(We),v(ze.$$.fragment,We),We.forEach(t),De.forEach(t),$s=u(o),ie=r(o,"H2",{class:!0});var Ss=a(ie);xe=r(Ss,"A",{id:!0,class:!0,href:!0});var bi=a(xe);Dt=r(bi,"SPAN",{});var ki=a(Dt);v($o.$$.fragment,ki),ki.forEach(t),bi.forEach(t),Dr=u(Ss),Wt=r(Ss,"SPAN",{});var vi=a(Wt);Wr=d(vi,"NystromformerForTokenClassification"),vi.forEach(t),Ss.forEach(t),Ts=u(o),A=r(o,"DIV",{class:!0});var Qe=a(A);v(To.$$.fragment,Qe),Qr=u(Qe),Qt=r(Qe,"P",{});var wi=a(Qt);Hr=d(wi,`Nystr\xF6mformer 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.`),wi.forEach(t),Ur=u(Qe),No=r(Qe,"P",{});var Ls=a(No);Br=d(Ls,"This model is a PyTorch "),Mo=r(Ls,"A",{href:!0,rel:!0});var $i=a(Mo);Rr=d($i,"torch.nn.Module"),$i.forEach(t),Vr=d(Ls,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ls.forEach(t),Gr=u(Qe),I=r(Qe,"DIV",{class:!0});var He=a(I);v(Fo.$$.fragment,He),Kr=u(He),le=r(He,"P",{});var lt=a(le);Yr=d(lt,"The "),Yo=r(lt,"A",{href:!0});var Ti=a(Yo);Jr=d(Ti,"NystromformerForTokenClassification"),Ti.forEach(t),Zr=d(lt," forward method, overrides the "),Ht=r(lt,"CODE",{});var Ni=a(Ht);Xr=d(Ni,"__call__"),Ni.forEach(t),ea=d(lt," special method."),lt.forEach(t),oa=u(He),v(je.$$.fragment,He),ta=u(He),v(Ce.$$.fragment,He),He.forEach(t),Qe.forEach(t),Ns=u(o),de=r(o,"H2",{class:!0});var Is=a(de);Ae=r(Is,"A",{id:!0,class:!0,href:!0});var Mi=a(Ae);Ut=r(Mi,"SPAN",{});var Fi=a(Ut);v(qo.$$.fragment,Fi),Fi.forEach(t),Mi.forEach(t),sa=u(Is),Bt=r(Is,"SPAN",{});var qi=a(Bt);na=d(qi,"NystromformerForQuestionAnswering"),qi.forEach(t),Is.forEach(t),Ms=u(o),E=r(o,"DIV",{class:!0});var Ue=a(E);v(zo.$$.fragment,Ue),ra=u(Ue),ce=r(Ue,"P",{});var dt=a(ce);aa=d(dt,`Nystr\xF6mformer 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 `),Rt=r(dt,"CODE",{});var zi=a(Rt);ia=d(zi,"span start logits"),zi.forEach(t),la=d(dt," and "),Vt=r(dt,"CODE",{});var xi=a(Vt);da=d(xi,"span end logits"),xi.forEach(t),ca=d(dt,")."),dt.forEach(t),ma=u(Ue),xo=r(Ue,"P",{});var Ds=a(xo);pa=d(Ds,"This model is a PyTorch "),jo=r(Ds,"A",{href:!0,rel:!0});var ji=a(jo);fa=d(ji,"torch.nn.Module"),ji.forEach(t),ha=d(Ds,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ds.forEach(t),ua=u(Ue),D=r(Ue,"DIV",{class:!0});var Be=a(D);v(Co.$$.fragment,Be),ga=u(Be),me=r(Be,"P",{});var ct=a(me);_a=d(ct,"The "),Jo=r(ct,"A",{href:!0});var Ci=a(Jo);ya=d(Ci,"NystromformerForQuestionAnswering"),Ci.forEach(t),ba=d(ct," forward method, overrides the "),Gt=r(ct,"CODE",{});var Ai=a(Gt);ka=d(Ai,"__call__"),Ai.forEach(t),va=d(ct," special method."),ct.forEach(t),wa=u(Be),v(Ee.$$.fragment,Be),$a=u(Be),v(Pe.$$.fragment,Be),Be.forEach(t),Ue.forEach(t),this.h()},h(){p(i,"name","hf:doc:metadata"),p(i,"content",JSON.stringify(el)),p(m,"id","nystrmformer"),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","#nystrmformer"),p(f,"class","relative group"),p(pe,"id","overview"),p(pe,"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(pe,"href","#overview"),p(V,"class","relative group"),p(Ye,"href","https://arxiv.org/abs/2102.03902"),p(Ye,"rel","nofollow"),p(Je,"href","https://huggingface.co/novice03"),p(Je,"rel","nofollow"),p(Ze,"href","https://github.com/mlpen/Nystromformer"),p(Ze,"rel","nofollow"),p(he,"id","documentation-resources"),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","#documentation-resources"),p(G,"class","relative group"),p(Lo,"href","../tasks/sequence_classification"),p(Io,"href","../tasks/token_classification"),p(Do,"href","../tasks/question_answering"),p(Wo,"href","../tasks/masked_language_modeling"),p(Qo,"href","../tasks/multiple_choice"),p(ue,"id","transformers.NystromformerConfig"),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.NystromformerConfig"),p(K,"class","relative group"),p(Ho,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerModel"),p(to,"href","https://huggingface.co/uw-madison/nystromformer-512"),p(to,"rel","nofollow"),p(Uo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Bo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),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,"id","transformers.NystromformerModel"),p(_e,"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(_e,"href","#transformers.NystromformerModel"),p(Z,"class","relative group"),p(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ao,"rel","nofollow"),p(Ro,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerModel"),p(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(ke,"id","transformers.NystromformerForMaskedLM"),p(ke,"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(ke,"href","#transformers.NystromformerForMaskedLM"),p(ee,"class","relative group"),p(mo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(mo,"rel","nofollow"),p(Vo,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerForMaskedLM"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Q,"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,"id","transformers.NystromformerForSequenceClassification"),p($e,"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($e,"href","#transformers.NystromformerForSequenceClassification"),p(se,"class","relative group"),p(go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(go,"rel","nofollow"),p(Go,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerForSequenceClassification"),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(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(Fe,"id","transformers.NystromformerForMultipleChoice"),p(Fe,"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(Fe,"href","#transformers.NystromformerForMultipleChoice"),p(re,"class","relative group"),p(vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(vo,"rel","nofollow"),p(Ko,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerForMultipleChoice"),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(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(xe,"id","transformers.NystromformerForTokenClassification"),p(xe,"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(xe,"href","#transformers.NystromformerForTokenClassification"),p(ie,"class","relative group"),p(Mo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Mo,"rel","nofollow"),p(Yo,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerForTokenClassification"),p(I,"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(Ae,"id","transformers.NystromformerForQuestionAnswering"),p(Ae,"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(Ae,"href","#transformers.NystromformerForQuestionAnswering"),p(de,"class","relative group"),p(jo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(jo,"rel","nofollow"),p(Jo,"href","/docs/transformers/v4.29.0/en/model_doc/nystromformer#transformers.NystromformerForQuestionAnswering"),p(D,"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")},m(o,g){e(document.head,i),y(o,b,g),y(o,f,g),e(f,m),e(m,_),w(s,_,null),e(f,c),e(f,F),e(F,Ws),y(o,as,g),y(o,V,g),e(V,pe),e(pe,pt),w(Ke,pt,null),e(V,Qs),e(V,ft),e(ft,Hs),y(o,is,g),y(o,fe,g),e(fe,Us),e(fe,Ye),e(Ye,ht),e(ht,Bs),e(fe,Rs),y(o,ls,g),y(o,Oo,g),e(Oo,Vs),y(o,ds,g),y(o,So,g),e(So,ut),e(ut,Gs),y(o,cs,g),y(o,H,g),e(H,Ks),e(H,Je),e(Je,Ys),e(H,Js),e(H,Ze),e(Ze,Zs),e(H,Xs),y(o,ms,g),y(o,G,g),e(G,he),e(he,gt),w(Xe,gt,null),e(G,en),e(G,_t),e(_t,on),y(o,ps,g),y(o,q,g),e(q,yt),e(yt,Lo),e(Lo,tn),e(q,sn),e(q,bt),e(bt,Io),e(Io,nn),e(q,rn),e(q,kt),e(kt,Do),e(Do,an),e(q,ln),e(q,vt),e(vt,Wo),e(Wo,dn),e(q,cn),e(q,wt),e(wt,Qo),e(Qo,mn),y(o,fs,g),y(o,K,g),e(K,ue),e(ue,$t),w(eo,$t,null),e(K,pn),e(K,Tt),e(Tt,fn),y(o,hs,g),y(o,x,g),w(oo,x,null),e(x,hn),e(x,Y),e(Y,un),e(Y,Ho),e(Ho,gn),e(Y,_n),e(Y,to),e(to,yn),e(Y,bn),e(x,kn),e(x,J),e(J,vn),e(J,Uo),e(Uo,wn),e(J,$n),e(J,Bo),e(Bo,Tn),e(J,Nn),e(x,Mn),w(ge,x,null),y(o,us,g),y(o,Z,g),e(Z,_e),e(_e,Nt),w(so,Nt,null),e(Z,Fn),e(Z,Mt),e(Mt,qn),y(o,gs,g),y(o,W,g),w(no,W,null),e(W,zn),e(W,ro),e(ro,xn),e(ro,ao),e(ao,jn),e(ro,Cn),e(W,An),e(W,O),w(io,O,null),e(O,En),e(O,X),e(X,Pn),e(X,Ro),e(Ro,On),e(X,Sn),e(X,Ft),e(Ft,Ln),e(X,In),e(O,Dn),w(ye,O,null),e(O,Wn),w(be,O,null),y(o,_s,g),y(o,ee,g),e(ee,ke),e(ke,qt),w(lo,qt,null),e(ee,Qn),e(ee,zt),e(zt,Hn),y(o,ys,g),y(o,Q,g),w(co,Q,null),e(Q,Un),e(Q,oe),e(oe,Bn),e(oe,xt),e(xt,Rn),e(oe,Vn),e(oe,mo),e(mo,Gn),e(oe,Kn),e(Q,Yn),e(Q,S),w(po,S,null),e(S,Jn),e(S,te),e(te,Zn),e(te,Vo),e(Vo,Xn),e(te,er),e(te,jt),e(jt,or),e(te,tr),e(S,sr),w(ve,S,null),e(S,nr),w(we,S,null),y(o,bs,g),y(o,se,g),e(se,$e),e($e,Ct),w(fo,Ct,null),e(se,rr),e(se,At),e(At,ar),y(o,ks,g),y(o,j,g),w(ho,j,null),e(j,ir),e(j,Et),e(Et,lr),e(j,dr),e(j,uo),e(uo,cr),e(uo,go),e(go,mr),e(uo,pr),e(j,fr),e(j,z),w(_o,z,null),e(z,hr),e(z,ne),e(ne,ur),e(ne,Go),e(Go,gr),e(ne,_r),e(ne,Pt),e(Pt,yr),e(ne,br),e(z,kr),w(Te,z,null),e(z,vr),w(Ne,z,null),e(z,wr),w(Me,z,null),y(o,vs,g),y(o,re,g),e(re,Fe),e(Fe,Ot),w(yo,Ot,null),e(re,$r),e(re,St),e(St,Tr),y(o,ws,g),y(o,C,g),w(bo,C,null),e(C,Nr),e(C,Lt),e(Lt,Mr),e(C,Fr),e(C,ko),e(ko,qr),e(ko,vo),e(vo,zr),e(ko,xr),e(C,jr),e(C,L),w(wo,L,null),e(L,Cr),e(L,ae),e(ae,Ar),e(ae,Ko),e(Ko,Er),e(ae,Pr),e(ae,It),e(It,Or),e(ae,Sr),e(L,Lr),w(qe,L,null),e(L,Ir),w(ze,L,null),y(o,$s,g),y(o,ie,g),e(ie,xe),e(xe,Dt),w($o,Dt,null),e(ie,Dr),e(ie,Wt),e(Wt,Wr),y(o,Ts,g),y(o,A,g),w(To,A,null),e(A,Qr),e(A,Qt),e(Qt,Hr),e(A,Ur),e(A,No),e(No,Br),e(No,Mo),e(Mo,Rr),e(No,Vr),e(A,Gr),e(A,I),w(Fo,I,null),e(I,Kr),e(I,le),e(le,Yr),e(le,Yo),e(Yo,Jr),e(le,Zr),e(le,Ht),e(Ht,Xr),e(le,ea),e(I,oa),w(je,I,null),e(I,ta),w(Ce,I,null),y(o,Ns,g),y(o,de,g),e(de,Ae),e(Ae,Ut),w(qo,Ut,null),e(de,sa),e(de,Bt),e(Bt,na),y(o,Ms,g),y(o,E,g),w(zo,E,null),e(E,ra),e(E,ce),e(ce,aa),e(ce,Rt),e(Rt,ia),e(ce,la),e(ce,Vt),e(Vt,da),e(ce,ca),e(E,ma),e(E,xo),e(xo,pa),e(xo,jo),e(jo,fa),e(xo,ha),e(E,ua),e(E,D),w(Co,D,null),e(D,ga),e(D,me),e(me,_a),e(me,Jo),e(Jo,ya),e(me,ba),e(me,Gt),e(Gt,ka),e(me,va),e(D,wa),w(Ee,D,null),e(D,$a),w(Pe,D,null),Fs=!0},p(o,[g]){const Ao={};g&2&&(Ao.$$scope={dirty:g,ctx:o}),ge.$set(Ao);const Kt={};g&2&&(Kt.$$scope={dirty:g,ctx:o}),ye.$set(Kt);const Yt={};g&2&&(Yt.$$scope={dirty:g,ctx:o}),be.$set(Yt);const Jt={};g&2&&(Jt.$$scope={dirty:g,ctx:o}),ve.$set(Jt);const Eo={};g&2&&(Eo.$$scope={dirty:g,ctx:o}),we.$set(Eo);const Zt={};g&2&&(Zt.$$scope={dirty:g,ctx:o}),Te.$set(Zt);const Xt={};g&2&&(Xt.$$scope={dirty:g,ctx:o}),Ne.$set(Xt);const es={};g&2&&(es.$$scope={dirty:g,ctx:o}),Me.$set(es);const Po={};g&2&&(Po.$$scope={dirty:g,ctx:o}),qe.$set(Po);const os={};g&2&&(os.$$scope={dirty:g,ctx:o}),ze.$set(os);const ts={};g&2&&(ts.$$scope={dirty:g,ctx:o}),je.$set(ts);const ss={};g&2&&(ss.$$scope={dirty:g,ctx:o}),Ce.$set(ss);const ns={};g&2&&(ns.$$scope={dirty:g,ctx:o}),Ee.$set(ns);const rs={};g&2&&(rs.$$scope={dirty:g,ctx:o}),Pe.$set(rs)},i(o){Fs||($(s.$$.fragment,o),$(Ke.$$.fragment,o),$(Xe.$$.fragment,o),$(eo.$$.fragment,o),$(oo.$$.fragment,o),$(ge.$$.fragment,o),$(so.$$.fragment,o),$(no.$$.fragment,o),$(io.$$.fragment,o),$(ye.$$.fragment,o),$(be.$$.fragment,o),$(lo.$$.fragment,o),$(co.$$.fragment,o),$(po.$$.fragment,o),$(ve.$$.fragment,o),$(we.$$.fragment,o),$(fo.$$.fragment,o),$(ho.$$.fragment,o),$(_o.$$.fragment,o),$(Te.$$.fragment,o),$(Ne.$$.fragment,o),$(Me.$$.fragment,o),$(yo.$$.fragment,o),$(bo.$$.fragment,o),$(wo.$$.fragment,o),$(qe.$$.fragment,o),$(ze.$$.fragment,o),$($o.$$.fragment,o),$(To.$$.fragment,o),$(Fo.$$.fragment,o),$(je.$$.fragment,o),$(Ce.$$.fragment,o),$(qo.$$.fragment,o),$(zo.$$.fragment,o),$(Co.$$.fragment,o),$(Ee.$$.fragment,o),$(Pe.$$.fragment,o),Fs=!0)},o(o){T(s.$$.fragment,o),T(Ke.$$.fragment,o),T(Xe.$$.fragment,o),T(eo.$$.fragment,o),T(oo.$$.fragment,o),T(ge.$$.fragment,o),T(so.$$.fragment,o),T(no.$$.fragment,o),T(io.$$.fragment,o),T(ye.$$.fragment,o),T(be.$$.fragment,o),T(lo.$$.fragment,o),T(co.$$.fragment,o),T(po.$$.fragment,o),T(ve.$$.fragment,o),T(we.$$.fragment,o),T(fo.$$.fragment,o),T(ho.$$.fragment,o),T(_o.$$.fragment,o),T(Te.$$.fragment,o),T(Ne.$$.fragment,o),T(Me.$$.fragment,o),T(yo.$$.fragment,o),T(bo.$$.fragment,o),T(wo.$$.fragment,o),T(qe.$$.fragment,o),T(ze.$$.fragment,o),T($o.$$.fragment,o),T(To.$$.fragment,o),T(Fo.$$.fragment,o),T(je.$$.fragment,o),T(Ce.$$.fragment,o),T(qo.$$.fragment,o),T(zo.$$.fragment,o),T(Co.$$.fragment,o),T(Ee.$$.fragment,o),T(Pe.$$.fragment,o),Fs=!1},d(o){t(i),o&&t(b),o&&t(f),N(s),o&&t(as),o&&t(V),N(Ke),o&&t(is),o&&t(fe),o&&t(ls),o&&t(Oo),o&&t(ds),o&&t(So),o&&t(cs),o&&t(H),o&&t(ms),o&&t(G),N(Xe),o&&t(ps),o&&t(q),o&&t(fs),o&&t(K),N(eo),o&&t(hs),o&&t(x),N(oo),N(ge),o&&t(us),o&&t(Z),N(so),o&&t(gs),o&&t(W),N(no),N(io),N(ye),N(be),o&&t(_s),o&&t(ee),N(lo),o&&t(ys),o&&t(Q),N(co),N(po),N(ve),N(we),o&&t(bs),o&&t(se),N(fo),o&&t(ks),o&&t(j),N(ho),N(_o),N(Te),N(Ne),N(Me),o&&t(vs),o&&t(re),N(yo),o&&t(ws),o&&t(C),N(bo),N(wo),N(qe),N(ze),o&&t($s),o&&t(ie),N($o),o&&t(Ts),o&&t(A),N(To),N(Fo),N(je),N(Ce),o&&t(Ns),o&&t(de),N(qo),o&&t(Ms),o&&t(E),N(zo),N(Co),N(Ee),N(Pe)}}}const el={local:"nystrmformer",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.NystromformerConfig",title:"NystromformerConfig"},{local:"transformers.NystromformerModel",title:"NystromformerModel"},{local:"transformers.NystromformerForMaskedLM",title:"NystromformerForMaskedLM"},{local:"transformers.NystromformerForSequenceClassification",title:"NystromformerForSequenceClassification"},{local:"transformers.NystromformerForMultipleChoice",title:"NystromformerForMultipleChoice"},{local:"transformers.NystromformerForTokenClassification",title:"NystromformerForTokenClassification"},{local:"transformers.NystromformerForQuestionAnswering",title:"NystromformerForQuestionAnswering"}],title:"Nystr\xF6mformer"};function ol(M){return Li(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ll extends Ei{constructor(i){super();Pi(this,i,ol,Xi,Oi,{})}}export{ll as default,el as metadata};
