import{S as Gh,i as Jh,s as Kh,e as s,k as f,w as v,t as i,M as Xh,c as r,d as o,m,a,x as w,h as l,b as h,G as e,g as b,y as F,q as $,o as T,B as y,v as Yh,L as Z}from"../../chunks/vendor-hf-doc-builder.js";import{T as It}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ee}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as j}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Y}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Zh(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import FNetConfig, FNetModel

# Initializing a FNet fnet-base style configuration
configuration = FNetConfig()

# Initializing a model (with random weights) from the fnet-base style configuration
model = FNetModel(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> FNetConfig, FNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FNet fnet-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FNetConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the fnet-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetModel(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(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function ef(N){let c,k,u,p,_;return p=new ee({props:{code:"0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 | first sequence | second sequence |",highlighted:'<span class="hljs-attribute">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> | first sequence | second sequence |'}}),{c(){c=s("p"),k=i("pair mask has the following format: :"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"pair mask has the following format: :"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function tf(N){let c,k,u,p,_;return p=new ee({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){c=s("p"),k=i("sequence pair mask has the following format:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"sequence pair mask has the following format:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function of(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function nf(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetModel
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetModel.from_pretrained("google/fnet-base")

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, FNetModel
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetModel.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function sf(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function rf(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetForPreTraining
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForPreTraining.from_pretrained("google/fnet-base")
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)
prediction_logits = outputs.prediction_logits
seq_relationship_logits = outputs.seq_relationship_logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForPreTraining
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function af(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function lf(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForMaskedLM.from_pretrained("google/fnet-base")

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, FNetForMaskedLM
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function cf(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function df(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetForNextSentencePrediction
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForNextSentencePrediction.from_pretrained("google/fnet-base")
prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
next_sentence = "The sky is blue due to the shorter wavelength of blue light."
encoding = tokenizer(prompt, next_sentence, return_tensors="pt")
outputs = model(**encoding, labels=torch.LongTensor([1]))
logits = outputs.logits
assert logits[0, 0] < logits[0, 1]  # next sentence was random`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForNextSentencePrediction
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function pf(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function hf(N){let c,k,u,p,_;return p=new ee({props:{code:`import torch
from transformers import AutoTokenizer, FNetForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForSequenceClassification.from_pretrained("google/fnet-base")

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 = FNetForSequenceClassification.from_pretrained("google/fnet-base", 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, FNetForSequenceClassification

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

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForSequenceClassification.from_pretrained("google/fnet-base", 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 = FNetForSequenceClassification.from_pretrained(
    "google/fnet-base", 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, FNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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 = FNetForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/fnet-base&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(){c=s("p"),k=i("Example of multi-label classification:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example of multi-label classification:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function mf(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function uf(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForMultipleChoice.from_pretrained("google/fnet-base")

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, FNetForMultipleChoice
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function gf(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function _f(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForTokenClassification.from_pretrained("google/fnet-base")

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, FNetForTokenClassification
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForTokenClassification.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function bf(N){let c,k,u,p,_;return{c(){c=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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(n){c=r(n,"P",{});var d=a(c);k=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var z=a(u);p=l(z,"Module"),z.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,k),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function kf(N){let c,k,u,p,_;return p=new ee({props:{code:`from transformers import AutoTokenizer, FNetForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("google/fnet-base")
model = FNetForQuestionAnswering.from_pretrained("google/fnet-base")

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, FNetForQuestionAnswering
<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;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&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(){c=s("p"),k=i("Example:"),u=f(),v(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),w(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),F(p,n,d),_=!0},p:Z,i(n){_||($(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function vf(N){let c,k,u,p,_,n,d,z,ga,_r,de,Oe,Rn,Ot,_a,Gn,ba,br,De,ka,Dt,va,wa,kr,Zo,Jn,Fa,vr,en,$a,wr,tn,Kn,Ta,Fr,se,ya,Wt,Na,za,Ut,qa,xa,$r,pe,We,Xn,Bt,Ea,Yn,Pa,Tr,E,Zn,on,ja,Ma,es,nn,Aa,Ca,ts,sn,Sa,La,os,rn,Ia,Oa,ns,an,Da,yr,he,Ue,ss,Ht,Wa,rs,Ua,Nr,M,Qt,Ba,fe,Ha,ln,Qa,Va,Vt,Ra,Ga,Ja,me,Ka,cn,Xa,Ya,dn,Za,ei,ti,Be,zr,ue,He,as,Rt,oi,is,ni,qr,x,Gt,si,te,ri,pn,ai,ii,Jt,li,ci,hn,di,pi,hi,re,Kt,fi,ls,mi,ui,Xt,fn,gi,cs,_i,bi,mn,ki,ds,vi,wi,Qe,Yt,Fi,Zt,$i,ps,Ti,yi,Ni,U,eo,zi,hs,qi,xi,Ve,Ei,ge,Pi,fs,ji,Mi,ms,Ai,Ci,Si,un,to,xr,_e,Re,us,oo,Li,gs,Ii,Er,A,no,Oi,C,Di,_s,Wi,Ui,gn,Bi,Hi,so,Qi,Vi,_n,Ri,Gi,Ji,ae,ro,Ki,bs,Xi,Yi,ao,bn,Zi,ks,el,tl,kn,ol,vs,nl,sl,B,io,rl,ws,al,il,Ge,ll,Fs,cl,Pr,be,Je,$s,lo,dl,Ts,pl,jr,S,co,hl,po,fl,ho,ml,ul,gl,fo,_l,mo,bl,kl,vl,H,uo,wl,ke,Fl,vn,$l,Tl,ys,yl,Nl,zl,Ke,ql,Xe,Mr,ve,Ye,Ns,go,xl,zs,El,Ar,L,_o,Pl,we,jl,qs,Ml,Al,xs,Cl,Sl,Ll,bo,Il,ko,Ol,Dl,Wl,Q,vo,Ul,Fe,Bl,wn,Hl,Ql,Es,Vl,Rl,Gl,Ze,Jl,et,Cr,$e,tt,Ps,wo,Kl,js,Xl,Sr,oe,Fo,Yl,Te,Zl,Ms,ec,tc,$o,oc,nc,sc,V,To,rc,ye,ac,Fn,ic,lc,As,cc,dc,pc,ot,hc,nt,Lr,Ne,st,Cs,yo,fc,Ss,mc,Ir,ne,No,uc,ze,gc,Ls,_c,bc,zo,kc,vc,wc,R,qo,Fc,qe,$c,$n,Tc,yc,Is,Nc,zc,qc,rt,xc,at,Or,xe,it,Os,xo,Ec,Ds,Pc,Dr,I,Eo,jc,Ws,Mc,Ac,Po,Cc,jo,Sc,Lc,Ic,P,Mo,Oc,Ee,Dc,Tn,Wc,Uc,Us,Bc,Hc,Qc,lt,Vc,ct,Rc,dt,Wr,Pe,pt,Bs,Ao,Gc,Hs,Jc,Ur,O,Co,Kc,Qs,Xc,Yc,So,Zc,Lo,ed,td,od,G,Io,nd,je,sd,yn,rd,ad,Vs,id,ld,cd,ht,dd,ft,Br,Me,mt,Rs,Oo,pd,Gs,hd,Hr,D,Do,fd,Js,md,ud,Wo,gd,Uo,_d,bd,kd,J,Bo,vd,Ae,wd,Nn,Fd,$d,Ks,Td,yd,Nd,ut,zd,gt,Qr,Ce,_t,Xs,Ho,qd,Ys,xd,Vr,W,Qo,Ed,Se,Pd,Zs,jd,Md,er,Ad,Cd,Sd,Vo,Ld,Ro,Id,Od,Dd,K,Go,Wd,Le,Ud,zn,Bd,Hd,tr,Qd,Vd,Rd,bt,Gd,kt,Rr;return n=new j({}),Ot=new j({}),Bt=new j({}),Ht=new j({}),Qt=new q({props:{name:"class transformers.FNetConfig",anchor:"transformers.FNetConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu_new'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 4"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_tpu_fourier_optimizations",val:" = False"},{name:"tpu_short_seq_length",val:" = 512"},{name:"pad_token_id",val:" = 3"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the FNet 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/fnet#transformers.FNetModel">FNetModel</a> or <code>TFFNetModel</code>.`,name:"vocab_size"},{anchor:"transformers.FNetConfig.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.FNetConfig.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.FNetConfig.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.FNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_new&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.FNetConfig.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.FNetConfig.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.FNetConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetModel">FNetModel</a> or <code>TFFNetModel</code>.`,name:"type_vocab_size"},{anchor:"transformers.FNetConfig.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.FNetConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.FNetConfig.use_tpu_fourier_optimizations",description:`<strong>use_tpu_fourier_optimizations</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Determines whether to use TPU optimized FFTs. If <code>True</code>, the model will favor axis-wise FFTs transforms.
Set to <code>False</code> for GPU/CPU hardware, in which case n-dimensional FFTs are used.`,name:"use_tpu_fourier_optimizations"},{anchor:"transformers.FNetConfig.tpu_short_seq_length",description:`<strong>tpu_short_seq_length</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The sequence length that is expected by the model when using TPUs. This will be used to initialize the DFT
matrix only when <em>use_tpu_fourier_optimizations</em> is set to <code>True</code> and the input sequence is shorter than or
equal to 4096 tokens.`,name:"tpu_short_seq_length"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/configuration_fnet.py#L30"}}),Be=new Y({props:{anchor:"transformers.FNetConfig.example",$$slots:{default:[Zh]},$$scope:{ctx:N}}}),Rt=new j({}),Gt=new q({props:{name:"class transformers.FNetTokenizer",anchor:"transformers.FNetTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = False"},{name:"remove_space",val:" = True"},{name:"keep_accents",val:" = True"},{name:"unk_token",val:" = '<unk>'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '<pad>'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.FNetTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.FNetTokenizer.remove_space",description:`<strong>remove_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to strip the text when tokenizing (removing excess spaces before and after the string).`,name:"remove_space"},{anchor:"transformers.FNetTokenizer.keep_accents",description:`<strong>keep_accents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to keep accents when tokenizing.`,name:"keep_accents"},{anchor:"transformers.FNetTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.FNetTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.FNetTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.FNetTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.FNetTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.FNetTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.FNetTokenizer.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet.py#L47"}}),Kt=new q({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.FNetTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.FNetTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.FNetTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet.py#L283",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Yt=new q({props:{name:"get_special_tokens_mask",anchor:"transformers.FNetTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.FNetTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.FNetTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.FNetTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet.py#L308",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),eo=new q({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.FNetTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.FNetTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.FNetTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet.py#L336",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ve=new Y({props:{anchor:"transformers.FNetTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[ef]},$$scope:{ctx:N}}}),to=new q({props:{name:"save_vocabulary",anchor:"transformers.FNetTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet.py#L365"}}),oo=new j({}),no=new q({props:{name:"class transformers.FNetTokenizerFast",anchor:"transformers.FNetTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = False"},{name:"remove_space",val:" = True"},{name:"keep_accents",val:" = True"},{name:"unk_token",val:" = '<unk>'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '<pad>'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.FNetTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.FNetTokenizerFast.remove_space",description:`<strong>remove_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to strip the text when tokenizing (removing excess spaces before and after the string).`,name:"remove_space"},{anchor:"transformers.FNetTokenizerFast.keep_accents",description:`<strong>keep_accents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to keep accents when tokenizing.`,name:"keep_accents"},{anchor:"transformers.FNetTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.FNetTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.FNetTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.FNetTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.FNetTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet_fast.py#L54"}}),ro=new q({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.FNetTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.FNetTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added`,name:"token_ids_0"},{anchor:"transformers.FNetTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet_fast.py#L137",returnDescription:`
<p>list of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),io=new q({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.FNetTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.FNetTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids.`,name:"token_ids_0"},{anchor:"transformers.FNetTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/tokenization_fnet_fast.py#L162",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ge=new Y({props:{anchor:"transformers.FNetTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[tf]},$$scope:{ctx:N}}}),lo=new j({}),co=new q({props:{name:"class transformers.FNetModel",anchor:"transformers.FNetModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.FNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L514"}}),uo=new q({props:{name:"forward",anchor:"transformers.FNetModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetModel.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.FNetModel.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.FNetModel.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.FNetModel.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.FNetModel.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.FNetModel.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/fnet/modeling_fnet.py#L540",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</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/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>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.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new It({props:{$$slots:{default:[of]},$$scope:{ctx:N}}}),Xe=new Y({props:{anchor:"transformers.FNetModel.forward.example",$$slots:{default:[nf]},$$scope:{ctx:N}}}),go=new j({}),_o=new q({props:{name:"class transformers.FNetForPreTraining",anchor:"transformers.FNetForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L623"}}),vo=new q({props:{name:"forward",anchor:"transformers.FNetForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForPreTraining.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.FNetForPreTraining.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.FNetForPreTraining.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.FNetForPreTraining.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.FNetForPreTraining.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.FNetForPreTraining.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.FNetForPreTraining.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.FNetForPreTraining.forward.next_sentence_label",description:`<strong>next_sentence_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"next_sentence_label"},{anchor:"transformers.FNetForPreTraining.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/modeling_fnet.py#L641",returnDescription:`
<p>A <code>transformers.models.fnet.modeling_fnet.FNetForPreTrainingOutput</code> 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/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</li>
<li><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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.models.fnet.modeling_fnet.FNetForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new It({props:{$$slots:{default:[sf]},$$scope:{ctx:N}}}),et=new Y({props:{anchor:"transformers.FNetForPreTraining.forward.example",$$slots:{default:[rf]},$$scope:{ctx:N}}}),wo=new j({}),Fo=new q({props:{name:"class transformers.FNetForMaskedLM",anchor:"transformers.FNetForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L717"}}),To=new q({props:{name:"forward",anchor:"transformers.FNetForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForMaskedLM.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.FNetForMaskedLM.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.FNetForMaskedLM.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.FNetForMaskedLM.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.FNetForMaskedLM.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.FNetForMaskedLM.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.FNetForMaskedLM.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/fnet/modeling_fnet.py#L735",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/fnet#transformers.FNetConfig"
>FNetConfig</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>
`}}),ot=new It({props:{$$slots:{default:[af]},$$scope:{ctx:N}}}),nt=new Y({props:{anchor:"transformers.FNetForMaskedLM.forward.example",$$slots:{default:[lf]},$$scope:{ctx:N}}}),yo=new j({}),No=new q({props:{name:"class transformers.FNetForNextSentencePrediction",anchor:"transformers.FNetForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L787"}}),qo=new q({props:{name:"forward",anchor:"transformers.FNetForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring). Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/fnet/modeling_fnet.py#L797",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rt=new It({props:{$$slots:{default:[cf]},$$scope:{ctx:N}}}),at=new Y({props:{anchor:"transformers.FNetForNextSentencePrediction.forward.example",$$slots:{default:[df]},$$scope:{ctx:N}}}),xo=new j({}),Eo=new q({props:{name:"class transformers.FNetForSequenceClassification",anchor:"transformers.FNetForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L882"}}),Mo=new q({props:{name:"forward",anchor:"transformers.FNetForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForSequenceClassification.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.FNetForSequenceClassification.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.FNetForSequenceClassification.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.FNetForSequenceClassification.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.FNetForSequenceClassification.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.FNetForSequenceClassification.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.FNetForSequenceClassification.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/fnet/modeling_fnet.py#L894",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/fnet#transformers.FNetConfig"
>FNetConfig</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>
`}}),lt=new It({props:{$$slots:{default:[pf]},$$scope:{ctx:N}}}),ct=new Y({props:{anchor:"transformers.FNetForSequenceClassification.forward.example",$$slots:{default:[hf]},$$scope:{ctx:N}}}),dt=new Y({props:{anchor:"transformers.FNetForSequenceClassification.forward.example-2",$$slots:{default:[ff]},$$scope:{ctx:N}}}),Ao=new j({}),Co=new q({props:{name:"class transformers.FNetForMultipleChoice",anchor:"transformers.FNetForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L967"}}),Io=new q({props:{name:"forward",anchor:"transformers.FNetForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForMultipleChoice.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.FNetForMultipleChoice.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.FNetForMultipleChoice.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.FNetForMultipleChoice.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.FNetForMultipleChoice.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.FNetForMultipleChoice.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.FNetForMultipleChoice.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/fnet/modeling_fnet.py#L978",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/fnet#transformers.FNetConfig"
>FNetConfig</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>
`}}),ht=new It({props:{$$slots:{default:[mf]},$$scope:{ctx:N}}}),ft=new Y({props:{anchor:"transformers.FNetForMultipleChoice.forward.example",$$slots:{default:[uf]},$$scope:{ctx:N}}}),Oo=new j({}),Do=new q({props:{name:"class transformers.FNetForTokenClassification",anchor:"transformers.FNetForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L1046"}}),Bo=new q({props:{name:"forward",anchor:"transformers.FNetForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForTokenClassification.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.FNetForTokenClassification.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.FNetForTokenClassification.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.FNetForTokenClassification.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.FNetForTokenClassification.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.FNetForTokenClassification.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.FNetForTokenClassification.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/fnet/modeling_fnet.py#L1059",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/fnet#transformers.FNetConfig"
>FNetConfig</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>
`}}),ut=new It({props:{$$slots:{default:[gf]},$$scope:{ctx:N}}}),gt=new Y({props:{anchor:"transformers.FNetForTokenClassification.forward.example",$$slots:{default:[_f]},$$scope:{ctx:N}}}),Ho=new j({}),Qo=new q({props:{name:"class transformers.FNetForQuestionAnswering",anchor:"transformers.FNetForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</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/fnet/modeling_fnet.py#L1115"}}),Go=new q({props:{name:"forward",anchor:"transformers.FNetForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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/fnet/modeling_fnet.py#L1127",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/fnet#transformers.FNetConfig"
>FNetConfig</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>
`}}),bt=new It({props:{$$slots:{default:[bf]},$$scope:{ctx:N}}}),kt=new Y({props:{anchor:"transformers.FNetForQuestionAnswering.forward.example",$$slots:{default:[kf]},$$scope:{ctx:N}}}),{c(){c=s("meta"),k=f(),u=s("h1"),p=s("a"),_=s("span"),v(n.$$.fragment),d=f(),z=s("span"),ga=i("FNet"),_r=f(),de=s("h2"),Oe=s("a"),Rn=s("span"),v(Ot.$$.fragment),_a=f(),Gn=s("span"),ba=i("Overview"),br=f(),De=s("p"),ka=i("The FNet model was proposed in "),Dt=s("a"),va=i("FNet: Mixing Tokens with Fourier Transforms"),wa=i(` by
James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon. The model replaces the self-attention layer in a BERT
model with a fourier transform which returns only the real parts of the transform. The model is significantly faster
than the BERT model because it has fewer parameters and is more memory efficient. The model achieves about 92-97%
accuracy of BERT counterparts on GLUE benchmark, and trains much faster than the BERT model. The abstract from the
paper is the following:`),kr=f(),Zo=s("p"),Jn=s("em"),Fa=i(`We show that Transformer encoder architectures can be sped up, with limited accuracy costs, by replacing the
self-attention sublayers with simple linear transformations that \u201Cmix\u201D input tokens. These linear mixers, along with
standard nonlinearities in feed-forward layers, prove competent at modeling semantic relationships in several text
classification tasks. Most surprisingly, we find that replacing the self-attention sublayer in a Transformer encoder
with a standard, unparameterized Fourier Transform achieves 92-97% of the accuracy of BERT counterparts on the GLUE
benchmark, but trains 80% faster on GPUs and 70% faster on TPUs at standard 512 input lengths. At longer input lengths,
our FNet model is significantly faster: when compared to the \u201Cefficient\u201D Transformers on the Long Range Arena
benchmark, FNet matches the accuracy of the most accurate models, while outpacing the fastest models across all
sequence lengths on GPUs (and across relatively shorter lengths on TPUs). Finally, FNet has a light memory footprint
and is particularly efficient at smaller model sizes; for a fixed speed and accuracy budget, small FNet models
outperform Transformer counterparts.`),vr=f(),en=s("p"),$a=i("Tips on usage:"),wr=f(),tn=s("ul"),Kn=s("li"),Ta=i(`The model was trained without an attention mask as it is based on Fourier Transform. The model was trained with
maximum sequence length 512 which includes pad tokens. Hence, it is highly recommended to use the same maximum
sequence length for fine-tuning and inference.`),Fr=f(),se=s("p"),ya=i("This model was contributed by "),Wt=s("a"),Na=i("gchhablani"),za=i(". The original code can be found "),Ut=s("a"),qa=i("here"),xa=i("."),$r=f(),pe=s("h2"),We=s("a"),Xn=s("span"),v(Bt.$$.fragment),Ea=f(),Yn=s("span"),Pa=i("Documentation resources"),Tr=f(),E=s("ul"),Zn=s("li"),on=s("a"),ja=i("Text classification task guide"),Ma=f(),es=s("li"),nn=s("a"),Aa=i("Token classification task guide"),Ca=f(),ts=s("li"),sn=s("a"),Sa=i("Question answering task guide"),La=f(),os=s("li"),rn=s("a"),Ia=i("Masked language modeling task guide"),Oa=f(),ns=s("li"),an=s("a"),Da=i("Multiple choice task guide"),yr=f(),he=s("h2"),Ue=s("a"),ss=s("span"),v(Ht.$$.fragment),Wa=f(),rs=s("span"),Ua=i("FNetConfig"),Nr=f(),M=s("div"),v(Qt.$$.fragment),Ba=f(),fe=s("p"),Ha=i("This is the configuration class to store the configuration of a "),ln=s("a"),Qa=i("FNetModel"),Va=i(`. It is used to instantiate an FNet
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 FNet
`),Vt=s("a"),Ra=i("google/fnet-base"),Ga=i(" architecture."),Ja=f(),me=s("p"),Ka=i("Configuration objects inherit from "),cn=s("a"),Xa=i("PretrainedConfig"),Ya=i(` and can be used to control the model outputs. Read the
documentation from `),dn=s("a"),Za=i("PretrainedConfig"),ei=i(" for more information."),ti=f(),v(Be.$$.fragment),zr=f(),ue=s("h2"),He=s("a"),as=s("span"),v(Rt.$$.fragment),oi=f(),is=s("span"),ni=i("FNetTokenizer"),qr=f(),x=s("div"),v(Gt.$$.fragment),si=f(),te=s("p"),ri=i("Construct an FNet tokenizer. Adapted from "),pn=s("a"),ai=i("AlbertTokenizer"),ii=i(`. Based on
`),Jt=s("a"),li=i("SentencePiece"),ci=i(". This tokenizer inherits from "),hn=s("a"),di=i("PreTrainedTokenizer"),pi=i(`
which contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.`),hi=f(),re=s("div"),v(Kt.$$.fragment),fi=f(),ls=s("p"),mi=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),ui=f(),Xt=s("ul"),fn=s("li"),gi=i("single sequence: "),cs=s("code"),_i=i("[CLS] X [SEP]"),bi=f(),mn=s("li"),ki=i("pair of sequences: "),ds=s("code"),vi=i("[CLS] A [SEP] B [SEP]"),wi=f(),Qe=s("div"),v(Yt.$$.fragment),Fi=f(),Zt=s("p"),$i=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),ps=s("code"),Ti=i("prepare_for_model"),yi=i(" method."),Ni=f(),U=s("div"),v(eo.$$.fragment),zi=f(),hs=s("p"),qi=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet sequence"),xi=f(),v(Ve.$$.fragment),Ei=f(),ge=s("p"),Pi=i("If "),fs=s("code"),ji=i("token_ids_1"),Mi=i(" is "),ms=s("code"),Ai=i("None"),Ci=i(", this method only returns the first portion of the mask (0s)."),Si=f(),un=s("div"),v(to.$$.fragment),xr=f(),_e=s("h2"),Re=s("a"),us=s("span"),v(oo.$$.fragment),Li=f(),gs=s("span"),Ii=i("FNetTokenizerFast"),Er=f(),A=s("div"),v(no.$$.fragment),Oi=f(),C=s("p"),Di=i("Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),_s=s("em"),Wi=i("tokenizers"),Ui=i(` library). Adapted from
`),gn=s("a"),Bi=i("AlbertTokenizerFast"),Hi=i(`. Based on
`),so=s("a"),Qi=i("Unigram"),Vi=i(`. This
tokenizer inherits from `),_n=s("a"),Ri=i("PreTrainedTokenizerFast"),Gi=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods`),Ji=f(),ae=s("div"),v(ro.$$.fragment),Ki=f(),bs=s("p"),Xi=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),Yi=f(),ao=s("ul"),bn=s("li"),Zi=i("single sequence: "),ks=s("code"),el=i("[CLS] X [SEP]"),tl=f(),kn=s("li"),ol=i("pair of sequences: "),vs=s("code"),nl=i("[CLS] A [SEP] B [SEP]"),sl=f(),B=s("div"),v(io.$$.fragment),rl=f(),ws=s("p"),al=i("Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet"),il=f(),v(Ge.$$.fragment),ll=f(),Fs=s("p"),cl=i("if token_ids_1 is None, only returns the first portion of the mask (0s)."),Pr=f(),be=s("h2"),Je=s("a"),$s=s("span"),v(lo.$$.fragment),dl=f(),Ts=s("span"),pl=i("FNetModel"),jr=f(),S=s("div"),v(co.$$.fragment),hl=f(),po=s("p"),fl=i(`The bare FNet Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ho=s("a"),ml=i("torch.nn.Module"),ul=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gl=f(),fo=s("p"),_l=i("The model can behave as an encoder, following the architecture described in "),mo=s("a"),bl=i(`FNet: Mixing Tokens with Fourier
Transforms`),kl=i(" by James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon."),vl=f(),H=s("div"),v(uo.$$.fragment),wl=f(),ke=s("p"),Fl=i("The "),vn=s("a"),$l=i("FNetModel"),Tl=i(" forward method, overrides the "),ys=s("code"),yl=i("__call__"),Nl=i(" special method."),zl=f(),v(Ke.$$.fragment),ql=f(),v(Xe.$$.fragment),Mr=f(),ve=s("h2"),Ye=s("a"),Ns=s("span"),v(go.$$.fragment),xl=f(),zs=s("span"),El=i("FNetForPreTraining"),Ar=f(),L=s("div"),v(_o.$$.fragment),Pl=f(),we=s("p"),jl=i("FNet Model with two heads on top as done during the pretraining: a "),qs=s("code"),Ml=i("masked language modeling"),Al=i(" head and a "),xs=s("code"),Cl=i("next sentence prediction (classification)"),Sl=i(" head."),Ll=f(),bo=s("p"),Il=i("This model is a PyTorch "),ko=s("a"),Ol=i("torch.nn.Module"),Dl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wl=f(),Q=s("div"),v(vo.$$.fragment),Ul=f(),Fe=s("p"),Bl=i("The "),wn=s("a"),Hl=i("FNetForPreTraining"),Ql=i(" forward method, overrides the "),Es=s("code"),Vl=i("__call__"),Rl=i(" special method."),Gl=f(),v(Ze.$$.fragment),Jl=f(),v(et.$$.fragment),Cr=f(),$e=s("h2"),tt=s("a"),Ps=s("span"),v(wo.$$.fragment),Kl=f(),js=s("span"),Xl=i("FNetForMaskedLM"),Sr=f(),oe=s("div"),v(Fo.$$.fragment),Yl=f(),Te=s("p"),Zl=i("FNet Model with a "),Ms=s("code"),ec=i("language modeling"),tc=i(` head on top.
This model is a PyTorch `),$o=s("a"),oc=i("torch.nn.Module"),nc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sc=f(),V=s("div"),v(To.$$.fragment),rc=f(),ye=s("p"),ac=i("The "),Fn=s("a"),ic=i("FNetForMaskedLM"),lc=i(" forward method, overrides the "),As=s("code"),cc=i("__call__"),dc=i(" special method."),pc=f(),v(ot.$$.fragment),hc=f(),v(nt.$$.fragment),Lr=f(),Ne=s("h2"),st=s("a"),Cs=s("span"),v(yo.$$.fragment),fc=f(),Ss=s("span"),mc=i("FNetForNextSentencePrediction"),Ir=f(),ne=s("div"),v(No.$$.fragment),uc=f(),ze=s("p"),gc=i("FNet Model with a "),Ls=s("code"),_c=i("next sentence prediction (classification)"),bc=i(` head on top.
This model is a PyTorch `),zo=s("a"),kc=i("torch.nn.Module"),vc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wc=f(),R=s("div"),v(qo.$$.fragment),Fc=f(),qe=s("p"),$c=i("The "),$n=s("a"),Tc=i("FNetForNextSentencePrediction"),yc=i(" forward method, overrides the "),Is=s("code"),Nc=i("__call__"),zc=i(" special method."),qc=f(),v(rt.$$.fragment),xc=f(),v(at.$$.fragment),Or=f(),xe=s("h2"),it=s("a"),Os=s("span"),v(xo.$$.fragment),Ec=f(),Ds=s("span"),Pc=i("FNetForSequenceClassification"),Dr=f(),I=s("div"),v(Eo.$$.fragment),jc=f(),Ws=s("p"),Mc=i(`FNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Ac=f(),Po=s("p"),Cc=i("This model is a PyTorch "),jo=s("a"),Sc=i("torch.nn.Module"),Lc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ic=f(),P=s("div"),v(Mo.$$.fragment),Oc=f(),Ee=s("p"),Dc=i("The "),Tn=s("a"),Wc=i("FNetForSequenceClassification"),Uc=i(" forward method, overrides the "),Us=s("code"),Bc=i("__call__"),Hc=i(" special method."),Qc=f(),v(lt.$$.fragment),Vc=f(),v(ct.$$.fragment),Rc=f(),v(dt.$$.fragment),Wr=f(),Pe=s("h2"),pt=s("a"),Bs=s("span"),v(Ao.$$.fragment),Gc=f(),Hs=s("span"),Jc=i("FNetForMultipleChoice"),Ur=f(),O=s("div"),v(Co.$$.fragment),Kc=f(),Qs=s("p"),Xc=i(`FNet 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.`),Yc=f(),So=s("p"),Zc=i("This model is a PyTorch "),Lo=s("a"),ed=i("torch.nn.Module"),td=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),od=f(),G=s("div"),v(Io.$$.fragment),nd=f(),je=s("p"),sd=i("The "),yn=s("a"),rd=i("FNetForMultipleChoice"),ad=i(" forward method, overrides the "),Vs=s("code"),id=i("__call__"),ld=i(" special method."),cd=f(),v(ht.$$.fragment),dd=f(),v(ft.$$.fragment),Br=f(),Me=s("h2"),mt=s("a"),Rs=s("span"),v(Oo.$$.fragment),pd=f(),Gs=s("span"),hd=i("FNetForTokenClassification"),Hr=f(),D=s("div"),v(Do.$$.fragment),fd=f(),Js=s("p"),md=i(`FNet 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.`),ud=f(),Wo=s("p"),gd=i("This model is a PyTorch "),Uo=s("a"),_d=i("torch.nn.Module"),bd=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),kd=f(),J=s("div"),v(Bo.$$.fragment),vd=f(),Ae=s("p"),wd=i("The "),Nn=s("a"),Fd=i("FNetForTokenClassification"),$d=i(" forward method, overrides the "),Ks=s("code"),Td=i("__call__"),yd=i(" special method."),Nd=f(),v(ut.$$.fragment),zd=f(),v(gt.$$.fragment),Qr=f(),Ce=s("h2"),_t=s("a"),Xs=s("span"),v(Ho.$$.fragment),qd=f(),Ys=s("span"),xd=i("FNetForQuestionAnswering"),Vr=f(),W=s("div"),v(Qo.$$.fragment),Ed=f(),Se=s("p"),Pd=i(`FNet 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 `),Zs=s("code"),jd=i("span start logits"),Md=i(" and "),er=s("code"),Ad=i("span end logits"),Cd=i(")."),Sd=f(),Vo=s("p"),Ld=i("This model is a PyTorch "),Ro=s("a"),Id=i("torch.nn.Module"),Od=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dd=f(),K=s("div"),v(Go.$$.fragment),Wd=f(),Le=s("p"),Ud=i("The "),zn=s("a"),Bd=i("FNetForQuestionAnswering"),Hd=i(" forward method, overrides the "),tr=s("code"),Qd=i("__call__"),Vd=i(" special method."),Rd=f(),v(bt.$$.fragment),Gd=f(),v(kt.$$.fragment),this.h()},l(t){const g=Xh('[data-svelte="svelte-1phssyn"]',document.head);c=r(g,"META",{name:!0,content:!0}),g.forEach(o),k=m(t),u=r(t,"H1",{class:!0});var Jo=a(u);p=r(Jo,"A",{id:!0,class:!0,href:!0});var or=a(p);_=r(or,"SPAN",{});var nr=a(_);w(n.$$.fragment,nr),nr.forEach(o),or.forEach(o),d=m(Jo),z=r(Jo,"SPAN",{});var sr=a(z);ga=l(sr,"FNet"),sr.forEach(o),Jo.forEach(o),_r=m(t),de=r(t,"H2",{class:!0});var Ko=a(de);Oe=r(Ko,"A",{id:!0,class:!0,href:!0});var rr=a(Oe);Rn=r(rr,"SPAN",{});var ar=a(Rn);w(Ot.$$.fragment,ar),ar.forEach(o),rr.forEach(o),_a=m(Ko),Gn=r(Ko,"SPAN",{});var ir=a(Gn);ba=l(ir,"Overview"),ir.forEach(o),Ko.forEach(o),br=m(t),De=r(t,"P",{});var Xo=a(De);ka=l(Xo,"The FNet model was proposed in "),Dt=r(Xo,"A",{href:!0,rel:!0});var lr=a(Dt);va=l(lr,"FNet: Mixing Tokens with Fourier Transforms"),lr.forEach(o),wa=l(Xo,` by
James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon. The model replaces the self-attention layer in a BERT
model with a fourier transform which returns only the real parts of the transform. The model is significantly faster
than the BERT model because it has fewer parameters and is more memory efficient. The model achieves about 92-97%
accuracy of BERT counterparts on GLUE benchmark, and trains much faster than the BERT model. The abstract from the
paper is the following:`),Xo.forEach(o),kr=m(t),Zo=r(t,"P",{});var cr=a(Zo);Jn=r(cr,"EM",{});var dr=a(Jn);Fa=l(dr,`We show that Transformer encoder architectures can be sped up, with limited accuracy costs, by replacing the
self-attention sublayers with simple linear transformations that \u201Cmix\u201D input tokens. These linear mixers, along with
standard nonlinearities in feed-forward layers, prove competent at modeling semantic relationships in several text
classification tasks. Most surprisingly, we find that replacing the self-attention sublayer in a Transformer encoder
with a standard, unparameterized Fourier Transform achieves 92-97% of the accuracy of BERT counterparts on the GLUE
benchmark, but trains 80% faster on GPUs and 70% faster on TPUs at standard 512 input lengths. At longer input lengths,
our FNet model is significantly faster: when compared to the \u201Cefficient\u201D Transformers on the Long Range Arena
benchmark, FNet matches the accuracy of the most accurate models, while outpacing the fastest models across all
sequence lengths on GPUs (and across relatively shorter lengths on TPUs). Finally, FNet has a light memory footprint
and is particularly efficient at smaller model sizes; for a fixed speed and accuracy budget, small FNet models
outperform Transformer counterparts.`),dr.forEach(o),cr.forEach(o),vr=m(t),en=r(t,"P",{});var pr=a(en);$a=l(pr,"Tips on usage:"),pr.forEach(o),wr=m(t),tn=r(t,"UL",{});var hr=a(tn);Kn=r(hr,"LI",{});var fr=a(Kn);Ta=l(fr,`The model was trained without an attention mask as it is based on Fourier Transform. The model was trained with
maximum sequence length 512 which includes pad tokens. Hence, it is highly recommended to use the same maximum
sequence length for fine-tuning and inference.`),fr.forEach(o),hr.forEach(o),Fr=m(t),se=r(t,"P",{});var Ie=a(se);ya=l(Ie,"This model was contributed by "),Wt=r(Ie,"A",{href:!0,rel:!0});var mr=a(Wt);Na=l(mr,"gchhablani"),mr.forEach(o),za=l(Ie,". The original code can be found "),Ut=r(Ie,"A",{href:!0,rel:!0});var ur=a(Ut);qa=l(ur,"here"),ur.forEach(o),xa=l(Ie,"."),Ie.forEach(o),$r=m(t),pe=r(t,"H2",{class:!0});var Yo=a(pe);We=r(Yo,"A",{id:!0,class:!0,href:!0});var gr=a(We);Xn=r(gr,"SPAN",{});var Zd=a(Xn);w(Bt.$$.fragment,Zd),Zd.forEach(o),gr.forEach(o),Ea=m(Yo),Yn=r(Yo,"SPAN",{});var ep=a(Yn);Pa=l(ep,"Documentation resources"),ep.forEach(o),Yo.forEach(o),Tr=m(t),E=r(t,"UL",{});var ie=a(E);Zn=r(ie,"LI",{});var tp=a(Zn);on=r(tp,"A",{href:!0});var op=a(on);ja=l(op,"Text classification task guide"),op.forEach(o),tp.forEach(o),Ma=m(ie),es=r(ie,"LI",{});var np=a(es);nn=r(np,"A",{href:!0});var sp=a(nn);Aa=l(sp,"Token classification task guide"),sp.forEach(o),np.forEach(o),Ca=m(ie),ts=r(ie,"LI",{});var rp=a(ts);sn=r(rp,"A",{href:!0});var ap=a(sn);Sa=l(ap,"Question answering task guide"),ap.forEach(o),rp.forEach(o),La=m(ie),os=r(ie,"LI",{});var ip=a(os);rn=r(ip,"A",{href:!0});var lp=a(rn);Ia=l(lp,"Masked language modeling task guide"),lp.forEach(o),ip.forEach(o),Oa=m(ie),ns=r(ie,"LI",{});var cp=a(ns);an=r(cp,"A",{href:!0});var dp=a(an);Da=l(dp,"Multiple choice task guide"),dp.forEach(o),cp.forEach(o),ie.forEach(o),yr=m(t),he=r(t,"H2",{class:!0});var Gr=a(he);Ue=r(Gr,"A",{id:!0,class:!0,href:!0});var pp=a(Ue);ss=r(pp,"SPAN",{});var hp=a(ss);w(Ht.$$.fragment,hp),hp.forEach(o),pp.forEach(o),Wa=m(Gr),rs=r(Gr,"SPAN",{});var fp=a(rs);Ua=l(fp,"FNetConfig"),fp.forEach(o),Gr.forEach(o),Nr=m(t),M=r(t,"DIV",{class:!0});var vt=a(M);w(Qt.$$.fragment,vt),Ba=m(vt),fe=r(vt,"P",{});var qn=a(fe);Ha=l(qn,"This is the configuration class to store the configuration of a "),ln=r(qn,"A",{href:!0});var mp=a(ln);Qa=l(mp,"FNetModel"),mp.forEach(o),Va=l(qn,`. It is used to instantiate an FNet
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 FNet
`),Vt=r(qn,"A",{href:!0,rel:!0});var up=a(Vt);Ra=l(up,"google/fnet-base"),up.forEach(o),Ga=l(qn," architecture."),qn.forEach(o),Ja=m(vt),me=r(vt,"P",{});var xn=a(me);Ka=l(xn,"Configuration objects inherit from "),cn=r(xn,"A",{href:!0});var gp=a(cn);Xa=l(gp,"PretrainedConfig"),gp.forEach(o),Ya=l(xn,` and can be used to control the model outputs. Read the
documentation from `),dn=r(xn,"A",{href:!0});var _p=a(dn);Za=l(_p,"PretrainedConfig"),_p.forEach(o),ei=l(xn," for more information."),xn.forEach(o),ti=m(vt),w(Be.$$.fragment,vt),vt.forEach(o),zr=m(t),ue=r(t,"H2",{class:!0});var Jr=a(ue);He=r(Jr,"A",{id:!0,class:!0,href:!0});var bp=a(He);as=r(bp,"SPAN",{});var kp=a(as);w(Rt.$$.fragment,kp),kp.forEach(o),bp.forEach(o),oi=m(Jr),is=r(Jr,"SPAN",{});var vp=a(is);ni=l(vp,"FNetTokenizer"),vp.forEach(o),Jr.forEach(o),qr=m(t),x=r(t,"DIV",{class:!0});var X=a(x);w(Gt.$$.fragment,X),si=m(X),te=r(X,"P",{});var wt=a(te);ri=l(wt,"Construct an FNet tokenizer. Adapted from "),pn=r(wt,"A",{href:!0});var wp=a(pn);ai=l(wp,"AlbertTokenizer"),wp.forEach(o),ii=l(wt,`. Based on
`),Jt=r(wt,"A",{href:!0,rel:!0});var Fp=a(Jt);li=l(Fp,"SentencePiece"),Fp.forEach(o),ci=l(wt,". This tokenizer inherits from "),hn=r(wt,"A",{href:!0});var $p=a(hn);di=l($p,"PreTrainedTokenizer"),$p.forEach(o),pi=l(wt,`
which contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.`),wt.forEach(o),hi=m(X),re=r(X,"DIV",{class:!0});var En=a(re);w(Kt.$$.fragment,En),fi=m(En),ls=r(En,"P",{});var Tp=a(ls);mi=l(Tp,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),Tp.forEach(o),ui=m(En),Xt=r(En,"UL",{});var Kr=a(Xt);fn=r(Kr,"LI",{});var Jd=a(fn);gi=l(Jd,"single sequence: "),cs=r(Jd,"CODE",{});var yp=a(cs);_i=l(yp,"[CLS] X [SEP]"),yp.forEach(o),Jd.forEach(o),bi=m(Kr),mn=r(Kr,"LI",{});var Kd=a(mn);ki=l(Kd,"pair of sequences: "),ds=r(Kd,"CODE",{});var Np=a(ds);vi=l(Np,"[CLS] A [SEP] B [SEP]"),Np.forEach(o),Kd.forEach(o),Kr.forEach(o),En.forEach(o),wi=m(X),Qe=r(X,"DIV",{class:!0});var Xr=a(Qe);w(Yt.$$.fragment,Xr),Fi=m(Xr),Zt=r(Xr,"P",{});var Yr=a(Zt);$i=l(Yr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),ps=r(Yr,"CODE",{});var zp=a(ps);Ti=l(zp,"prepare_for_model"),zp.forEach(o),yi=l(Yr," method."),Yr.forEach(o),Xr.forEach(o),Ni=m(X),U=r(X,"DIV",{class:!0});var Ft=a(U);w(eo.$$.fragment,Ft),zi=m(Ft),hs=r(Ft,"P",{});var qp=a(hs);qi=l(qp,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet sequence"),qp.forEach(o),xi=m(Ft),w(Ve.$$.fragment,Ft),Ei=m(Ft),ge=r(Ft,"P",{});var Pn=a(ge);Pi=l(Pn,"If "),fs=r(Pn,"CODE",{});var xp=a(fs);ji=l(xp,"token_ids_1"),xp.forEach(o),Mi=l(Pn," is "),ms=r(Pn,"CODE",{});var Ep=a(ms);Ai=l(Ep,"None"),Ep.forEach(o),Ci=l(Pn,", this method only returns the first portion of the mask (0s)."),Pn.forEach(o),Ft.forEach(o),Si=m(X),un=r(X,"DIV",{class:!0});var Pp=a(un);w(to.$$.fragment,Pp),Pp.forEach(o),X.forEach(o),xr=m(t),_e=r(t,"H2",{class:!0});var Zr=a(_e);Re=r(Zr,"A",{id:!0,class:!0,href:!0});var jp=a(Re);us=r(jp,"SPAN",{});var Mp=a(us);w(oo.$$.fragment,Mp),Mp.forEach(o),jp.forEach(o),Li=m(Zr),gs=r(Zr,"SPAN",{});var Ap=a(gs);Ii=l(Ap,"FNetTokenizerFast"),Ap.forEach(o),Zr.forEach(o),Er=m(t),A=r(t,"DIV",{class:!0});var $t=a(A);w(no.$$.fragment,$t),Oi=m($t),C=r($t,"P",{});var le=a(C);Di=l(le,"Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),_s=r(le,"EM",{});var Cp=a(_s);Wi=l(Cp,"tokenizers"),Cp.forEach(o),Ui=l(le,` library). Adapted from
`),gn=r(le,"A",{href:!0});var Sp=a(gn);Bi=l(Sp,"AlbertTokenizerFast"),Sp.forEach(o),Hi=l(le,`. Based on
`),so=r(le,"A",{href:!0,rel:!0});var Lp=a(so);Qi=l(Lp,"Unigram"),Lp.forEach(o),Vi=l(le,`. This
tokenizer inherits from `),_n=r(le,"A",{href:!0});var Ip=a(_n);Ri=l(Ip,"PreTrainedTokenizerFast"),Ip.forEach(o),Gi=l(le,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods`),le.forEach(o),Ji=m($t),ae=r($t,"DIV",{class:!0});var jn=a(ae);w(ro.$$.fragment,jn),Ki=m(jn),bs=r(jn,"P",{});var Op=a(bs);Xi=l(Op,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),Op.forEach(o),Yi=m(jn),ao=r(jn,"UL",{});var ea=a(ao);bn=r(ea,"LI",{});var Xd=a(bn);Zi=l(Xd,"single sequence: "),ks=r(Xd,"CODE",{});var Dp=a(ks);el=l(Dp,"[CLS] X [SEP]"),Dp.forEach(o),Xd.forEach(o),tl=m(ea),kn=r(ea,"LI",{});var Yd=a(kn);ol=l(Yd,"pair of sequences: "),vs=r(Yd,"CODE",{});var Wp=a(vs);nl=l(Wp,"[CLS] A [SEP] B [SEP]"),Wp.forEach(o),Yd.forEach(o),ea.forEach(o),jn.forEach(o),sl=m($t),B=r($t,"DIV",{class:!0});var Tt=a(B);w(io.$$.fragment,Tt),rl=m(Tt),ws=r(Tt,"P",{});var Up=a(ws);al=l(Up,"Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet"),Up.forEach(o),il=m(Tt),w(Ge.$$.fragment,Tt),ll=m(Tt),Fs=r(Tt,"P",{});var Bp=a(Fs);cl=l(Bp,"if token_ids_1 is None, only returns the first portion of the mask (0s)."),Bp.forEach(o),Tt.forEach(o),$t.forEach(o),Pr=m(t),be=r(t,"H2",{class:!0});var ta=a(be);Je=r(ta,"A",{id:!0,class:!0,href:!0});var Hp=a(Je);$s=r(Hp,"SPAN",{});var Qp=a($s);w(lo.$$.fragment,Qp),Qp.forEach(o),Hp.forEach(o),dl=m(ta),Ts=r(ta,"SPAN",{});var Vp=a(Ts);pl=l(Vp,"FNetModel"),Vp.forEach(o),ta.forEach(o),jr=m(t),S=r(t,"DIV",{class:!0});var yt=a(S);w(co.$$.fragment,yt),hl=m(yt),po=r(yt,"P",{});var oa=a(po);fl=l(oa,`The bare FNet Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ho=r(oa,"A",{href:!0,rel:!0});var Rp=a(ho);ml=l(Rp,"torch.nn.Module"),Rp.forEach(o),ul=l(oa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),oa.forEach(o),gl=m(yt),fo=r(yt,"P",{});var na=a(fo);_l=l(na,"The model can behave as an encoder, following the architecture described in "),mo=r(na,"A",{href:!0,rel:!0});var Gp=a(mo);bl=l(Gp,`FNet: Mixing Tokens with Fourier
Transforms`),Gp.forEach(o),kl=l(na," by James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon."),na.forEach(o),vl=m(yt),H=r(yt,"DIV",{class:!0});var Nt=a(H);w(uo.$$.fragment,Nt),wl=m(Nt),ke=r(Nt,"P",{});var Mn=a(ke);Fl=l(Mn,"The "),vn=r(Mn,"A",{href:!0});var Jp=a(vn);$l=l(Jp,"FNetModel"),Jp.forEach(o),Tl=l(Mn," forward method, overrides the "),ys=r(Mn,"CODE",{});var Kp=a(ys);yl=l(Kp,"__call__"),Kp.forEach(o),Nl=l(Mn," special method."),Mn.forEach(o),zl=m(Nt),w(Ke.$$.fragment,Nt),ql=m(Nt),w(Xe.$$.fragment,Nt),Nt.forEach(o),yt.forEach(o),Mr=m(t),ve=r(t,"H2",{class:!0});var sa=a(ve);Ye=r(sa,"A",{id:!0,class:!0,href:!0});var Xp=a(Ye);Ns=r(Xp,"SPAN",{});var Yp=a(Ns);w(go.$$.fragment,Yp),Yp.forEach(o),Xp.forEach(o),xl=m(sa),zs=r(sa,"SPAN",{});var Zp=a(zs);El=l(Zp,"FNetForPreTraining"),Zp.forEach(o),sa.forEach(o),Ar=m(t),L=r(t,"DIV",{class:!0});var zt=a(L);w(_o.$$.fragment,zt),Pl=m(zt),we=r(zt,"P",{});var An=a(we);jl=l(An,"FNet Model with two heads on top as done during the pretraining: a "),qs=r(An,"CODE",{});var eh=a(qs);Ml=l(eh,"masked language modeling"),eh.forEach(o),Al=l(An," head and a "),xs=r(An,"CODE",{});var th=a(xs);Cl=l(th,"next sentence prediction (classification)"),th.forEach(o),Sl=l(An," head."),An.forEach(o),Ll=m(zt),bo=r(zt,"P",{});var ra=a(bo);Il=l(ra,"This model is a PyTorch "),ko=r(ra,"A",{href:!0,rel:!0});var oh=a(ko);Ol=l(oh,"torch.nn.Module"),oh.forEach(o),Dl=l(ra,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ra.forEach(o),Wl=m(zt),Q=r(zt,"DIV",{class:!0});var qt=a(Q);w(vo.$$.fragment,qt),Ul=m(qt),Fe=r(qt,"P",{});var Cn=a(Fe);Bl=l(Cn,"The "),wn=r(Cn,"A",{href:!0});var nh=a(wn);Hl=l(nh,"FNetForPreTraining"),nh.forEach(o),Ql=l(Cn," forward method, overrides the "),Es=r(Cn,"CODE",{});var sh=a(Es);Vl=l(sh,"__call__"),sh.forEach(o),Rl=l(Cn," special method."),Cn.forEach(o),Gl=m(qt),w(Ze.$$.fragment,qt),Jl=m(qt),w(et.$$.fragment,qt),qt.forEach(o),zt.forEach(o),Cr=m(t),$e=r(t,"H2",{class:!0});var aa=a($e);tt=r(aa,"A",{id:!0,class:!0,href:!0});var rh=a(tt);Ps=r(rh,"SPAN",{});var ah=a(Ps);w(wo.$$.fragment,ah),ah.forEach(o),rh.forEach(o),Kl=m(aa),js=r(aa,"SPAN",{});var ih=a(js);Xl=l(ih,"FNetForMaskedLM"),ih.forEach(o),aa.forEach(o),Sr=m(t),oe=r(t,"DIV",{class:!0});var Sn=a(oe);w(Fo.$$.fragment,Sn),Yl=m(Sn),Te=r(Sn,"P",{});var Ln=a(Te);Zl=l(Ln,"FNet Model with a "),Ms=r(Ln,"CODE",{});var lh=a(Ms);ec=l(lh,"language modeling"),lh.forEach(o),tc=l(Ln,` head on top.
This model is a PyTorch `),$o=r(Ln,"A",{href:!0,rel:!0});var ch=a($o);oc=l(ch,"torch.nn.Module"),ch.forEach(o),nc=l(Ln,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ln.forEach(o),sc=m(Sn),V=r(Sn,"DIV",{class:!0});var xt=a(V);w(To.$$.fragment,xt),rc=m(xt),ye=r(xt,"P",{});var In=a(ye);ac=l(In,"The "),Fn=r(In,"A",{href:!0});var dh=a(Fn);ic=l(dh,"FNetForMaskedLM"),dh.forEach(o),lc=l(In," forward method, overrides the "),As=r(In,"CODE",{});var ph=a(As);cc=l(ph,"__call__"),ph.forEach(o),dc=l(In," special method."),In.forEach(o),pc=m(xt),w(ot.$$.fragment,xt),hc=m(xt),w(nt.$$.fragment,xt),xt.forEach(o),Sn.forEach(o),Lr=m(t),Ne=r(t,"H2",{class:!0});var ia=a(Ne);st=r(ia,"A",{id:!0,class:!0,href:!0});var hh=a(st);Cs=r(hh,"SPAN",{});var fh=a(Cs);w(yo.$$.fragment,fh),fh.forEach(o),hh.forEach(o),fc=m(ia),Ss=r(ia,"SPAN",{});var mh=a(Ss);mc=l(mh,"FNetForNextSentencePrediction"),mh.forEach(o),ia.forEach(o),Ir=m(t),ne=r(t,"DIV",{class:!0});var On=a(ne);w(No.$$.fragment,On),uc=m(On),ze=r(On,"P",{});var Dn=a(ze);gc=l(Dn,"FNet Model with a "),Ls=r(Dn,"CODE",{});var uh=a(Ls);_c=l(uh,"next sentence prediction (classification)"),uh.forEach(o),bc=l(Dn,` head on top.
This model is a PyTorch `),zo=r(Dn,"A",{href:!0,rel:!0});var gh=a(zo);kc=l(gh,"torch.nn.Module"),gh.forEach(o),vc=l(Dn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dn.forEach(o),wc=m(On),R=r(On,"DIV",{class:!0});var Et=a(R);w(qo.$$.fragment,Et),Fc=m(Et),qe=r(Et,"P",{});var Wn=a(qe);$c=l(Wn,"The "),$n=r(Wn,"A",{href:!0});var _h=a($n);Tc=l(_h,"FNetForNextSentencePrediction"),_h.forEach(o),yc=l(Wn," forward method, overrides the "),Is=r(Wn,"CODE",{});var bh=a(Is);Nc=l(bh,"__call__"),bh.forEach(o),zc=l(Wn," special method."),Wn.forEach(o),qc=m(Et),w(rt.$$.fragment,Et),xc=m(Et),w(at.$$.fragment,Et),Et.forEach(o),On.forEach(o),Or=m(t),xe=r(t,"H2",{class:!0});var la=a(xe);it=r(la,"A",{id:!0,class:!0,href:!0});var kh=a(it);Os=r(kh,"SPAN",{});var vh=a(Os);w(xo.$$.fragment,vh),vh.forEach(o),kh.forEach(o),Ec=m(la),Ds=r(la,"SPAN",{});var wh=a(Ds);Pc=l(wh,"FNetForSequenceClassification"),wh.forEach(o),la.forEach(o),Dr=m(t),I=r(t,"DIV",{class:!0});var Pt=a(I);w(Eo.$$.fragment,Pt),jc=m(Pt),Ws=r(Pt,"P",{});var Fh=a(Ws);Mc=l(Fh,`FNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Fh.forEach(o),Ac=m(Pt),Po=r(Pt,"P",{});var ca=a(Po);Cc=l(ca,"This model is a PyTorch "),jo=r(ca,"A",{href:!0,rel:!0});var $h=a(jo);Sc=l($h,"torch.nn.Module"),$h.forEach(o),Lc=l(ca,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ca.forEach(o),Ic=m(Pt),P=r(Pt,"DIV",{class:!0});var ce=a(P);w(Mo.$$.fragment,ce),Oc=m(ce),Ee=r(ce,"P",{});var Un=a(Ee);Dc=l(Un,"The "),Tn=r(Un,"A",{href:!0});var Th=a(Tn);Wc=l(Th,"FNetForSequenceClassification"),Th.forEach(o),Uc=l(Un," forward method, overrides the "),Us=r(Un,"CODE",{});var yh=a(Us);Bc=l(yh,"__call__"),yh.forEach(o),Hc=l(Un," special method."),Un.forEach(o),Qc=m(ce),w(lt.$$.fragment,ce),Vc=m(ce),w(ct.$$.fragment,ce),Rc=m(ce),w(dt.$$.fragment,ce),ce.forEach(o),Pt.forEach(o),Wr=m(t),Pe=r(t,"H2",{class:!0});var da=a(Pe);pt=r(da,"A",{id:!0,class:!0,href:!0});var Nh=a(pt);Bs=r(Nh,"SPAN",{});var zh=a(Bs);w(Ao.$$.fragment,zh),zh.forEach(o),Nh.forEach(o),Gc=m(da),Hs=r(da,"SPAN",{});var qh=a(Hs);Jc=l(qh,"FNetForMultipleChoice"),qh.forEach(o),da.forEach(o),Ur=m(t),O=r(t,"DIV",{class:!0});var jt=a(O);w(Co.$$.fragment,jt),Kc=m(jt),Qs=r(jt,"P",{});var xh=a(Qs);Xc=l(xh,`FNet 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.`),xh.forEach(o),Yc=m(jt),So=r(jt,"P",{});var pa=a(So);Zc=l(pa,"This model is a PyTorch "),Lo=r(pa,"A",{href:!0,rel:!0});var Eh=a(Lo);ed=l(Eh,"torch.nn.Module"),Eh.forEach(o),td=l(pa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pa.forEach(o),od=m(jt),G=r(jt,"DIV",{class:!0});var Mt=a(G);w(Io.$$.fragment,Mt),nd=m(Mt),je=r(Mt,"P",{});var Bn=a(je);sd=l(Bn,"The "),yn=r(Bn,"A",{href:!0});var Ph=a(yn);rd=l(Ph,"FNetForMultipleChoice"),Ph.forEach(o),ad=l(Bn," forward method, overrides the "),Vs=r(Bn,"CODE",{});var jh=a(Vs);id=l(jh,"__call__"),jh.forEach(o),ld=l(Bn," special method."),Bn.forEach(o),cd=m(Mt),w(ht.$$.fragment,Mt),dd=m(Mt),w(ft.$$.fragment,Mt),Mt.forEach(o),jt.forEach(o),Br=m(t),Me=r(t,"H2",{class:!0});var ha=a(Me);mt=r(ha,"A",{id:!0,class:!0,href:!0});var Mh=a(mt);Rs=r(Mh,"SPAN",{});var Ah=a(Rs);w(Oo.$$.fragment,Ah),Ah.forEach(o),Mh.forEach(o),pd=m(ha),Gs=r(ha,"SPAN",{});var Ch=a(Gs);hd=l(Ch,"FNetForTokenClassification"),Ch.forEach(o),ha.forEach(o),Hr=m(t),D=r(t,"DIV",{class:!0});var At=a(D);w(Do.$$.fragment,At),fd=m(At),Js=r(At,"P",{});var Sh=a(Js);md=l(Sh,`FNet 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.`),Sh.forEach(o),ud=m(At),Wo=r(At,"P",{});var fa=a(Wo);gd=l(fa,"This model is a PyTorch "),Uo=r(fa,"A",{href:!0,rel:!0});var Lh=a(Uo);_d=l(Lh,"torch.nn.Module"),Lh.forEach(o),bd=l(fa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fa.forEach(o),kd=m(At),J=r(At,"DIV",{class:!0});var Ct=a(J);w(Bo.$$.fragment,Ct),vd=m(Ct),Ae=r(Ct,"P",{});var Hn=a(Ae);wd=l(Hn,"The "),Nn=r(Hn,"A",{href:!0});var Ih=a(Nn);Fd=l(Ih,"FNetForTokenClassification"),Ih.forEach(o),$d=l(Hn," forward method, overrides the "),Ks=r(Hn,"CODE",{});var Oh=a(Ks);Td=l(Oh,"__call__"),Oh.forEach(o),yd=l(Hn," special method."),Hn.forEach(o),Nd=m(Ct),w(ut.$$.fragment,Ct),zd=m(Ct),w(gt.$$.fragment,Ct),Ct.forEach(o),At.forEach(o),Qr=m(t),Ce=r(t,"H2",{class:!0});var ma=a(Ce);_t=r(ma,"A",{id:!0,class:!0,href:!0});var Dh=a(_t);Xs=r(Dh,"SPAN",{});var Wh=a(Xs);w(Ho.$$.fragment,Wh),Wh.forEach(o),Dh.forEach(o),qd=m(ma),Ys=r(ma,"SPAN",{});var Uh=a(Ys);xd=l(Uh,"FNetForQuestionAnswering"),Uh.forEach(o),ma.forEach(o),Vr=m(t),W=r(t,"DIV",{class:!0});var St=a(W);w(Qo.$$.fragment,St),Ed=m(St),Se=r(St,"P",{});var Qn=a(Se);Pd=l(Qn,`FNet 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 `),Zs=r(Qn,"CODE",{});var Bh=a(Zs);jd=l(Bh,"span start logits"),Bh.forEach(o),Md=l(Qn," and "),er=r(Qn,"CODE",{});var Hh=a(er);Ad=l(Hh,"span end logits"),Hh.forEach(o),Cd=l(Qn,")."),Qn.forEach(o),Sd=m(St),Vo=r(St,"P",{});var ua=a(Vo);Ld=l(ua,"This model is a PyTorch "),Ro=r(ua,"A",{href:!0,rel:!0});var Qh=a(Ro);Id=l(Qh,"torch.nn.Module"),Qh.forEach(o),Od=l(ua,` 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.forEach(o),Dd=m(St),K=r(St,"DIV",{class:!0});var Lt=a(K);w(Go.$$.fragment,Lt),Wd=m(Lt),Le=r(Lt,"P",{});var Vn=a(Le);Ud=l(Vn,"The "),zn=r(Vn,"A",{href:!0});var Vh=a(zn);Bd=l(Vh,"FNetForQuestionAnswering"),Vh.forEach(o),Hd=l(Vn," forward method, overrides the "),tr=r(Vn,"CODE",{});var Rh=a(tr);Qd=l(Rh,"__call__"),Rh.forEach(o),Vd=l(Vn," special method."),Vn.forEach(o),Rd=m(Lt),w(bt.$$.fragment,Lt),Gd=m(Lt),w(kt.$$.fragment,Lt),Lt.forEach(o),St.forEach(o),this.h()},h(){h(c,"name","hf:doc:metadata"),h(c,"content",JSON.stringify(wf)),h(p,"id","fnet"),h(p,"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"),h(p,"href","#fnet"),h(u,"class","relative group"),h(Oe,"id","overview"),h(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Oe,"href","#overview"),h(de,"class","relative group"),h(Dt,"href","https://arxiv.org/abs/2105.03824"),h(Dt,"rel","nofollow"),h(Wt,"href","https://huggingface.co/gchhablani"),h(Wt,"rel","nofollow"),h(Ut,"href","https://github.com/google-research/google-research/tree/master/f_net"),h(Ut,"rel","nofollow"),h(We,"id","documentation-resources"),h(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(We,"href","#documentation-resources"),h(pe,"class","relative group"),h(on,"href","../tasks/sequence_classification"),h(nn,"href","../tasks/token_classification"),h(sn,"href","../tasks/question_answering"),h(rn,"href","../tasks/masked_language_modeling"),h(an,"href","../tasks/multiple_choice"),h(Ue,"id","transformers.FNetConfig"),h(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"),h(Ue,"href","#transformers.FNetConfig"),h(he,"class","relative group"),h(ln,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetModel"),h(Vt,"href","https://huggingface.co/google/fnet-base"),h(Vt,"rel","nofollow"),h(cn,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(dn,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(He,"id","transformers.FNetTokenizer"),h(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"),h(He,"href","#transformers.FNetTokenizer"),h(ue,"class","relative group"),h(pn,"href","/docs/transformers/v4.29.0/en/model_doc/albert#transformers.AlbertTokenizer"),h(Jt,"href","https://github.com/google/sentencepiece"),h(Jt,"rel","nofollow"),h(hn,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Re,"id","transformers.FNetTokenizerFast"),h(Re,"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"),h(Re,"href","#transformers.FNetTokenizerFast"),h(_e,"class","relative group"),h(gn,"href","/docs/transformers/v4.29.0/en/model_doc/albert#transformers.AlbertTokenizerFast"),h(so,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),h(so,"rel","nofollow"),h(_n,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Je,"id","transformers.FNetModel"),h(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Je,"href","#transformers.FNetModel"),h(be,"class","relative group"),h(ho,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(ho,"rel","nofollow"),h(mo,"href","https://arxiv.org/abs/2105.03824"),h(mo,"rel","nofollow"),h(vn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetModel"),h(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ye,"id","transformers.FNetForPreTraining"),h(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ye,"href","#transformers.FNetForPreTraining"),h(ve,"class","relative group"),h(ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(ko,"rel","nofollow"),h(wn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForPreTraining"),h(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(tt,"id","transformers.FNetForMaskedLM"),h(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(tt,"href","#transformers.FNetForMaskedLM"),h($e,"class","relative group"),h($o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h($o,"rel","nofollow"),h(Fn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForMaskedLM"),h(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(st,"id","transformers.FNetForNextSentencePrediction"),h(st,"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"),h(st,"href","#transformers.FNetForNextSentencePrediction"),h(Ne,"class","relative group"),h(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(zo,"rel","nofollow"),h($n,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForNextSentencePrediction"),h(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(it,"id","transformers.FNetForSequenceClassification"),h(it,"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"),h(it,"href","#transformers.FNetForSequenceClassification"),h(xe,"class","relative group"),h(jo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(jo,"rel","nofollow"),h(Tn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForSequenceClassification"),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"id","transformers.FNetForMultipleChoice"),h(pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(pt,"href","#transformers.FNetForMultipleChoice"),h(Pe,"class","relative group"),h(Lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Lo,"rel","nofollow"),h(yn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForMultipleChoice"),h(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(mt,"id","transformers.FNetForTokenClassification"),h(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(mt,"href","#transformers.FNetForTokenClassification"),h(Me,"class","relative group"),h(Uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Uo,"rel","nofollow"),h(Nn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForTokenClassification"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_t,"id","transformers.FNetForQuestionAnswering"),h(_t,"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"),h(_t,"href","#transformers.FNetForQuestionAnswering"),h(Ce,"class","relative group"),h(Ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ro,"rel","nofollow"),h(zn,"href","/docs/transformers/v4.29.0/en/model_doc/fnet#transformers.FNetForQuestionAnswering"),h(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,c),b(t,k,g),b(t,u,g),e(u,p),e(p,_),F(n,_,null),e(u,d),e(u,z),e(z,ga),b(t,_r,g),b(t,de,g),e(de,Oe),e(Oe,Rn),F(Ot,Rn,null),e(de,_a),e(de,Gn),e(Gn,ba),b(t,br,g),b(t,De,g),e(De,ka),e(De,Dt),e(Dt,va),e(De,wa),b(t,kr,g),b(t,Zo,g),e(Zo,Jn),e(Jn,Fa),b(t,vr,g),b(t,en,g),e(en,$a),b(t,wr,g),b(t,tn,g),e(tn,Kn),e(Kn,Ta),b(t,Fr,g),b(t,se,g),e(se,ya),e(se,Wt),e(Wt,Na),e(se,za),e(se,Ut),e(Ut,qa),e(se,xa),b(t,$r,g),b(t,pe,g),e(pe,We),e(We,Xn),F(Bt,Xn,null),e(pe,Ea),e(pe,Yn),e(Yn,Pa),b(t,Tr,g),b(t,E,g),e(E,Zn),e(Zn,on),e(on,ja),e(E,Ma),e(E,es),e(es,nn),e(nn,Aa),e(E,Ca),e(E,ts),e(ts,sn),e(sn,Sa),e(E,La),e(E,os),e(os,rn),e(rn,Ia),e(E,Oa),e(E,ns),e(ns,an),e(an,Da),b(t,yr,g),b(t,he,g),e(he,Ue),e(Ue,ss),F(Ht,ss,null),e(he,Wa),e(he,rs),e(rs,Ua),b(t,Nr,g),b(t,M,g),F(Qt,M,null),e(M,Ba),e(M,fe),e(fe,Ha),e(fe,ln),e(ln,Qa),e(fe,Va),e(fe,Vt),e(Vt,Ra),e(fe,Ga),e(M,Ja),e(M,me),e(me,Ka),e(me,cn),e(cn,Xa),e(me,Ya),e(me,dn),e(dn,Za),e(me,ei),e(M,ti),F(Be,M,null),b(t,zr,g),b(t,ue,g),e(ue,He),e(He,as),F(Rt,as,null),e(ue,oi),e(ue,is),e(is,ni),b(t,qr,g),b(t,x,g),F(Gt,x,null),e(x,si),e(x,te),e(te,ri),e(te,pn),e(pn,ai),e(te,ii),e(te,Jt),e(Jt,li),e(te,ci),e(te,hn),e(hn,di),e(te,pi),e(x,hi),e(x,re),F(Kt,re,null),e(re,fi),e(re,ls),e(ls,mi),e(re,ui),e(re,Xt),e(Xt,fn),e(fn,gi),e(fn,cs),e(cs,_i),e(Xt,bi),e(Xt,mn),e(mn,ki),e(mn,ds),e(ds,vi),e(x,wi),e(x,Qe),F(Yt,Qe,null),e(Qe,Fi),e(Qe,Zt),e(Zt,$i),e(Zt,ps),e(ps,Ti),e(Zt,yi),e(x,Ni),e(x,U),F(eo,U,null),e(U,zi),e(U,hs),e(hs,qi),e(U,xi),F(Ve,U,null),e(U,Ei),e(U,ge),e(ge,Pi),e(ge,fs),e(fs,ji),e(ge,Mi),e(ge,ms),e(ms,Ai),e(ge,Ci),e(x,Si),e(x,un),F(to,un,null),b(t,xr,g),b(t,_e,g),e(_e,Re),e(Re,us),F(oo,us,null),e(_e,Li),e(_e,gs),e(gs,Ii),b(t,Er,g),b(t,A,g),F(no,A,null),e(A,Oi),e(A,C),e(C,Di),e(C,_s),e(_s,Wi),e(C,Ui),e(C,gn),e(gn,Bi),e(C,Hi),e(C,so),e(so,Qi),e(C,Vi),e(C,_n),e(_n,Ri),e(C,Gi),e(A,Ji),e(A,ae),F(ro,ae,null),e(ae,Ki),e(ae,bs),e(bs,Xi),e(ae,Yi),e(ae,ao),e(ao,bn),e(bn,Zi),e(bn,ks),e(ks,el),e(ao,tl),e(ao,kn),e(kn,ol),e(kn,vs),e(vs,nl),e(A,sl),e(A,B),F(io,B,null),e(B,rl),e(B,ws),e(ws,al),e(B,il),F(Ge,B,null),e(B,ll),e(B,Fs),e(Fs,cl),b(t,Pr,g),b(t,be,g),e(be,Je),e(Je,$s),F(lo,$s,null),e(be,dl),e(be,Ts),e(Ts,pl),b(t,jr,g),b(t,S,g),F(co,S,null),e(S,hl),e(S,po),e(po,fl),e(po,ho),e(ho,ml),e(po,ul),e(S,gl),e(S,fo),e(fo,_l),e(fo,mo),e(mo,bl),e(fo,kl),e(S,vl),e(S,H),F(uo,H,null),e(H,wl),e(H,ke),e(ke,Fl),e(ke,vn),e(vn,$l),e(ke,Tl),e(ke,ys),e(ys,yl),e(ke,Nl),e(H,zl),F(Ke,H,null),e(H,ql),F(Xe,H,null),b(t,Mr,g),b(t,ve,g),e(ve,Ye),e(Ye,Ns),F(go,Ns,null),e(ve,xl),e(ve,zs),e(zs,El),b(t,Ar,g),b(t,L,g),F(_o,L,null),e(L,Pl),e(L,we),e(we,jl),e(we,qs),e(qs,Ml),e(we,Al),e(we,xs),e(xs,Cl),e(we,Sl),e(L,Ll),e(L,bo),e(bo,Il),e(bo,ko),e(ko,Ol),e(bo,Dl),e(L,Wl),e(L,Q),F(vo,Q,null),e(Q,Ul),e(Q,Fe),e(Fe,Bl),e(Fe,wn),e(wn,Hl),e(Fe,Ql),e(Fe,Es),e(Es,Vl),e(Fe,Rl),e(Q,Gl),F(Ze,Q,null),e(Q,Jl),F(et,Q,null),b(t,Cr,g),b(t,$e,g),e($e,tt),e(tt,Ps),F(wo,Ps,null),e($e,Kl),e($e,js),e(js,Xl),b(t,Sr,g),b(t,oe,g),F(Fo,oe,null),e(oe,Yl),e(oe,Te),e(Te,Zl),e(Te,Ms),e(Ms,ec),e(Te,tc),e(Te,$o),e($o,oc),e(Te,nc),e(oe,sc),e(oe,V),F(To,V,null),e(V,rc),e(V,ye),e(ye,ac),e(ye,Fn),e(Fn,ic),e(ye,lc),e(ye,As),e(As,cc),e(ye,dc),e(V,pc),F(ot,V,null),e(V,hc),F(nt,V,null),b(t,Lr,g),b(t,Ne,g),e(Ne,st),e(st,Cs),F(yo,Cs,null),e(Ne,fc),e(Ne,Ss),e(Ss,mc),b(t,Ir,g),b(t,ne,g),F(No,ne,null),e(ne,uc),e(ne,ze),e(ze,gc),e(ze,Ls),e(Ls,_c),e(ze,bc),e(ze,zo),e(zo,kc),e(ze,vc),e(ne,wc),e(ne,R),F(qo,R,null),e(R,Fc),e(R,qe),e(qe,$c),e(qe,$n),e($n,Tc),e(qe,yc),e(qe,Is),e(Is,Nc),e(qe,zc),e(R,qc),F(rt,R,null),e(R,xc),F(at,R,null),b(t,Or,g),b(t,xe,g),e(xe,it),e(it,Os),F(xo,Os,null),e(xe,Ec),e(xe,Ds),e(Ds,Pc),b(t,Dr,g),b(t,I,g),F(Eo,I,null),e(I,jc),e(I,Ws),e(Ws,Mc),e(I,Ac),e(I,Po),e(Po,Cc),e(Po,jo),e(jo,Sc),e(Po,Lc),e(I,Ic),e(I,P),F(Mo,P,null),e(P,Oc),e(P,Ee),e(Ee,Dc),e(Ee,Tn),e(Tn,Wc),e(Ee,Uc),e(Ee,Us),e(Us,Bc),e(Ee,Hc),e(P,Qc),F(lt,P,null),e(P,Vc),F(ct,P,null),e(P,Rc),F(dt,P,null),b(t,Wr,g),b(t,Pe,g),e(Pe,pt),e(pt,Bs),F(Ao,Bs,null),e(Pe,Gc),e(Pe,Hs),e(Hs,Jc),b(t,Ur,g),b(t,O,g),F(Co,O,null),e(O,Kc),e(O,Qs),e(Qs,Xc),e(O,Yc),e(O,So),e(So,Zc),e(So,Lo),e(Lo,ed),e(So,td),e(O,od),e(O,G),F(Io,G,null),e(G,nd),e(G,je),e(je,sd),e(je,yn),e(yn,rd),e(je,ad),e(je,Vs),e(Vs,id),e(je,ld),e(G,cd),F(ht,G,null),e(G,dd),F(ft,G,null),b(t,Br,g),b(t,Me,g),e(Me,mt),e(mt,Rs),F(Oo,Rs,null),e(Me,pd),e(Me,Gs),e(Gs,hd),b(t,Hr,g),b(t,D,g),F(Do,D,null),e(D,fd),e(D,Js),e(Js,md),e(D,ud),e(D,Wo),e(Wo,gd),e(Wo,Uo),e(Uo,_d),e(Wo,bd),e(D,kd),e(D,J),F(Bo,J,null),e(J,vd),e(J,Ae),e(Ae,wd),e(Ae,Nn),e(Nn,Fd),e(Ae,$d),e(Ae,Ks),e(Ks,Td),e(Ae,yd),e(J,Nd),F(ut,J,null),e(J,zd),F(gt,J,null),b(t,Qr,g),b(t,Ce,g),e(Ce,_t),e(_t,Xs),F(Ho,Xs,null),e(Ce,qd),e(Ce,Ys),e(Ys,xd),b(t,Vr,g),b(t,W,g),F(Qo,W,null),e(W,Ed),e(W,Se),e(Se,Pd),e(Se,Zs),e(Zs,jd),e(Se,Md),e(Se,er),e(er,Ad),e(Se,Cd),e(W,Sd),e(W,Vo),e(Vo,Ld),e(Vo,Ro),e(Ro,Id),e(Vo,Od),e(W,Dd),e(W,K),F(Go,K,null),e(K,Wd),e(K,Le),e(Le,Ud),e(Le,zn),e(zn,Bd),e(Le,Hd),e(Le,tr),e(tr,Qd),e(Le,Vd),e(K,Rd),F(bt,K,null),e(K,Gd),F(kt,K,null),Rr=!0},p(t,[g]){const Jo={};g&2&&(Jo.$$scope={dirty:g,ctx:t}),Be.$set(Jo);const or={};g&2&&(or.$$scope={dirty:g,ctx:t}),Ve.$set(or);const nr={};g&2&&(nr.$$scope={dirty:g,ctx:t}),Ge.$set(nr);const sr={};g&2&&(sr.$$scope={dirty:g,ctx:t}),Ke.$set(sr);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:t}),Xe.$set(Ko);const rr={};g&2&&(rr.$$scope={dirty:g,ctx:t}),Ze.$set(rr);const ar={};g&2&&(ar.$$scope={dirty:g,ctx:t}),et.$set(ar);const ir={};g&2&&(ir.$$scope={dirty:g,ctx:t}),ot.$set(ir);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:t}),nt.$set(Xo);const lr={};g&2&&(lr.$$scope={dirty:g,ctx:t}),rt.$set(lr);const cr={};g&2&&(cr.$$scope={dirty:g,ctx:t}),at.$set(cr);const dr={};g&2&&(dr.$$scope={dirty:g,ctx:t}),lt.$set(dr);const pr={};g&2&&(pr.$$scope={dirty:g,ctx:t}),ct.$set(pr);const hr={};g&2&&(hr.$$scope={dirty:g,ctx:t}),dt.$set(hr);const fr={};g&2&&(fr.$$scope={dirty:g,ctx:t}),ht.$set(fr);const Ie={};g&2&&(Ie.$$scope={dirty:g,ctx:t}),ft.$set(Ie);const mr={};g&2&&(mr.$$scope={dirty:g,ctx:t}),ut.$set(mr);const ur={};g&2&&(ur.$$scope={dirty:g,ctx:t}),gt.$set(ur);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:t}),bt.$set(Yo);const gr={};g&2&&(gr.$$scope={dirty:g,ctx:t}),kt.$set(gr)},i(t){Rr||($(n.$$.fragment,t),$(Ot.$$.fragment,t),$(Bt.$$.fragment,t),$(Ht.$$.fragment,t),$(Qt.$$.fragment,t),$(Be.$$.fragment,t),$(Rt.$$.fragment,t),$(Gt.$$.fragment,t),$(Kt.$$.fragment,t),$(Yt.$$.fragment,t),$(eo.$$.fragment,t),$(Ve.$$.fragment,t),$(to.$$.fragment,t),$(oo.$$.fragment,t),$(no.$$.fragment,t),$(ro.$$.fragment,t),$(io.$$.fragment,t),$(Ge.$$.fragment,t),$(lo.$$.fragment,t),$(co.$$.fragment,t),$(uo.$$.fragment,t),$(Ke.$$.fragment,t),$(Xe.$$.fragment,t),$(go.$$.fragment,t),$(_o.$$.fragment,t),$(vo.$$.fragment,t),$(Ze.$$.fragment,t),$(et.$$.fragment,t),$(wo.$$.fragment,t),$(Fo.$$.fragment,t),$(To.$$.fragment,t),$(ot.$$.fragment,t),$(nt.$$.fragment,t),$(yo.$$.fragment,t),$(No.$$.fragment,t),$(qo.$$.fragment,t),$(rt.$$.fragment,t),$(at.$$.fragment,t),$(xo.$$.fragment,t),$(Eo.$$.fragment,t),$(Mo.$$.fragment,t),$(lt.$$.fragment,t),$(ct.$$.fragment,t),$(dt.$$.fragment,t),$(Ao.$$.fragment,t),$(Co.$$.fragment,t),$(Io.$$.fragment,t),$(ht.$$.fragment,t),$(ft.$$.fragment,t),$(Oo.$$.fragment,t),$(Do.$$.fragment,t),$(Bo.$$.fragment,t),$(ut.$$.fragment,t),$(gt.$$.fragment,t),$(Ho.$$.fragment,t),$(Qo.$$.fragment,t),$(Go.$$.fragment,t),$(bt.$$.fragment,t),$(kt.$$.fragment,t),Rr=!0)},o(t){T(n.$$.fragment,t),T(Ot.$$.fragment,t),T(Bt.$$.fragment,t),T(Ht.$$.fragment,t),T(Qt.$$.fragment,t),T(Be.$$.fragment,t),T(Rt.$$.fragment,t),T(Gt.$$.fragment,t),T(Kt.$$.fragment,t),T(Yt.$$.fragment,t),T(eo.$$.fragment,t),T(Ve.$$.fragment,t),T(to.$$.fragment,t),T(oo.$$.fragment,t),T(no.$$.fragment,t),T(ro.$$.fragment,t),T(io.$$.fragment,t),T(Ge.$$.fragment,t),T(lo.$$.fragment,t),T(co.$$.fragment,t),T(uo.$$.fragment,t),T(Ke.$$.fragment,t),T(Xe.$$.fragment,t),T(go.$$.fragment,t),T(_o.$$.fragment,t),T(vo.$$.fragment,t),T(Ze.$$.fragment,t),T(et.$$.fragment,t),T(wo.$$.fragment,t),T(Fo.$$.fragment,t),T(To.$$.fragment,t),T(ot.$$.fragment,t),T(nt.$$.fragment,t),T(yo.$$.fragment,t),T(No.$$.fragment,t),T(qo.$$.fragment,t),T(rt.$$.fragment,t),T(at.$$.fragment,t),T(xo.$$.fragment,t),T(Eo.$$.fragment,t),T(Mo.$$.fragment,t),T(lt.$$.fragment,t),T(ct.$$.fragment,t),T(dt.$$.fragment,t),T(Ao.$$.fragment,t),T(Co.$$.fragment,t),T(Io.$$.fragment,t),T(ht.$$.fragment,t),T(ft.$$.fragment,t),T(Oo.$$.fragment,t),T(Do.$$.fragment,t),T(Bo.$$.fragment,t),T(ut.$$.fragment,t),T(gt.$$.fragment,t),T(Ho.$$.fragment,t),T(Qo.$$.fragment,t),T(Go.$$.fragment,t),T(bt.$$.fragment,t),T(kt.$$.fragment,t),Rr=!1},d(t){o(c),t&&o(k),t&&o(u),y(n),t&&o(_r),t&&o(de),y(Ot),t&&o(br),t&&o(De),t&&o(kr),t&&o(Zo),t&&o(vr),t&&o(en),t&&o(wr),t&&o(tn),t&&o(Fr),t&&o(se),t&&o($r),t&&o(pe),y(Bt),t&&o(Tr),t&&o(E),t&&o(yr),t&&o(he),y(Ht),t&&o(Nr),t&&o(M),y(Qt),y(Be),t&&o(zr),t&&o(ue),y(Rt),t&&o(qr),t&&o(x),y(Gt),y(Kt),y(Yt),y(eo),y(Ve),y(to),t&&o(xr),t&&o(_e),y(oo),t&&o(Er),t&&o(A),y(no),y(ro),y(io),y(Ge),t&&o(Pr),t&&o(be),y(lo),t&&o(jr),t&&o(S),y(co),y(uo),y(Ke),y(Xe),t&&o(Mr),t&&o(ve),y(go),t&&o(Ar),t&&o(L),y(_o),y(vo),y(Ze),y(et),t&&o(Cr),t&&o($e),y(wo),t&&o(Sr),t&&o(oe),y(Fo),y(To),y(ot),y(nt),t&&o(Lr),t&&o(Ne),y(yo),t&&o(Ir),t&&o(ne),y(No),y(qo),y(rt),y(at),t&&o(Or),t&&o(xe),y(xo),t&&o(Dr),t&&o(I),y(Eo),y(Mo),y(lt),y(ct),y(dt),t&&o(Wr),t&&o(Pe),y(Ao),t&&o(Ur),t&&o(O),y(Co),y(Io),y(ht),y(ft),t&&o(Br),t&&o(Me),y(Oo),t&&o(Hr),t&&o(D),y(Do),y(Bo),y(ut),y(gt),t&&o(Qr),t&&o(Ce),y(Ho),t&&o(Vr),t&&o(W),y(Qo),y(Go),y(bt),y(kt)}}}const wf={local:"fnet",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.FNetConfig",title:"FNetConfig"},{local:"transformers.FNetTokenizer",title:"FNetTokenizer"},{local:"transformers.FNetTokenizerFast",title:"FNetTokenizerFast"},{local:"transformers.FNetModel",title:"FNetModel"},{local:"transformers.FNetForPreTraining",title:"FNetForPreTraining"},{local:"transformers.FNetForMaskedLM",title:"FNetForMaskedLM"},{local:"transformers.FNetForNextSentencePrediction",title:"FNetForNextSentencePrediction"},{local:"transformers.FNetForSequenceClassification",title:"FNetForSequenceClassification"},{local:"transformers.FNetForMultipleChoice",title:"FNetForMultipleChoice"},{local:"transformers.FNetForTokenClassification",title:"FNetForTokenClassification"},{local:"transformers.FNetForQuestionAnswering",title:"FNetForQuestionAnswering"}],title:"FNet"};function Ff(N){return Yh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xf extends Gh{constructor(c){super();Jh(this,c,Ff,vf,Kh,{})}}export{xf as default,wf as metadata};
