import{S as sh,i as rh,s as ah,e as s,k as h,w,t as i,M as ih,c as r,d as o,m,a,x as F,h as l,b as f,G as e,g as b,y as $,q as v,o as T,B as y,v as lh,L as Y}from"../../chunks/vendor-hf-doc-builder.js";import{T as At}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Z}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as D}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as X}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ch(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function dh(N){let c,k,u,p,_;return p=new Z({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=h(),w(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),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function ph(N){let c,k,u,p,_;return p=new Z({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=h(),w(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),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function hh(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 mh(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function fh(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 uh(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function gh(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 _h(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function bh(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 kh(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function wh(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 Fh(N){let c,k,u,p,_;return p=new Z({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=h(),w(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),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function $h(N){let c,k,u,p,_;return p=new Z({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=h(),w(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),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function vh(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 Th(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function yh(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 Nh(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function zh(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 qh(N){let c,k,u,p,_;return p=new Z({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=h(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);k=l(d,"Example:"),d.forEach(o),u=m(n),F(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,k),b(n,u,d),$(p,n,d),_=!0},p:Y,i(n){_||(v(p.$$.fragment,n),_=!0)},o(n){T(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),y(p,n)}}}function xh(N){let c,k,u,p,_,n,d,z,Kr,er,le,Se,Ln,Ct,Xr,On,Yr,tr,Le,Zr,St,ea,ta,or,Go,In,oa,nr,Jo,na,sr,Ko,Dn,sa,rr,ne,ra,Lt,aa,ia,Ot,la,ca,ar,ce,Oe,Bn,It,da,Wn,pa,ir,P,Dt,ha,de,ma,Xo,fa,ua,Bt,ga,_a,ba,pe,ka,Yo,wa,Fa,Zo,$a,va,Ta,Ie,lr,he,De,Un,Wt,ya,Hn,Na,cr,x,Ut,za,ee,qa,en,xa,Ea,Ht,Pa,ja,tn,Ma,Aa,Ca,se,Qt,Sa,Qn,La,Oa,Vt,on,Ia,Vn,Da,Ba,nn,Wa,Rn,Ua,Ha,Be,Rt,Qa,Gt,Va,Gn,Ra,Ga,Ja,B,Jt,Ka,Jn,Xa,Ya,We,Za,me,ei,Kn,ti,oi,Xn,ni,si,ri,sn,Kt,dr,fe,Ue,Yn,Xt,ai,Zn,ii,pr,j,Yt,li,M,ci,es,di,pi,rn,hi,mi,Zt,fi,ui,an,gi,_i,bi,re,eo,ki,ts,wi,Fi,to,ln,$i,os,vi,Ti,cn,yi,ns,Ni,zi,W,oo,qi,ss,xi,Ei,He,Pi,rs,ji,hr,ue,Qe,as,no,Mi,is,Ai,mr,A,so,Ci,ro,Si,ao,Li,Oi,Ii,io,Di,lo,Bi,Wi,Ui,U,co,Hi,ge,Qi,dn,Vi,Ri,ls,Gi,Ji,Ki,Ve,Xi,Re,fr,_e,Ge,cs,po,Yi,ds,Zi,ur,C,ho,el,be,tl,ps,ol,nl,hs,sl,rl,al,mo,il,fo,ll,cl,dl,H,uo,pl,ke,hl,pn,ml,fl,ms,ul,gl,_l,Je,bl,Ke,gr,we,Xe,fs,go,kl,us,wl,_r,te,_o,Fl,Fe,$l,gs,vl,Tl,bo,yl,Nl,zl,Q,ko,ql,$e,xl,hn,El,Pl,_s,jl,Ml,Al,Ye,Cl,Ze,br,ve,et,bs,wo,Sl,ks,Ll,kr,oe,Fo,Ol,Te,Il,ws,Dl,Bl,$o,Wl,Ul,Hl,V,vo,Ql,ye,Vl,mn,Rl,Gl,Fs,Jl,Kl,Xl,tt,Yl,ot,wr,Ne,nt,$s,To,Zl,vs,ec,Fr,S,yo,tc,Ts,oc,nc,No,sc,zo,rc,ac,ic,E,qo,lc,ze,cc,fn,dc,pc,ys,hc,mc,fc,st,uc,rt,gc,at,$r,qe,it,Ns,xo,_c,zs,bc,vr,L,Eo,kc,qs,wc,Fc,Po,$c,jo,vc,Tc,yc,R,Mo,Nc,xe,zc,un,qc,xc,xs,Ec,Pc,jc,lt,Mc,ct,Tr,Ee,dt,Es,Ao,Ac,Ps,Cc,yr,O,Co,Sc,js,Lc,Oc,So,Ic,Lo,Dc,Bc,Wc,G,Oo,Uc,Pe,Hc,gn,Qc,Vc,Ms,Rc,Gc,Jc,pt,Kc,ht,Nr,je,mt,As,Io,Xc,Cs,Yc,zr,I,Do,Zc,Me,ed,Ss,td,od,Ls,nd,sd,rd,Bo,ad,Wo,id,ld,cd,J,Uo,dd,Ae,pd,_n,hd,md,Os,fd,ud,gd,ft,_d,ut,qr;return n=new D({}),Ct=new D({}),It=new D({}),Dt=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/main/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/main/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/main/src/transformers/models/fnet/configuration_fnet.py#L30"}}),Ie=new X({props:{anchor:"transformers.FNetConfig.example",$$slots:{default:[ch]},$$scope:{ctx:N}}}),Wt=new D({}),Ut=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/main/src/transformers/models/fnet/tokenization_fnet.py#L47"}}),Qt=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/main/src/transformers/models/fnet/tokenization_fnet.py#L278",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>
`}}),Rt=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/main/src/transformers/models/fnet/tokenization_fnet.py#L303",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>
`}}),Jt=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/main/src/transformers/models/fnet/tokenization_fnet.py#L331",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>
`}}),We=new X({props:{anchor:"transformers.FNetTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[dh]},$$scope:{ctx:N}}}),Kt=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/main/src/transformers/models/fnet/tokenization_fnet.py#L360"}}),Xt=new D({}),Yt=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/main/src/transformers/models/fnet/tokenization_fnet_fast.py#L54"}}),eo=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/main/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>
`}}),oo=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/main/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>
`}}),He=new X({props:{anchor:"transformers.FNetTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[ph]},$$scope:{ctx:N}}}),no=new D({}),so=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L515"}}),co=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L541",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new At({props:{$$slots:{default:[hh]},$$scope:{ctx:N}}}),Re=new X({props:{anchor:"transformers.FNetModel.forward.example",$$slots:{default:[mh]},$$scope:{ctx:N}}}),po=new D({}),ho=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L624"}}),uo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L642",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/main/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>
`}}),Je=new At({props:{$$slots:{default:[fh]},$$scope:{ctx:N}}}),Ke=new X({props:{anchor:"transformers.FNetForPreTraining.forward.example",$$slots:{default:[uh]},$$scope:{ctx:N}}}),go=new D({}),_o=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L718"}}),ko=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L736",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ye=new At({props:{$$slots:{default:[gh]},$$scope:{ctx:N}}}),Ze=new X({props:{anchor:"transformers.FNetForMaskedLM.forward.example",$$slots:{default:[_h]},$$scope:{ctx:N}}}),wo=new D({}),Fo=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L788"}}),vo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L798",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),tt=new At({props:{$$slots:{default:[bh]},$$scope:{ctx:N}}}),ot=new X({props:{anchor:"transformers.FNetForNextSentencePrediction.forward.example",$$slots:{default:[kh]},$$scope:{ctx:N}}}),To=new D({}),yo=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L883"}}),qo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L895",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new At({props:{$$slots:{default:[wh]},$$scope:{ctx:N}}}),rt=new X({props:{anchor:"transformers.FNetForSequenceClassification.forward.example",$$slots:{default:[Fh]},$$scope:{ctx:N}}}),at=new X({props:{anchor:"transformers.FNetForSequenceClassification.forward.example-2",$$slots:{default:[$h]},$$scope:{ctx:N}}}),xo=new D({}),Eo=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L968"}}),Mo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L979",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new At({props:{$$slots:{default:[vh]},$$scope:{ctx:N}}}),ct=new X({props:{anchor:"transformers.FNetForMultipleChoice.forward.example",$$slots:{default:[Th]},$$scope:{ctx:N}}}),Ao=new D({}),Co=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L1047"}}),Oo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L1060",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new At({props:{$$slots:{default:[yh]},$$scope:{ctx:N}}}),ht=new X({props:{anchor:"transformers.FNetForTokenClassification.forward.example",$$slots:{default:[Nh]},$$scope:{ctx:N}}}),Io=new D({}),Do=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fnet/modeling_fnet.py#L1116"}}),Uo=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/fnet/modeling_fnet.py#L1128",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new At({props:{$$slots:{default:[zh]},$$scope:{ctx:N}}}),ut=new X({props:{anchor:"transformers.FNetForQuestionAnswering.forward.example",$$slots:{default:[qh]},$$scope:{ctx:N}}}),{c(){c=s("meta"),k=h(),u=s("h1"),p=s("a"),_=s("span"),w(n.$$.fragment),d=h(),z=s("span"),Kr=i("FNet"),er=h(),le=s("h2"),Se=s("a"),Ln=s("span"),w(Ct.$$.fragment),Xr=h(),On=s("span"),Yr=i("Overview"),tr=h(),Le=s("p"),Zr=i("The FNet model was proposed in "),St=s("a"),ea=i("FNet: Mixing Tokens with Fourier Transforms"),ta=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:`),or=h(),Go=s("p"),In=s("em"),oa=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.`),nr=h(),Jo=s("p"),na=i("Tips on usage:"),sr=h(),Ko=s("ul"),Dn=s("li"),sa=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.`),rr=h(),ne=s("p"),ra=i("This model was contributed by "),Lt=s("a"),aa=i("gchhablani"),ia=i(". The original code can be found "),Ot=s("a"),la=i("here"),ca=i("."),ar=h(),ce=s("h2"),Oe=s("a"),Bn=s("span"),w(It.$$.fragment),da=h(),Wn=s("span"),pa=i("FNetConfig"),ir=h(),P=s("div"),w(Dt.$$.fragment),ha=h(),de=s("p"),ma=i("This is the configuration class to store the configuration of a "),Xo=s("a"),fa=i("FNetModel"),ua=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
`),Bt=s("a"),ga=i("google/fnet-base"),_a=i(" architecture."),ba=h(),pe=s("p"),ka=i("Configuration objects inherit from "),Yo=s("a"),wa=i("PretrainedConfig"),Fa=i(` and can be used to control the model outputs. Read the
documentation from `),Zo=s("a"),$a=i("PretrainedConfig"),va=i(" for more information."),Ta=h(),w(Ie.$$.fragment),lr=h(),he=s("h2"),De=s("a"),Un=s("span"),w(Wt.$$.fragment),ya=h(),Hn=s("span"),Na=i("FNetTokenizer"),cr=h(),x=s("div"),w(Ut.$$.fragment),za=h(),ee=s("p"),qa=i("Construct an FNet tokenizer. Adapted from "),en=s("a"),xa=i("AlbertTokenizer"),Ea=i(`. Based on
`),Ht=s("a"),Pa=i("SentencePiece"),ja=i(". This tokenizer inherits from "),tn=s("a"),Ma=i("PreTrainedTokenizer"),Aa=i(`
which contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.`),Ca=h(),se=s("div"),w(Qt.$$.fragment),Sa=h(),Qn=s("p"),La=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:`),Oa=h(),Vt=s("ul"),on=s("li"),Ia=i("single sequence: "),Vn=s("code"),Da=i("[CLS] X [SEP]"),Ba=h(),nn=s("li"),Wa=i("pair of sequences: "),Rn=s("code"),Ua=i("[CLS] A [SEP] B [SEP]"),Ha=h(),Be=s("div"),w(Rt.$$.fragment),Qa=h(),Gt=s("p"),Va=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 `),Gn=s("code"),Ra=i("prepare_for_model"),Ga=i(" method."),Ja=h(),B=s("div"),w(Jt.$$.fragment),Ka=h(),Jn=s("p"),Xa=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet sequence"),Ya=h(),w(We.$$.fragment),Za=h(),me=s("p"),ei=i("If "),Kn=s("code"),ti=i("token_ids_1"),oi=i(" is "),Xn=s("code"),ni=i("None"),si=i(", this method only returns the first portion of the mask (0s)."),ri=h(),sn=s("div"),w(Kt.$$.fragment),dr=h(),fe=s("h2"),Ue=s("a"),Yn=s("span"),w(Xt.$$.fragment),ai=h(),Zn=s("span"),ii=i("FNetTokenizerFast"),pr=h(),j=s("div"),w(Yt.$$.fragment),li=h(),M=s("p"),ci=i("Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),es=s("em"),di=i("tokenizers"),pi=i(` library). Adapted from
`),rn=s("a"),hi=i("AlbertTokenizerFast"),mi=i(`. Based on
`),Zt=s("a"),fi=i("Unigram"),ui=i(`. This
tokenizer inherits from `),an=s("a"),gi=i("PreTrainedTokenizerFast"),_i=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods`),bi=h(),re=s("div"),w(eo.$$.fragment),ki=h(),ts=s("p"),wi=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:`),Fi=h(),to=s("ul"),ln=s("li"),$i=i("single sequence: "),os=s("code"),vi=i("[CLS] X [SEP]"),Ti=h(),cn=s("li"),yi=i("pair of sequences: "),ns=s("code"),Ni=i("[CLS] A [SEP] B [SEP]"),zi=h(),W=s("div"),w(oo.$$.fragment),qi=h(),ss=s("p"),xi=i("Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet"),Ei=h(),w(He.$$.fragment),Pi=h(),rs=s("p"),ji=i("if token_ids_1 is None, only returns the first portion of the mask (0s)."),hr=h(),ue=s("h2"),Qe=s("a"),as=s("span"),w(no.$$.fragment),Mi=h(),is=s("span"),Ai=i("FNetModel"),mr=h(),A=s("div"),w(so.$$.fragment),Ci=h(),ro=s("p"),Si=i(`The bare FNet Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ao=s("a"),Li=i("torch.nn.Module"),Oi=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.`),Ii=h(),io=s("p"),Di=i("The model can behave as an encoder, following the architecture described in "),lo=s("a"),Bi=i(`FNet: Mixing Tokens with Fourier
Transforms`),Wi=i(" by James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon."),Ui=h(),U=s("div"),w(co.$$.fragment),Hi=h(),ge=s("p"),Qi=i("The "),dn=s("a"),Vi=i("FNetModel"),Ri=i(" forward method, overrides the "),ls=s("code"),Gi=i("__call__"),Ji=i(" special method."),Ki=h(),w(Ve.$$.fragment),Xi=h(),w(Re.$$.fragment),fr=h(),_e=s("h2"),Ge=s("a"),cs=s("span"),w(po.$$.fragment),Yi=h(),ds=s("span"),Zi=i("FNetForPreTraining"),ur=h(),C=s("div"),w(ho.$$.fragment),el=h(),be=s("p"),tl=i("FNet Model with two heads on top as done during the pretraining: a "),ps=s("code"),ol=i("masked language modeling"),nl=i(" head and a "),hs=s("code"),sl=i("next sentence prediction (classification)"),rl=i(" head."),al=h(),mo=s("p"),il=i("This model is a PyTorch "),fo=s("a"),ll=i("torch.nn.Module"),cl=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.`),dl=h(),H=s("div"),w(uo.$$.fragment),pl=h(),ke=s("p"),hl=i("The "),pn=s("a"),ml=i("FNetForPreTraining"),fl=i(" forward method, overrides the "),ms=s("code"),ul=i("__call__"),gl=i(" special method."),_l=h(),w(Je.$$.fragment),bl=h(),w(Ke.$$.fragment),gr=h(),we=s("h2"),Xe=s("a"),fs=s("span"),w(go.$$.fragment),kl=h(),us=s("span"),wl=i("FNetForMaskedLM"),_r=h(),te=s("div"),w(_o.$$.fragment),Fl=h(),Fe=s("p"),$l=i("FNet Model with a "),gs=s("code"),vl=i("language modeling"),Tl=i(` head on top.
This model is a PyTorch `),bo=s("a"),yl=i("torch.nn.Module"),Nl=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.`),zl=h(),Q=s("div"),w(ko.$$.fragment),ql=h(),$e=s("p"),xl=i("The "),hn=s("a"),El=i("FNetForMaskedLM"),Pl=i(" forward method, overrides the "),_s=s("code"),jl=i("__call__"),Ml=i(" special method."),Al=h(),w(Ye.$$.fragment),Cl=h(),w(Ze.$$.fragment),br=h(),ve=s("h2"),et=s("a"),bs=s("span"),w(wo.$$.fragment),Sl=h(),ks=s("span"),Ll=i("FNetForNextSentencePrediction"),kr=h(),oe=s("div"),w(Fo.$$.fragment),Ol=h(),Te=s("p"),Il=i("FNet Model with a "),ws=s("code"),Dl=i("next sentence prediction (classification)"),Bl=i(` head on top.
This model is a PyTorch `),$o=s("a"),Wl=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.`),Hl=h(),V=s("div"),w(vo.$$.fragment),Ql=h(),ye=s("p"),Vl=i("The "),mn=s("a"),Rl=i("FNetForNextSentencePrediction"),Gl=i(" forward method, overrides the "),Fs=s("code"),Jl=i("__call__"),Kl=i(" special method."),Xl=h(),w(tt.$$.fragment),Yl=h(),w(ot.$$.fragment),wr=h(),Ne=s("h2"),nt=s("a"),$s=s("span"),w(To.$$.fragment),Zl=h(),vs=s("span"),ec=i("FNetForSequenceClassification"),Fr=h(),S=s("div"),w(yo.$$.fragment),tc=h(),Ts=s("p"),oc=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.`),nc=h(),No=s("p"),sc=i("This model is a PyTorch "),zo=s("a"),rc=i("torch.nn.Module"),ac=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=h(),E=s("div"),w(qo.$$.fragment),lc=h(),ze=s("p"),cc=i("The "),fn=s("a"),dc=i("FNetForSequenceClassification"),pc=i(" forward method, overrides the "),ys=s("code"),hc=i("__call__"),mc=i(" special method."),fc=h(),w(st.$$.fragment),uc=h(),w(rt.$$.fragment),gc=h(),w(at.$$.fragment),$r=h(),qe=s("h2"),it=s("a"),Ns=s("span"),w(xo.$$.fragment),_c=h(),zs=s("span"),bc=i("FNetForMultipleChoice"),vr=h(),L=s("div"),w(Eo.$$.fragment),kc=h(),qs=s("p"),wc=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.`),Fc=h(),Po=s("p"),$c=i("This model is a PyTorch "),jo=s("a"),vc=i("torch.nn.Module"),Tc=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.`),yc=h(),R=s("div"),w(Mo.$$.fragment),Nc=h(),xe=s("p"),zc=i("The "),un=s("a"),qc=i("FNetForMultipleChoice"),xc=i(" forward method, overrides the "),xs=s("code"),Ec=i("__call__"),Pc=i(" special method."),jc=h(),w(lt.$$.fragment),Mc=h(),w(ct.$$.fragment),Tr=h(),Ee=s("h2"),dt=s("a"),Es=s("span"),w(Ao.$$.fragment),Ac=h(),Ps=s("span"),Cc=i("FNetForTokenClassification"),yr=h(),O=s("div"),w(Co.$$.fragment),Sc=h(),js=s("p"),Lc=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.`),Oc=h(),So=s("p"),Ic=i("This model is a PyTorch "),Lo=s("a"),Dc=i("torch.nn.Module"),Bc=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=h(),G=s("div"),w(Oo.$$.fragment),Uc=h(),Pe=s("p"),Hc=i("The "),gn=s("a"),Qc=i("FNetForTokenClassification"),Vc=i(" forward method, overrides the "),Ms=s("code"),Rc=i("__call__"),Gc=i(" special method."),Jc=h(),w(pt.$$.fragment),Kc=h(),w(ht.$$.fragment),Nr=h(),je=s("h2"),mt=s("a"),As=s("span"),w(Io.$$.fragment),Xc=h(),Cs=s("span"),Yc=i("FNetForQuestionAnswering"),zr=h(),I=s("div"),w(Do.$$.fragment),Zc=h(),Me=s("p"),ed=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 `),Ss=s("code"),td=i("span start logits"),od=i(" and "),Ls=s("code"),nd=i("span end logits"),sd=i(")."),rd=h(),Bo=s("p"),ad=i("This model is a PyTorch "),Wo=s("a"),id=i("torch.nn.Module"),ld=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.`),cd=h(),J=s("div"),w(Uo.$$.fragment),dd=h(),Ae=s("p"),pd=i("The "),_n=s("a"),hd=i("FNetForQuestionAnswering"),md=i(" forward method, overrides the "),Os=s("code"),fd=i("__call__"),ud=i(" special method."),gd=h(),w(ft.$$.fragment),_d=h(),w(ut.$$.fragment),this.h()},l(t){const g=ih('[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 Ho=a(u);p=r(Ho,"A",{id:!0,class:!0,href:!0});var Is=a(p);_=r(Is,"SPAN",{});var Ds=a(_);F(n.$$.fragment,Ds),Ds.forEach(o),Is.forEach(o),d=m(Ho),z=r(Ho,"SPAN",{});var Bs=a(z);Kr=l(Bs,"FNet"),Bs.forEach(o),Ho.forEach(o),er=m(t),le=r(t,"H2",{class:!0});var Qo=a(le);Se=r(Qo,"A",{id:!0,class:!0,href:!0});var Ws=a(Se);Ln=r(Ws,"SPAN",{});var Us=a(Ln);F(Ct.$$.fragment,Us),Us.forEach(o),Ws.forEach(o),Xr=m(Qo),On=r(Qo,"SPAN",{});var Hs=a(On);Yr=l(Hs,"Overview"),Hs.forEach(o),Qo.forEach(o),tr=m(t),Le=r(t,"P",{});var Vo=a(Le);Zr=l(Vo,"The FNet model was proposed in "),St=r(Vo,"A",{href:!0,rel:!0});var Qs=a(St);ea=l(Qs,"FNet: Mixing Tokens with Fourier Transforms"),Qs.forEach(o),ta=l(Vo,` 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:`),Vo.forEach(o),or=m(t),Go=r(t,"P",{});var Vs=a(Go);In=r(Vs,"EM",{});var Rs=a(In);oa=l(Rs,`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.`),Rs.forEach(o),Vs.forEach(o),nr=m(t),Jo=r(t,"P",{});var Gs=a(Jo);na=l(Gs,"Tips on usage:"),Gs.forEach(o),sr=m(t),Ko=r(t,"UL",{});var Js=a(Ko);Dn=r(Js,"LI",{});var Ks=a(Dn);sa=l(Ks,`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.`),Ks.forEach(o),Js.forEach(o),rr=m(t),ne=r(t,"P",{});var Ce=a(ne);ra=l(Ce,"This model was contributed by "),Lt=r(Ce,"A",{href:!0,rel:!0});var Xs=a(Lt);aa=l(Xs,"gchhablani"),Xs.forEach(o),ia=l(Ce,". The original code can be found "),Ot=r(Ce,"A",{href:!0,rel:!0});var Ys=a(Ot);la=l(Ys,"here"),Ys.forEach(o),ca=l(Ce,"."),Ce.forEach(o),ar=m(t),ce=r(t,"H2",{class:!0});var Ro=a(ce);Oe=r(Ro,"A",{id:!0,class:!0,href:!0});var Zs=a(Oe);Bn=r(Zs,"SPAN",{});var $d=a(Bn);F(It.$$.fragment,$d),$d.forEach(o),Zs.forEach(o),da=m(Ro),Wn=r(Ro,"SPAN",{});var vd=a(Wn);pa=l(vd,"FNetConfig"),vd.forEach(o),Ro.forEach(o),ir=m(t),P=r(t,"DIV",{class:!0});var gt=a(P);F(Dt.$$.fragment,gt),ha=m(gt),de=r(gt,"P",{});var bn=a(de);ma=l(bn,"This is the configuration class to store the configuration of a "),Xo=r(bn,"A",{href:!0});var Td=a(Xo);fa=l(Td,"FNetModel"),Td.forEach(o),ua=l(bn,`. 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
`),Bt=r(bn,"A",{href:!0,rel:!0});var yd=a(Bt);ga=l(yd,"google/fnet-base"),yd.forEach(o),_a=l(bn," architecture."),bn.forEach(o),ba=m(gt),pe=r(gt,"P",{});var kn=a(pe);ka=l(kn,"Configuration objects inherit from "),Yo=r(kn,"A",{href:!0});var Nd=a(Yo);wa=l(Nd,"PretrainedConfig"),Nd.forEach(o),Fa=l(kn,` and can be used to control the model outputs. Read the
documentation from `),Zo=r(kn,"A",{href:!0});var zd=a(Zo);$a=l(zd,"PretrainedConfig"),zd.forEach(o),va=l(kn," for more information."),kn.forEach(o),Ta=m(gt),F(Ie.$$.fragment,gt),gt.forEach(o),lr=m(t),he=r(t,"H2",{class:!0});var xr=a(he);De=r(xr,"A",{id:!0,class:!0,href:!0});var qd=a(De);Un=r(qd,"SPAN",{});var xd=a(Un);F(Wt.$$.fragment,xd),xd.forEach(o),qd.forEach(o),ya=m(xr),Hn=r(xr,"SPAN",{});var Ed=a(Hn);Na=l(Ed,"FNetTokenizer"),Ed.forEach(o),xr.forEach(o),cr=m(t),x=r(t,"DIV",{class:!0});var K=a(x);F(Ut.$$.fragment,K),za=m(K),ee=r(K,"P",{});var _t=a(ee);qa=l(_t,"Construct an FNet tokenizer. Adapted from "),en=r(_t,"A",{href:!0});var Pd=a(en);xa=l(Pd,"AlbertTokenizer"),Pd.forEach(o),Ea=l(_t,`. Based on
`),Ht=r(_t,"A",{href:!0,rel:!0});var jd=a(Ht);Pa=l(jd,"SentencePiece"),jd.forEach(o),ja=l(_t,". This tokenizer inherits from "),tn=r(_t,"A",{href:!0});var Md=a(tn);Ma=l(Md,"PreTrainedTokenizer"),Md.forEach(o),Aa=l(_t,`
which contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.`),_t.forEach(o),Ca=m(K),se=r(K,"DIV",{class:!0});var wn=a(se);F(Qt.$$.fragment,wn),Sa=m(wn),Qn=r(wn,"P",{});var Ad=a(Qn);La=l(Ad,`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:`),Ad.forEach(o),Oa=m(wn),Vt=r(wn,"UL",{});var Er=a(Vt);on=r(Er,"LI",{});var bd=a(on);Ia=l(bd,"single sequence: "),Vn=r(bd,"CODE",{});var Cd=a(Vn);Da=l(Cd,"[CLS] X [SEP]"),Cd.forEach(o),bd.forEach(o),Ba=m(Er),nn=r(Er,"LI",{});var kd=a(nn);Wa=l(kd,"pair of sequences: "),Rn=r(kd,"CODE",{});var Sd=a(Rn);Ua=l(Sd,"[CLS] A [SEP] B [SEP]"),Sd.forEach(o),kd.forEach(o),Er.forEach(o),wn.forEach(o),Ha=m(K),Be=r(K,"DIV",{class:!0});var Pr=a(Be);F(Rt.$$.fragment,Pr),Qa=m(Pr),Gt=r(Pr,"P",{});var jr=a(Gt);Va=l(jr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Gn=r(jr,"CODE",{});var Ld=a(Gn);Ra=l(Ld,"prepare_for_model"),Ld.forEach(o),Ga=l(jr," method."),jr.forEach(o),Pr.forEach(o),Ja=m(K),B=r(K,"DIV",{class:!0});var bt=a(B);F(Jt.$$.fragment,bt),Ka=m(bt),Jn=r(bt,"P",{});var Od=a(Jn);Xa=l(Od,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet sequence"),Od.forEach(o),Ya=m(bt),F(We.$$.fragment,bt),Za=m(bt),me=r(bt,"P",{});var Fn=a(me);ei=l(Fn,"If "),Kn=r(Fn,"CODE",{});var Id=a(Kn);ti=l(Id,"token_ids_1"),Id.forEach(o),oi=l(Fn," is "),Xn=r(Fn,"CODE",{});var Dd=a(Xn);ni=l(Dd,"None"),Dd.forEach(o),si=l(Fn,", this method only returns the first portion of the mask (0s)."),Fn.forEach(o),bt.forEach(o),ri=m(K),sn=r(K,"DIV",{class:!0});var Bd=a(sn);F(Kt.$$.fragment,Bd),Bd.forEach(o),K.forEach(o),dr=m(t),fe=r(t,"H2",{class:!0});var Mr=a(fe);Ue=r(Mr,"A",{id:!0,class:!0,href:!0});var Wd=a(Ue);Yn=r(Wd,"SPAN",{});var Ud=a(Yn);F(Xt.$$.fragment,Ud),Ud.forEach(o),Wd.forEach(o),ai=m(Mr),Zn=r(Mr,"SPAN",{});var Hd=a(Zn);ii=l(Hd,"FNetTokenizerFast"),Hd.forEach(o),Mr.forEach(o),pr=m(t),j=r(t,"DIV",{class:!0});var kt=a(j);F(Yt.$$.fragment,kt),li=m(kt),M=r(kt,"P",{});var ae=a(M);ci=l(ae,"Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),es=r(ae,"EM",{});var Qd=a(es);di=l(Qd,"tokenizers"),Qd.forEach(o),pi=l(ae,` library). Adapted from
`),rn=r(ae,"A",{href:!0});var Vd=a(rn);hi=l(Vd,"AlbertTokenizerFast"),Vd.forEach(o),mi=l(ae,`. Based on
`),Zt=r(ae,"A",{href:!0,rel:!0});var Rd=a(Zt);fi=l(Rd,"Unigram"),Rd.forEach(o),ui=l(ae,`. This
tokenizer inherits from `),an=r(ae,"A",{href:!0});var Gd=a(an);gi=l(Gd,"PreTrainedTokenizerFast"),Gd.forEach(o),_i=l(ae,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods`),ae.forEach(o),bi=m(kt),re=r(kt,"DIV",{class:!0});var $n=a(re);F(eo.$$.fragment,$n),ki=m($n),ts=r($n,"P",{});var Jd=a(ts);wi=l(Jd,`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:`),Jd.forEach(o),Fi=m($n),to=r($n,"UL",{});var Ar=a(to);ln=r(Ar,"LI",{});var wd=a(ln);$i=l(wd,"single sequence: "),os=r(wd,"CODE",{});var Kd=a(os);vi=l(Kd,"[CLS] X [SEP]"),Kd.forEach(o),wd.forEach(o),Ti=m(Ar),cn=r(Ar,"LI",{});var Fd=a(cn);yi=l(Fd,"pair of sequences: "),ns=r(Fd,"CODE",{});var Xd=a(ns);Ni=l(Xd,"[CLS] A [SEP] B [SEP]"),Xd.forEach(o),Fd.forEach(o),Ar.forEach(o),$n.forEach(o),zi=m(kt),W=r(kt,"DIV",{class:!0});var wt=a(W);F(oo.$$.fragment,wt),qi=m(wt),ss=r(wt,"P",{});var Yd=a(ss);xi=l(Yd,"Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet"),Yd.forEach(o),Ei=m(wt),F(He.$$.fragment,wt),Pi=m(wt),rs=r(wt,"P",{});var Zd=a(rs);ji=l(Zd,"if token_ids_1 is None, only returns the first portion of the mask (0s)."),Zd.forEach(o),wt.forEach(o),kt.forEach(o),hr=m(t),ue=r(t,"H2",{class:!0});var Cr=a(ue);Qe=r(Cr,"A",{id:!0,class:!0,href:!0});var ep=a(Qe);as=r(ep,"SPAN",{});var tp=a(as);F(no.$$.fragment,tp),tp.forEach(o),ep.forEach(o),Mi=m(Cr),is=r(Cr,"SPAN",{});var op=a(is);Ai=l(op,"FNetModel"),op.forEach(o),Cr.forEach(o),mr=m(t),A=r(t,"DIV",{class:!0});var Ft=a(A);F(so.$$.fragment,Ft),Ci=m(Ft),ro=r(Ft,"P",{});var Sr=a(ro);Si=l(Sr,`The bare FNet Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ao=r(Sr,"A",{href:!0,rel:!0});var np=a(ao);Li=l(np,"torch.nn.Module"),np.forEach(o),Oi=l(Sr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sr.forEach(o),Ii=m(Ft),io=r(Ft,"P",{});var Lr=a(io);Di=l(Lr,"The model can behave as an encoder, following the architecture described in "),lo=r(Lr,"A",{href:!0,rel:!0});var sp=a(lo);Bi=l(sp,`FNet: Mixing Tokens with Fourier
Transforms`),sp.forEach(o),Wi=l(Lr," by James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon."),Lr.forEach(o),Ui=m(Ft),U=r(Ft,"DIV",{class:!0});var $t=a(U);F(co.$$.fragment,$t),Hi=m($t),ge=r($t,"P",{});var vn=a(ge);Qi=l(vn,"The "),dn=r(vn,"A",{href:!0});var rp=a(dn);Vi=l(rp,"FNetModel"),rp.forEach(o),Ri=l(vn," forward method, overrides the "),ls=r(vn,"CODE",{});var ap=a(ls);Gi=l(ap,"__call__"),ap.forEach(o),Ji=l(vn," special method."),vn.forEach(o),Ki=m($t),F(Ve.$$.fragment,$t),Xi=m($t),F(Re.$$.fragment,$t),$t.forEach(o),Ft.forEach(o),fr=m(t),_e=r(t,"H2",{class:!0});var Or=a(_e);Ge=r(Or,"A",{id:!0,class:!0,href:!0});var ip=a(Ge);cs=r(ip,"SPAN",{});var lp=a(cs);F(po.$$.fragment,lp),lp.forEach(o),ip.forEach(o),Yi=m(Or),ds=r(Or,"SPAN",{});var cp=a(ds);Zi=l(cp,"FNetForPreTraining"),cp.forEach(o),Or.forEach(o),ur=m(t),C=r(t,"DIV",{class:!0});var vt=a(C);F(ho.$$.fragment,vt),el=m(vt),be=r(vt,"P",{});var Tn=a(be);tl=l(Tn,"FNet Model with two heads on top as done during the pretraining: a "),ps=r(Tn,"CODE",{});var dp=a(ps);ol=l(dp,"masked language modeling"),dp.forEach(o),nl=l(Tn," head and a "),hs=r(Tn,"CODE",{});var pp=a(hs);sl=l(pp,"next sentence prediction (classification)"),pp.forEach(o),rl=l(Tn," head."),Tn.forEach(o),al=m(vt),mo=r(vt,"P",{});var Ir=a(mo);il=l(Ir,"This model is a PyTorch "),fo=r(Ir,"A",{href:!0,rel:!0});var hp=a(fo);ll=l(hp,"torch.nn.Module"),hp.forEach(o),cl=l(Ir,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ir.forEach(o),dl=m(vt),H=r(vt,"DIV",{class:!0});var Tt=a(H);F(uo.$$.fragment,Tt),pl=m(Tt),ke=r(Tt,"P",{});var yn=a(ke);hl=l(yn,"The "),pn=r(yn,"A",{href:!0});var mp=a(pn);ml=l(mp,"FNetForPreTraining"),mp.forEach(o),fl=l(yn," forward method, overrides the "),ms=r(yn,"CODE",{});var fp=a(ms);ul=l(fp,"__call__"),fp.forEach(o),gl=l(yn," special method."),yn.forEach(o),_l=m(Tt),F(Je.$$.fragment,Tt),bl=m(Tt),F(Ke.$$.fragment,Tt),Tt.forEach(o),vt.forEach(o),gr=m(t),we=r(t,"H2",{class:!0});var Dr=a(we);Xe=r(Dr,"A",{id:!0,class:!0,href:!0});var up=a(Xe);fs=r(up,"SPAN",{});var gp=a(fs);F(go.$$.fragment,gp),gp.forEach(o),up.forEach(o),kl=m(Dr),us=r(Dr,"SPAN",{});var _p=a(us);wl=l(_p,"FNetForMaskedLM"),_p.forEach(o),Dr.forEach(o),_r=m(t),te=r(t,"DIV",{class:!0});var Nn=a(te);F(_o.$$.fragment,Nn),Fl=m(Nn),Fe=r(Nn,"P",{});var zn=a(Fe);$l=l(zn,"FNet Model with a "),gs=r(zn,"CODE",{});var bp=a(gs);vl=l(bp,"language modeling"),bp.forEach(o),Tl=l(zn,` head on top.
This model is a PyTorch `),bo=r(zn,"A",{href:!0,rel:!0});var kp=a(bo);yl=l(kp,"torch.nn.Module"),kp.forEach(o),Nl=l(zn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zn.forEach(o),zl=m(Nn),Q=r(Nn,"DIV",{class:!0});var yt=a(Q);F(ko.$$.fragment,yt),ql=m(yt),$e=r(yt,"P",{});var qn=a($e);xl=l(qn,"The "),hn=r(qn,"A",{href:!0});var wp=a(hn);El=l(wp,"FNetForMaskedLM"),wp.forEach(o),Pl=l(qn," forward method, overrides the "),_s=r(qn,"CODE",{});var Fp=a(_s);jl=l(Fp,"__call__"),Fp.forEach(o),Ml=l(qn," special method."),qn.forEach(o),Al=m(yt),F(Ye.$$.fragment,yt),Cl=m(yt),F(Ze.$$.fragment,yt),yt.forEach(o),Nn.forEach(o),br=m(t),ve=r(t,"H2",{class:!0});var Br=a(ve);et=r(Br,"A",{id:!0,class:!0,href:!0});var $p=a(et);bs=r($p,"SPAN",{});var vp=a(bs);F(wo.$$.fragment,vp),vp.forEach(o),$p.forEach(o),Sl=m(Br),ks=r(Br,"SPAN",{});var Tp=a(ks);Ll=l(Tp,"FNetForNextSentencePrediction"),Tp.forEach(o),Br.forEach(o),kr=m(t),oe=r(t,"DIV",{class:!0});var xn=a(oe);F(Fo.$$.fragment,xn),Ol=m(xn),Te=r(xn,"P",{});var En=a(Te);Il=l(En,"FNet Model with a "),ws=r(En,"CODE",{});var yp=a(ws);Dl=l(yp,"next sentence prediction (classification)"),yp.forEach(o),Bl=l(En,` head on top.
This model is a PyTorch `),$o=r(En,"A",{href:!0,rel:!0});var Np=a($o);Wl=l(Np,"torch.nn.Module"),Np.forEach(o),Ul=l(En,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),En.forEach(o),Hl=m(xn),V=r(xn,"DIV",{class:!0});var Nt=a(V);F(vo.$$.fragment,Nt),Ql=m(Nt),ye=r(Nt,"P",{});var Pn=a(ye);Vl=l(Pn,"The "),mn=r(Pn,"A",{href:!0});var zp=a(mn);Rl=l(zp,"FNetForNextSentencePrediction"),zp.forEach(o),Gl=l(Pn," forward method, overrides the "),Fs=r(Pn,"CODE",{});var qp=a(Fs);Jl=l(qp,"__call__"),qp.forEach(o),Kl=l(Pn," special method."),Pn.forEach(o),Xl=m(Nt),F(tt.$$.fragment,Nt),Yl=m(Nt),F(ot.$$.fragment,Nt),Nt.forEach(o),xn.forEach(o),wr=m(t),Ne=r(t,"H2",{class:!0});var Wr=a(Ne);nt=r(Wr,"A",{id:!0,class:!0,href:!0});var xp=a(nt);$s=r(xp,"SPAN",{});var Ep=a($s);F(To.$$.fragment,Ep),Ep.forEach(o),xp.forEach(o),Zl=m(Wr),vs=r(Wr,"SPAN",{});var Pp=a(vs);ec=l(Pp,"FNetForSequenceClassification"),Pp.forEach(o),Wr.forEach(o),Fr=m(t),S=r(t,"DIV",{class:!0});var zt=a(S);F(yo.$$.fragment,zt),tc=m(zt),Ts=r(zt,"P",{});var jp=a(Ts);oc=l(jp,`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.`),jp.forEach(o),nc=m(zt),No=r(zt,"P",{});var Ur=a(No);sc=l(Ur,"This model is a PyTorch "),zo=r(Ur,"A",{href:!0,rel:!0});var Mp=a(zo);rc=l(Mp,"torch.nn.Module"),Mp.forEach(o),ac=l(Ur,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ur.forEach(o),ic=m(zt),E=r(zt,"DIV",{class:!0});var ie=a(E);F(qo.$$.fragment,ie),lc=m(ie),ze=r(ie,"P",{});var jn=a(ze);cc=l(jn,"The "),fn=r(jn,"A",{href:!0});var Ap=a(fn);dc=l(Ap,"FNetForSequenceClassification"),Ap.forEach(o),pc=l(jn," forward method, overrides the "),ys=r(jn,"CODE",{});var Cp=a(ys);hc=l(Cp,"__call__"),Cp.forEach(o),mc=l(jn," special method."),jn.forEach(o),fc=m(ie),F(st.$$.fragment,ie),uc=m(ie),F(rt.$$.fragment,ie),gc=m(ie),F(at.$$.fragment,ie),ie.forEach(o),zt.forEach(o),$r=m(t),qe=r(t,"H2",{class:!0});var Hr=a(qe);it=r(Hr,"A",{id:!0,class:!0,href:!0});var Sp=a(it);Ns=r(Sp,"SPAN",{});var Lp=a(Ns);F(xo.$$.fragment,Lp),Lp.forEach(o),Sp.forEach(o),_c=m(Hr),zs=r(Hr,"SPAN",{});var Op=a(zs);bc=l(Op,"FNetForMultipleChoice"),Op.forEach(o),Hr.forEach(o),vr=m(t),L=r(t,"DIV",{class:!0});var qt=a(L);F(Eo.$$.fragment,qt),kc=m(qt),qs=r(qt,"P",{});var Ip=a(qs);wc=l(Ip,`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.`),Ip.forEach(o),Fc=m(qt),Po=r(qt,"P",{});var Qr=a(Po);$c=l(Qr,"This model is a PyTorch "),jo=r(Qr,"A",{href:!0,rel:!0});var Dp=a(jo);vc=l(Dp,"torch.nn.Module"),Dp.forEach(o),Tc=l(Qr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qr.forEach(o),yc=m(qt),R=r(qt,"DIV",{class:!0});var xt=a(R);F(Mo.$$.fragment,xt),Nc=m(xt),xe=r(xt,"P",{});var Mn=a(xe);zc=l(Mn,"The "),un=r(Mn,"A",{href:!0});var Bp=a(un);qc=l(Bp,"FNetForMultipleChoice"),Bp.forEach(o),xc=l(Mn," forward method, overrides the "),xs=r(Mn,"CODE",{});var Wp=a(xs);Ec=l(Wp,"__call__"),Wp.forEach(o),Pc=l(Mn," special method."),Mn.forEach(o),jc=m(xt),F(lt.$$.fragment,xt),Mc=m(xt),F(ct.$$.fragment,xt),xt.forEach(o),qt.forEach(o),Tr=m(t),Ee=r(t,"H2",{class:!0});var Vr=a(Ee);dt=r(Vr,"A",{id:!0,class:!0,href:!0});var Up=a(dt);Es=r(Up,"SPAN",{});var Hp=a(Es);F(Ao.$$.fragment,Hp),Hp.forEach(o),Up.forEach(o),Ac=m(Vr),Ps=r(Vr,"SPAN",{});var Qp=a(Ps);Cc=l(Qp,"FNetForTokenClassification"),Qp.forEach(o),Vr.forEach(o),yr=m(t),O=r(t,"DIV",{class:!0});var Et=a(O);F(Co.$$.fragment,Et),Sc=m(Et),js=r(Et,"P",{});var Vp=a(js);Lc=l(Vp,`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.`),Vp.forEach(o),Oc=m(Et),So=r(Et,"P",{});var Rr=a(So);Ic=l(Rr,"This model is a PyTorch "),Lo=r(Rr,"A",{href:!0,rel:!0});var Rp=a(Lo);Dc=l(Rp,"torch.nn.Module"),Rp.forEach(o),Bc=l(Rr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Rr.forEach(o),Wc=m(Et),G=r(Et,"DIV",{class:!0});var Pt=a(G);F(Oo.$$.fragment,Pt),Uc=m(Pt),Pe=r(Pt,"P",{});var An=a(Pe);Hc=l(An,"The "),gn=r(An,"A",{href:!0});var Gp=a(gn);Qc=l(Gp,"FNetForTokenClassification"),Gp.forEach(o),Vc=l(An," forward method, overrides the "),Ms=r(An,"CODE",{});var Jp=a(Ms);Rc=l(Jp,"__call__"),Jp.forEach(o),Gc=l(An," special method."),An.forEach(o),Jc=m(Pt),F(pt.$$.fragment,Pt),Kc=m(Pt),F(ht.$$.fragment,Pt),Pt.forEach(o),Et.forEach(o),Nr=m(t),je=r(t,"H2",{class:!0});var Gr=a(je);mt=r(Gr,"A",{id:!0,class:!0,href:!0});var Kp=a(mt);As=r(Kp,"SPAN",{});var Xp=a(As);F(Io.$$.fragment,Xp),Xp.forEach(o),Kp.forEach(o),Xc=m(Gr),Cs=r(Gr,"SPAN",{});var Yp=a(Cs);Yc=l(Yp,"FNetForQuestionAnswering"),Yp.forEach(o),Gr.forEach(o),zr=m(t),I=r(t,"DIV",{class:!0});var jt=a(I);F(Do.$$.fragment,jt),Zc=m(jt),Me=r(jt,"P",{});var Cn=a(Me);ed=l(Cn,`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 `),Ss=r(Cn,"CODE",{});var Zp=a(Ss);td=l(Zp,"span start logits"),Zp.forEach(o),od=l(Cn," and "),Ls=r(Cn,"CODE",{});var eh=a(Ls);nd=l(eh,"span end logits"),eh.forEach(o),sd=l(Cn,")."),Cn.forEach(o),rd=m(jt),Bo=r(jt,"P",{});var Jr=a(Bo);ad=l(Jr,"This model is a PyTorch "),Wo=r(Jr,"A",{href:!0,rel:!0});var th=a(Wo);id=l(th,"torch.nn.Module"),th.forEach(o),ld=l(Jr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jr.forEach(o),cd=m(jt),J=r(jt,"DIV",{class:!0});var Mt=a(J);F(Uo.$$.fragment,Mt),dd=m(Mt),Ae=r(Mt,"P",{});var Sn=a(Ae);pd=l(Sn,"The "),_n=r(Sn,"A",{href:!0});var oh=a(_n);hd=l(oh,"FNetForQuestionAnswering"),oh.forEach(o),md=l(Sn," forward method, overrides the "),Os=r(Sn,"CODE",{});var nh=a(Os);fd=l(nh,"__call__"),nh.forEach(o),ud=l(Sn," special method."),Sn.forEach(o),gd=m(Mt),F(ft.$$.fragment,Mt),_d=m(Mt),F(ut.$$.fragment,Mt),Mt.forEach(o),jt.forEach(o),this.h()},h(){f(c,"name","hf:doc:metadata"),f(c,"content",JSON.stringify(Eh)),f(p,"id","fnet"),f(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"),f(p,"href","#fnet"),f(u,"class","relative group"),f(Se,"id","overview"),f(Se,"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"),f(Se,"href","#overview"),f(le,"class","relative group"),f(St,"href","https://arxiv.org/abs/2105.03824"),f(St,"rel","nofollow"),f(Lt,"href","https://huggingface.co/gchhablani"),f(Lt,"rel","nofollow"),f(Ot,"href","https://github.com/google-research/google-research/tree/master/f_net"),f(Ot,"rel","nofollow"),f(Oe,"id","transformers.FNetConfig"),f(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"),f(Oe,"href","#transformers.FNetConfig"),f(ce,"class","relative group"),f(Xo,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetModel"),f(Bt,"href","https://huggingface.co/google/fnet-base"),f(Bt,"rel","nofollow"),f(Yo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(Zo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(De,"id","transformers.FNetTokenizer"),f(De,"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"),f(De,"href","#transformers.FNetTokenizer"),f(he,"class","relative group"),f(en,"href","/docs/transformers/main/en/model_doc/albert#transformers.AlbertTokenizer"),f(Ht,"href","https://github.com/google/sentencepiece"),f(Ht,"rel","nofollow"),f(tn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),f(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(sn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ue,"id","transformers.FNetTokenizerFast"),f(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"),f(Ue,"href","#transformers.FNetTokenizerFast"),f(fe,"class","relative group"),f(rn,"href","/docs/transformers/main/en/model_doc/albert#transformers.AlbertTokenizerFast"),f(Zt,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),f(Zt,"rel","nofollow"),f(an,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),f(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Qe,"id","transformers.FNetModel"),f(Qe,"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"),f(Qe,"href","#transformers.FNetModel"),f(ue,"class","relative group"),f(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ao,"rel","nofollow"),f(lo,"href","https://arxiv.org/abs/2105.03824"),f(lo,"rel","nofollow"),f(dn,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetModel"),f(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ge,"id","transformers.FNetForPreTraining"),f(Ge,"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"),f(Ge,"href","#transformers.FNetForPreTraining"),f(_e,"class","relative group"),f(fo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(fo,"rel","nofollow"),f(pn,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForPreTraining"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xe,"id","transformers.FNetForMaskedLM"),f(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Xe,"href","#transformers.FNetForMaskedLM"),f(we,"class","relative group"),f(bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(bo,"rel","nofollow"),f(hn,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForMaskedLM"),f(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(et,"id","transformers.FNetForNextSentencePrediction"),f(et,"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"),f(et,"href","#transformers.FNetForNextSentencePrediction"),f(ve,"class","relative group"),f($o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f($o,"rel","nofollow"),f(mn,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForNextSentencePrediction"),f(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(nt,"id","transformers.FNetForSequenceClassification"),f(nt,"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"),f(nt,"href","#transformers.FNetForSequenceClassification"),f(Ne,"class","relative group"),f(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(zo,"rel","nofollow"),f(fn,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForSequenceClassification"),f(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(it,"id","transformers.FNetForMultipleChoice"),f(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"),f(it,"href","#transformers.FNetForMultipleChoice"),f(qe,"class","relative group"),f(jo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(jo,"rel","nofollow"),f(un,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForMultipleChoice"),f(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(dt,"id","transformers.FNetForTokenClassification"),f(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(dt,"href","#transformers.FNetForTokenClassification"),f(Ee,"class","relative group"),f(Lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Lo,"rel","nofollow"),f(gn,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForTokenClassification"),f(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mt,"id","transformers.FNetForQuestionAnswering"),f(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"),f(mt,"href","#transformers.FNetForQuestionAnswering"),f(je,"class","relative group"),f(Wo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Wo,"rel","nofollow"),f(_n,"href","/docs/transformers/main/en/model_doc/fnet#transformers.FNetForQuestionAnswering"),f(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(I,"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,_),$(n,_,null),e(u,d),e(u,z),e(z,Kr),b(t,er,g),b(t,le,g),e(le,Se),e(Se,Ln),$(Ct,Ln,null),e(le,Xr),e(le,On),e(On,Yr),b(t,tr,g),b(t,Le,g),e(Le,Zr),e(Le,St),e(St,ea),e(Le,ta),b(t,or,g),b(t,Go,g),e(Go,In),e(In,oa),b(t,nr,g),b(t,Jo,g),e(Jo,na),b(t,sr,g),b(t,Ko,g),e(Ko,Dn),e(Dn,sa),b(t,rr,g),b(t,ne,g),e(ne,ra),e(ne,Lt),e(Lt,aa),e(ne,ia),e(ne,Ot),e(Ot,la),e(ne,ca),b(t,ar,g),b(t,ce,g),e(ce,Oe),e(Oe,Bn),$(It,Bn,null),e(ce,da),e(ce,Wn),e(Wn,pa),b(t,ir,g),b(t,P,g),$(Dt,P,null),e(P,ha),e(P,de),e(de,ma),e(de,Xo),e(Xo,fa),e(de,ua),e(de,Bt),e(Bt,ga),e(de,_a),e(P,ba),e(P,pe),e(pe,ka),e(pe,Yo),e(Yo,wa),e(pe,Fa),e(pe,Zo),e(Zo,$a),e(pe,va),e(P,Ta),$(Ie,P,null),b(t,lr,g),b(t,he,g),e(he,De),e(De,Un),$(Wt,Un,null),e(he,ya),e(he,Hn),e(Hn,Na),b(t,cr,g),b(t,x,g),$(Ut,x,null),e(x,za),e(x,ee),e(ee,qa),e(ee,en),e(en,xa),e(ee,Ea),e(ee,Ht),e(Ht,Pa),e(ee,ja),e(ee,tn),e(tn,Ma),e(ee,Aa),e(x,Ca),e(x,se),$(Qt,se,null),e(se,Sa),e(se,Qn),e(Qn,La),e(se,Oa),e(se,Vt),e(Vt,on),e(on,Ia),e(on,Vn),e(Vn,Da),e(Vt,Ba),e(Vt,nn),e(nn,Wa),e(nn,Rn),e(Rn,Ua),e(x,Ha),e(x,Be),$(Rt,Be,null),e(Be,Qa),e(Be,Gt),e(Gt,Va),e(Gt,Gn),e(Gn,Ra),e(Gt,Ga),e(x,Ja),e(x,B),$(Jt,B,null),e(B,Ka),e(B,Jn),e(Jn,Xa),e(B,Ya),$(We,B,null),e(B,Za),e(B,me),e(me,ei),e(me,Kn),e(Kn,ti),e(me,oi),e(me,Xn),e(Xn,ni),e(me,si),e(x,ri),e(x,sn),$(Kt,sn,null),b(t,dr,g),b(t,fe,g),e(fe,Ue),e(Ue,Yn),$(Xt,Yn,null),e(fe,ai),e(fe,Zn),e(Zn,ii),b(t,pr,g),b(t,j,g),$(Yt,j,null),e(j,li),e(j,M),e(M,ci),e(M,es),e(es,di),e(M,pi),e(M,rn),e(rn,hi),e(M,mi),e(M,Zt),e(Zt,fi),e(M,ui),e(M,an),e(an,gi),e(M,_i),e(j,bi),e(j,re),$(eo,re,null),e(re,ki),e(re,ts),e(ts,wi),e(re,Fi),e(re,to),e(to,ln),e(ln,$i),e(ln,os),e(os,vi),e(to,Ti),e(to,cn),e(cn,yi),e(cn,ns),e(ns,Ni),e(j,zi),e(j,W),$(oo,W,null),e(W,qi),e(W,ss),e(ss,xi),e(W,Ei),$(He,W,null),e(W,Pi),e(W,rs),e(rs,ji),b(t,hr,g),b(t,ue,g),e(ue,Qe),e(Qe,as),$(no,as,null),e(ue,Mi),e(ue,is),e(is,Ai),b(t,mr,g),b(t,A,g),$(so,A,null),e(A,Ci),e(A,ro),e(ro,Si),e(ro,ao),e(ao,Li),e(ro,Oi),e(A,Ii),e(A,io),e(io,Di),e(io,lo),e(lo,Bi),e(io,Wi),e(A,Ui),e(A,U),$(co,U,null),e(U,Hi),e(U,ge),e(ge,Qi),e(ge,dn),e(dn,Vi),e(ge,Ri),e(ge,ls),e(ls,Gi),e(ge,Ji),e(U,Ki),$(Ve,U,null),e(U,Xi),$(Re,U,null),b(t,fr,g),b(t,_e,g),e(_e,Ge),e(Ge,cs),$(po,cs,null),e(_e,Yi),e(_e,ds),e(ds,Zi),b(t,ur,g),b(t,C,g),$(ho,C,null),e(C,el),e(C,be),e(be,tl),e(be,ps),e(ps,ol),e(be,nl),e(be,hs),e(hs,sl),e(be,rl),e(C,al),e(C,mo),e(mo,il),e(mo,fo),e(fo,ll),e(mo,cl),e(C,dl),e(C,H),$(uo,H,null),e(H,pl),e(H,ke),e(ke,hl),e(ke,pn),e(pn,ml),e(ke,fl),e(ke,ms),e(ms,ul),e(ke,gl),e(H,_l),$(Je,H,null),e(H,bl),$(Ke,H,null),b(t,gr,g),b(t,we,g),e(we,Xe),e(Xe,fs),$(go,fs,null),e(we,kl),e(we,us),e(us,wl),b(t,_r,g),b(t,te,g),$(_o,te,null),e(te,Fl),e(te,Fe),e(Fe,$l),e(Fe,gs),e(gs,vl),e(Fe,Tl),e(Fe,bo),e(bo,yl),e(Fe,Nl),e(te,zl),e(te,Q),$(ko,Q,null),e(Q,ql),e(Q,$e),e($e,xl),e($e,hn),e(hn,El),e($e,Pl),e($e,_s),e(_s,jl),e($e,Ml),e(Q,Al),$(Ye,Q,null),e(Q,Cl),$(Ze,Q,null),b(t,br,g),b(t,ve,g),e(ve,et),e(et,bs),$(wo,bs,null),e(ve,Sl),e(ve,ks),e(ks,Ll),b(t,kr,g),b(t,oe,g),$(Fo,oe,null),e(oe,Ol),e(oe,Te),e(Te,Il),e(Te,ws),e(ws,Dl),e(Te,Bl),e(Te,$o),e($o,Wl),e(Te,Ul),e(oe,Hl),e(oe,V),$(vo,V,null),e(V,Ql),e(V,ye),e(ye,Vl),e(ye,mn),e(mn,Rl),e(ye,Gl),e(ye,Fs),e(Fs,Jl),e(ye,Kl),e(V,Xl),$(tt,V,null),e(V,Yl),$(ot,V,null),b(t,wr,g),b(t,Ne,g),e(Ne,nt),e(nt,$s),$(To,$s,null),e(Ne,Zl),e(Ne,vs),e(vs,ec),b(t,Fr,g),b(t,S,g),$(yo,S,null),e(S,tc),e(S,Ts),e(Ts,oc),e(S,nc),e(S,No),e(No,sc),e(No,zo),e(zo,rc),e(No,ac),e(S,ic),e(S,E),$(qo,E,null),e(E,lc),e(E,ze),e(ze,cc),e(ze,fn),e(fn,dc),e(ze,pc),e(ze,ys),e(ys,hc),e(ze,mc),e(E,fc),$(st,E,null),e(E,uc),$(rt,E,null),e(E,gc),$(at,E,null),b(t,$r,g),b(t,qe,g),e(qe,it),e(it,Ns),$(xo,Ns,null),e(qe,_c),e(qe,zs),e(zs,bc),b(t,vr,g),b(t,L,g),$(Eo,L,null),e(L,kc),e(L,qs),e(qs,wc),e(L,Fc),e(L,Po),e(Po,$c),e(Po,jo),e(jo,vc),e(Po,Tc),e(L,yc),e(L,R),$(Mo,R,null),e(R,Nc),e(R,xe),e(xe,zc),e(xe,un),e(un,qc),e(xe,xc),e(xe,xs),e(xs,Ec),e(xe,Pc),e(R,jc),$(lt,R,null),e(R,Mc),$(ct,R,null),b(t,Tr,g),b(t,Ee,g),e(Ee,dt),e(dt,Es),$(Ao,Es,null),e(Ee,Ac),e(Ee,Ps),e(Ps,Cc),b(t,yr,g),b(t,O,g),$(Co,O,null),e(O,Sc),e(O,js),e(js,Lc),e(O,Oc),e(O,So),e(So,Ic),e(So,Lo),e(Lo,Dc),e(So,Bc),e(O,Wc),e(O,G),$(Oo,G,null),e(G,Uc),e(G,Pe),e(Pe,Hc),e(Pe,gn),e(gn,Qc),e(Pe,Vc),e(Pe,Ms),e(Ms,Rc),e(Pe,Gc),e(G,Jc),$(pt,G,null),e(G,Kc),$(ht,G,null),b(t,Nr,g),b(t,je,g),e(je,mt),e(mt,As),$(Io,As,null),e(je,Xc),e(je,Cs),e(Cs,Yc),b(t,zr,g),b(t,I,g),$(Do,I,null),e(I,Zc),e(I,Me),e(Me,ed),e(Me,Ss),e(Ss,td),e(Me,od),e(Me,Ls),e(Ls,nd),e(Me,sd),e(I,rd),e(I,Bo),e(Bo,ad),e(Bo,Wo),e(Wo,id),e(Bo,ld),e(I,cd),e(I,J),$(Uo,J,null),e(J,dd),e(J,Ae),e(Ae,pd),e(Ae,_n),e(_n,hd),e(Ae,md),e(Ae,Os),e(Os,fd),e(Ae,ud),e(J,gd),$(ft,J,null),e(J,_d),$(ut,J,null),qr=!0},p(t,[g]){const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:t}),Ie.$set(Ho);const Is={};g&2&&(Is.$$scope={dirty:g,ctx:t}),We.$set(Is);const Ds={};g&2&&(Ds.$$scope={dirty:g,ctx:t}),He.$set(Ds);const Bs={};g&2&&(Bs.$$scope={dirty:g,ctx:t}),Ve.$set(Bs);const Qo={};g&2&&(Qo.$$scope={dirty:g,ctx:t}),Re.$set(Qo);const Ws={};g&2&&(Ws.$$scope={dirty:g,ctx:t}),Je.$set(Ws);const Us={};g&2&&(Us.$$scope={dirty:g,ctx:t}),Ke.$set(Us);const Hs={};g&2&&(Hs.$$scope={dirty:g,ctx:t}),Ye.$set(Hs);const Vo={};g&2&&(Vo.$$scope={dirty:g,ctx:t}),Ze.$set(Vo);const Qs={};g&2&&(Qs.$$scope={dirty:g,ctx:t}),tt.$set(Qs);const Vs={};g&2&&(Vs.$$scope={dirty:g,ctx:t}),ot.$set(Vs);const Rs={};g&2&&(Rs.$$scope={dirty:g,ctx:t}),st.$set(Rs);const Gs={};g&2&&(Gs.$$scope={dirty:g,ctx:t}),rt.$set(Gs);const Js={};g&2&&(Js.$$scope={dirty:g,ctx:t}),at.$set(Js);const Ks={};g&2&&(Ks.$$scope={dirty:g,ctx:t}),lt.$set(Ks);const Ce={};g&2&&(Ce.$$scope={dirty:g,ctx:t}),ct.$set(Ce);const Xs={};g&2&&(Xs.$$scope={dirty:g,ctx:t}),pt.$set(Xs);const Ys={};g&2&&(Ys.$$scope={dirty:g,ctx:t}),ht.$set(Ys);const Ro={};g&2&&(Ro.$$scope={dirty:g,ctx:t}),ft.$set(Ro);const Zs={};g&2&&(Zs.$$scope={dirty:g,ctx:t}),ut.$set(Zs)},i(t){qr||(v(n.$$.fragment,t),v(Ct.$$.fragment,t),v(It.$$.fragment,t),v(Dt.$$.fragment,t),v(Ie.$$.fragment,t),v(Wt.$$.fragment,t),v(Ut.$$.fragment,t),v(Qt.$$.fragment,t),v(Rt.$$.fragment,t),v(Jt.$$.fragment,t),v(We.$$.fragment,t),v(Kt.$$.fragment,t),v(Xt.$$.fragment,t),v(Yt.$$.fragment,t),v(eo.$$.fragment,t),v(oo.$$.fragment,t),v(He.$$.fragment,t),v(no.$$.fragment,t),v(so.$$.fragment,t),v(co.$$.fragment,t),v(Ve.$$.fragment,t),v(Re.$$.fragment,t),v(po.$$.fragment,t),v(ho.$$.fragment,t),v(uo.$$.fragment,t),v(Je.$$.fragment,t),v(Ke.$$.fragment,t),v(go.$$.fragment,t),v(_o.$$.fragment,t),v(ko.$$.fragment,t),v(Ye.$$.fragment,t),v(Ze.$$.fragment,t),v(wo.$$.fragment,t),v(Fo.$$.fragment,t),v(vo.$$.fragment,t),v(tt.$$.fragment,t),v(ot.$$.fragment,t),v(To.$$.fragment,t),v(yo.$$.fragment,t),v(qo.$$.fragment,t),v(st.$$.fragment,t),v(rt.$$.fragment,t),v(at.$$.fragment,t),v(xo.$$.fragment,t),v(Eo.$$.fragment,t),v(Mo.$$.fragment,t),v(lt.$$.fragment,t),v(ct.$$.fragment,t),v(Ao.$$.fragment,t),v(Co.$$.fragment,t),v(Oo.$$.fragment,t),v(pt.$$.fragment,t),v(ht.$$.fragment,t),v(Io.$$.fragment,t),v(Do.$$.fragment,t),v(Uo.$$.fragment,t),v(ft.$$.fragment,t),v(ut.$$.fragment,t),qr=!0)},o(t){T(n.$$.fragment,t),T(Ct.$$.fragment,t),T(It.$$.fragment,t),T(Dt.$$.fragment,t),T(Ie.$$.fragment,t),T(Wt.$$.fragment,t),T(Ut.$$.fragment,t),T(Qt.$$.fragment,t),T(Rt.$$.fragment,t),T(Jt.$$.fragment,t),T(We.$$.fragment,t),T(Kt.$$.fragment,t),T(Xt.$$.fragment,t),T(Yt.$$.fragment,t),T(eo.$$.fragment,t),T(oo.$$.fragment,t),T(He.$$.fragment,t),T(no.$$.fragment,t),T(so.$$.fragment,t),T(co.$$.fragment,t),T(Ve.$$.fragment,t),T(Re.$$.fragment,t),T(po.$$.fragment,t),T(ho.$$.fragment,t),T(uo.$$.fragment,t),T(Je.$$.fragment,t),T(Ke.$$.fragment,t),T(go.$$.fragment,t),T(_o.$$.fragment,t),T(ko.$$.fragment,t),T(Ye.$$.fragment,t),T(Ze.$$.fragment,t),T(wo.$$.fragment,t),T(Fo.$$.fragment,t),T(vo.$$.fragment,t),T(tt.$$.fragment,t),T(ot.$$.fragment,t),T(To.$$.fragment,t),T(yo.$$.fragment,t),T(qo.$$.fragment,t),T(st.$$.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(Ao.$$.fragment,t),T(Co.$$.fragment,t),T(Oo.$$.fragment,t),T(pt.$$.fragment,t),T(ht.$$.fragment,t),T(Io.$$.fragment,t),T(Do.$$.fragment,t),T(Uo.$$.fragment,t),T(ft.$$.fragment,t),T(ut.$$.fragment,t),qr=!1},d(t){o(c),t&&o(k),t&&o(u),y(n),t&&o(er),t&&o(le),y(Ct),t&&o(tr),t&&o(Le),t&&o(or),t&&o(Go),t&&o(nr),t&&o(Jo),t&&o(sr),t&&o(Ko),t&&o(rr),t&&o(ne),t&&o(ar),t&&o(ce),y(It),t&&o(ir),t&&o(P),y(Dt),y(Ie),t&&o(lr),t&&o(he),y(Wt),t&&o(cr),t&&o(x),y(Ut),y(Qt),y(Rt),y(Jt),y(We),y(Kt),t&&o(dr),t&&o(fe),y(Xt),t&&o(pr),t&&o(j),y(Yt),y(eo),y(oo),y(He),t&&o(hr),t&&o(ue),y(no),t&&o(mr),t&&o(A),y(so),y(co),y(Ve),y(Re),t&&o(fr),t&&o(_e),y(po),t&&o(ur),t&&o(C),y(ho),y(uo),y(Je),y(Ke),t&&o(gr),t&&o(we),y(go),t&&o(_r),t&&o(te),y(_o),y(ko),y(Ye),y(Ze),t&&o(br),t&&o(ve),y(wo),t&&o(kr),t&&o(oe),y(Fo),y(vo),y(tt),y(ot),t&&o(wr),t&&o(Ne),y(To),t&&o(Fr),t&&o(S),y(yo),y(qo),y(st),y(rt),y(at),t&&o($r),t&&o(qe),y(xo),t&&o(vr),t&&o(L),y(Eo),y(Mo),y(lt),y(ct),t&&o(Tr),t&&o(Ee),y(Ao),t&&o(yr),t&&o(O),y(Co),y(Oo),y(pt),y(ht),t&&o(Nr),t&&o(je),y(Io),t&&o(zr),t&&o(I),y(Do),y(Uo),y(ft),y(ut)}}}const Eh={local:"fnet",sections:[{local:"overview",title:"Overview"},{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 Ph(N){return lh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oh extends sh{constructor(c){super();rh(this,c,Ph,xh,ah,{})}}export{Oh as default,Eh as metadata};
