import{S as nM,i as aM,s as iM,e as r,k as c,w as _,t as a,M as lM,c as s,d as t,m as d,a as n,x as y,h as i,b as l,N as cM,G as e,g as h,y as b,q as w,o as M,B as P,v as dM,L as $o}from"../../chunks/vendor-hf-doc-builder.js";import{T as At}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as jo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as C}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function pM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBlcmNlaXZlck1vZGVsJTJDJTIwUGVyY2VpdmVyQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFBlcmNlaXZlciUyMGRlZXBtaW5kJTJGbGFuZ3VhZ2UtcGVyY2VpdmVyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFBlcmNlaXZlckNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGRlZXBtaW5kJTJGbGFuZ3VhZ2UtcGVyY2VpdmVyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBQZXJjZWl2ZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PerceiverModel, PerceiverConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Perceiver deepmind/language-perceiver style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = PerceiverConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the deepmind/language-perceiver style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverModel(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(){u=r("p"),k=a("Example:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Example:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function mM(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function hM(j){let u,k,v,g,T;return g=new jo({props:{code:" ",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PerceiverConfig, PerceiverTokenizer, PerceiverImageProcessor, PerceiverModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.perceiver.modeling_perceiver <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    PerceiverTextPreprocessor,
<span class="hljs-meta">... </span>    PerceiverImagePreprocessor,
<span class="hljs-meta">... </span>    PerceiverClassificationDecoder,
<span class="hljs-meta">... </span>)
<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">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># EXAMPLE 1: using the Perceiver to classify texts</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># - we define a TextPreprocessor, which can be used to embed tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># - we define a ClassificationDecoder, which can be used to decode the</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># final hidden states of the latents to classification logits</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># using trainable position embeddings</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = PerceiverConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>preprocessor = PerceiverTextPreprocessor(config)
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder = PerceiverClassificationDecoder(
<span class="hljs-meta">... </span>    config,
<span class="hljs-meta">... </span>    num_channels=config.d_latents,
<span class="hljs-meta">... </span>    trainable_position_encoding_kwargs=<span class="hljs-built_in">dict</span>(num_channels=config.d_latents, index_dims=<span class="hljs-number">1</span>),
<span class="hljs-meta">... </span>    use_query_residual=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverModel(config, input_preprocessor=preprocessor, decoder=decoder)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># you can then do a forward pass as follows:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PerceiverTokenizer()
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;hello world&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<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=inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># to train, one can train the model using standard cross-entropy:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>criterion = torch.nn.CrossEntropyLoss()

<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 = criterion(logits, labels)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># EXAMPLE 2: using the Perceiver to classify images</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># - we define an ImagePreprocessor, which can be used to embed images</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = PerceiverConfig(image_size=<span class="hljs-number">224</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preprocessor = PerceiverImagePreprocessor(
<span class="hljs-meta">... </span>    config,
<span class="hljs-meta">... </span>    prep_type=<span class="hljs-string">&quot;conv1x1&quot;</span>,
<span class="hljs-meta">... </span>    spatial_downsample=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    out_channels=<span class="hljs-number">256</span>,
<span class="hljs-meta">... </span>    position_encoding_type=<span class="hljs-string">&quot;trainable&quot;</span>,
<span class="hljs-meta">... </span>    concat_or_add_pos=<span class="hljs-string">&quot;concat&quot;</span>,
<span class="hljs-meta">... </span>    project_pos_dim=<span class="hljs-number">256</span>,
<span class="hljs-meta">... </span>    trainable_position_encoding_kwargs=<span class="hljs-built_in">dict</span>(
<span class="hljs-meta">... </span>        num_channels=<span class="hljs-number">256</span>,
<span class="hljs-meta">... </span>        index_dims=config.image_size**<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    ),
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverModel(
<span class="hljs-meta">... </span>    config,
<span class="hljs-meta">... </span>    input_preprocessor=preprocessor,
<span class="hljs-meta">... </span>    decoder=PerceiverClassificationDecoder(
<span class="hljs-meta">... </span>        config,
<span class="hljs-meta">... </span>        num_channels=config.d_latents,
<span class="hljs-meta">... </span>        trainable_position_encoding_kwargs=<span class="hljs-built_in">dict</span>(num_channels=config.d_latents, index_dims=<span class="hljs-number">1</span>),
<span class="hljs-meta">... </span>        use_query_residual=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    ),
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># you can then do a forward pass as follows:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = PerceiverImageProcessor()
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<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=inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># to train, one can train the model using standard cross-entropy:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>criterion = torch.nn.CrossEntropyLoss()

<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 = criterion(logits, labels)`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function uM(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function fM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQZXJjZWl2ZXJGb3JNYXNrZWRMTSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZGVlcG1pbmQlMkZsYW5ndWFnZS1wZXJjZWl2ZXIlMjIpJTBBbW9kZWwlMjAlM0QlMjBQZXJjZWl2ZXJGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGVlcG1pbmQlMkZsYW5ndWFnZS1wZXJjZWl2ZXIlMjIpJTBBJTBBJTIzJTIwdHJhaW5pbmclMEF0ZXh0JTIwJTNEJTIwJTIyVGhpcyUyMGlzJTIwYW4lMjBpbmNvbXBsZXRlJTIwc2VudGVuY2UlMjB3aGVyZSUyMHNvbWUlMjB3b3JkcyUyMGFyZSUyMG1pc3NpbmcuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBwYWRkaW5nJTNEJTIybWF4X2xlbmd0aCUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTIzJTIwbWFzayUyMCUyMiUyMG1pc3NpbmcuJTIyJTBBaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTVCMCUyQyUyMDUyJTNBNjElNUQlMjAlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCUwQWxhYmVscyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcGFkZGluZyUzRCUyMm1heF9sZW5ndGglMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMiklMEElMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWxpc3QobG9naXRzLnNoYXBlKSUwQSUwQSUyMyUyMGluZmVyZW5jZSUwQXRleHQlMjAlM0QlMjAlMjJUaGlzJTIwaXMlMjBhbiUyMGluY29tcGxldGUlMjBzZW50ZW5jZSUyMHdoZXJlJTIwc29tZSUyMHdvcmRzJTIwYXJlJTIwbWlzc2luZy4lMjIlMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcGFkZGluZyUzRCUyMm1heF9sZW5ndGglMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMG1hc2slMjBieXRlcyUyMGNvcnJlc3BvbmRpbmclMjB0byUyMCUyMiUyMG1pc3NpbmcuJTIyLiUyME5vdGUlMjB0aGF0JTIwdGhlJTIwbW9kZWwlMjBwZXJmb3JtcyUyMG11Y2glMjBiZXR0ZXIlMjBpZiUyMHRoZSUyMG1hc2tlZCUyMHNwYW4lMjBzdGFydHMlMjB3aXRoJTIwYSUyMHNwYWNlLiUwQWVuY29kaW5nJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTVCMCUyQyUyMDUyJTNBNjElNUQlMjAlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCUwQSUwQSUyMyUyMGZvcndhcmQlMjBwYXNzJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmVuY29kaW5nKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBbGlzdChsb2dpdHMuc2hhcGUpJTBBJTBBbWFza2VkX3Rva2Vuc19wcmVkaWN0aW9ucyUyMCUzRCUyMGxvZ2l0cyU1QjAlMkMlMjA1MiUzQTYxJTVELmFyZ21heChkaW0lM0QtMSkudG9saXN0KCklMEF0b2tlbml6ZXIuZGVjb2RlKG1hc2tlZF90b2tlbnNfcHJlZGljdGlvbnMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PerceiverForMaskedLM
<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;deepmind/language-perceiver&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForMaskedLM.from_pretrained(<span class="hljs-string">&quot;deepmind/language-perceiver&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;This is an incomplete sentence where some words are missing.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, padding=<span class="hljs-string">&quot;max_length&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask &quot; missing.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>, <span class="hljs-number">52</span>:<span class="hljs-number">61</span>] = tokenizer.mask_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(text, padding=<span class="hljs-string">&quot;max_length&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">19.87</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2048</span>, <span class="hljs-number">262</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;This is an incomplete sentence where some words are missing.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(text, padding=<span class="hljs-string">&quot;max_length&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask bytes corresponding to &quot; missing.&quot;. Note that the model performs much better if the masked span starts with a space.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>, <span class="hljs-number">52</span>:<span class="hljs-number">61</span>] = tokenizer.mask_token_id

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</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(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2048</span>, <span class="hljs-number">262</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>masked_tokens_predictions = logits[<span class="hljs-number">0</span>, <span class="hljs-number">52</span>:<span class="hljs-number">61</span>].argmax(dim=-<span class="hljs-number">1</span>).tolist()
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(masked_tokens_predictions)
<span class="hljs-string">&#x27; missing.&#x27;</span>`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function gM(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function vM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQZXJjZWl2ZXJGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZGVlcG1pbmQlMkZsYW5ndWFnZS1wZXJjZWl2ZXIlMjIpJTBBbW9kZWwlMjAlM0QlMjBQZXJjZWl2ZXJGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRmxhbmd1YWdlLXBlcmNlaXZlciUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyaGVsbG8lMjB3b3JsZCUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyUzRGlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWxpc3QobG9naXRzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PerceiverForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;deepmind/language-perceiver&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;deepmind/language-perceiver&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;hello world&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs=inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function _M(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function yM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBlcmNlaXZlckZvckltYWdlQ2xhc3NpZmljYXRpb25MZWFybmVkJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRnZpc2lvbi1wZXJjZWl2ZXItbGVhcm5lZCUyMiklMEFtb2RlbCUyMCUzRCUyMFBlcmNlaXZlckZvckltYWdlQ2xhc3NpZmljYXRpb25MZWFybmVkLmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRnZpc2lvbi1wZXJjZWl2ZXItbGVhcm5lZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzJTNEaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBbGlzdChsb2dpdHMuc2hhcGUpJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9jbGFzc19pZHglMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZHglNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PerceiverForImageClassificationLearned
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;deepmind/vision-perceiver-learned&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForImageClassificationLearned.from_pretrained(<span class="hljs-string">&quot;deepmind/vision-perceiver-learned&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs=inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">1000</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])
Predicted <span class="hljs-keyword">class</span>: tabby, tabby cat`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function bM(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function wM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBlcmNlaXZlckZvckltYWdlQ2xhc3NpZmljYXRpb25Gb3VyaWVyJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRnZpc2lvbi1wZXJjZWl2ZXItZm91cmllciUyMiklMEFtb2RlbCUyMCUzRCUyMFBlcmNlaXZlckZvckltYWdlQ2xhc3NpZmljYXRpb25Gb3VyaWVyLmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRnZpc2lvbi1wZXJjZWl2ZXItZm91cmllciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzJTNEaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBbGlzdChsb2dpdHMuc2hhcGUpJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9jbGFzc19pZHglMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZHglNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PerceiverForImageClassificationFourier
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;deepmind/vision-perceiver-fourier&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForImageClassificationFourier.from_pretrained(<span class="hljs-string">&quot;deepmind/vision-perceiver-fourier&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs=inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">1000</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])
Predicted <span class="hljs-keyword">class</span>: tabby, tabby cat`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function MM(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function PM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFBlcmNlaXZlckZvckltYWdlQ2xhc3NpZmljYXRpb25Db252UHJvY2Vzc2luZyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZGVlcG1pbmQlMkZ2aXNpb24tcGVyY2VpdmVyLWNvbnYlMjIpJTBBbW9kZWwlMjAlM0QlMjBQZXJjZWl2ZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uQ29udlByb2Nlc3NpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmRlZXBtaW5kJTJGdmlzaW9uLXBlcmNlaXZlci1jb252JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMlM0RpbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFsaXN0KGxvZ2l0cy5zaGFwZSklMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2NsYXNzX2lkeCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KCUyMlByZWRpY3RlZCUyMGNsYXNzJTNBJTIyJTJDJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2NsYXNzX2lkeCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, PerceiverForImageClassificationConvProcessing
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;deepmind/vision-perceiver-conv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForImageClassificationConvProcessing.from_pretrained(<span class="hljs-string">&quot;deepmind/vision-perceiver-conv&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs=inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">1000</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])
Predicted <span class="hljs-keyword">class</span>: tabby, tabby cat`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function TM(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function kM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBlcmNlaXZlckZvck9wdGljYWxGbG93JTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbCUyMCUzRCUyMFBlcmNlaXZlckZvck9wdGljYWxGbG93LmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRm9wdGljYWwtZmxvdy1wZXJjZWl2ZXIlMjIpJTBBJTBBJTIzJTIwaW4lMjB0aGUlMjBQZXJjZWl2ZXIlMjBJTyUyMHBhcGVyJTJDJTIwdGhlJTIwYXV0aG9ycyUyMGV4dHJhY3QlMjBhJTIwMyUyMHglMjAzJTIwcGF0Y2glMjBhcm91bmQlMjBlYWNoJTIwcGl4ZWwlMkMlMEElMjMlMjBsZWFkaW5nJTIwdG8lMjAzJTIweCUyMDMlMjB4JTIwMyUyMCUzRCUyMDI3JTIwdmFsdWVzJTIwZm9yJTIwZWFjaCUyMHBpeGVsJTIwKGFzJTIwZWFjaCUyMHBpeGVsJTIwYWxzbyUyMGhhcyUyMDMlMjBjb2xvciUyMGNoYW5uZWxzKSUwQSUyMyUyMHBhdGNoZXMlMjBoYXZlJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9mcmFtZXMlMkMlMjBudW1fY2hhbm5lbHMlMkMlMjBoZWlnaHQlMkMlMjB3aWR0aCklMEElMjMlMjB0aGUlMjBhdXRob3JzJTIwdHJhaW4lMjBvbiUyMHJlc29sdXRpb25zJTIwb2YlMjAzNjglMjB4JTIwNDk2JTBBcGF0Y2hlcyUyMCUzRCUyMHRvcmNoLnJhbmRuKDElMkMlMjAyJTJDJTIwMjclMkMlMjAzNjglMkMlMjA0OTYpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyUzRHBhdGNoZXMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFsaXN0KGxvZ2l0cy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PerceiverForOpticalFlow
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForOpticalFlow.from_pretrained(<span class="hljs-string">&quot;deepmind/optical-flow-perceiver&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># in the Perceiver IO paper, the authors extract a 3 x 3 patch around each pixel,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># leading to 3 x 3 x 3 = 27 values for each pixel (as each pixel also has 3 color channels)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># patches have shape (batch_size, num_frames, num_channels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the authors train on resolutions of 368 x 496</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>patches = torch.randn(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">27</span>, <span class="hljs-number">368</span>, <span class="hljs-number">496</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs=patches)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">368</span>, <span class="hljs-number">496</span>, <span class="hljs-number">2</span>]`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function $M(j){let u,k,v,g,T;return{c(){u=r("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=r("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(f,"CODE",{});var x=n(v);g=i(x,"Module"),x.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(p,f){h(p,u,f),e(u,k),e(u,v),e(v,g),e(u,T)},d(p){p&&t(u)}}}function jM(j){let u,k,v,g,T;return g=new jo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBlcmNlaXZlckZvck11bHRpbW9kYWxBdXRvZW5jb2RpbmclMEFpbXBvcnQlMjB0b3JjaCUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQSUyMyUyMGNyZWF0ZSUyMG11bHRpbW9kYWwlMjBpbnB1dHMlMEFpbWFnZXMlMjAlM0QlMjB0b3JjaC5yYW5kbigoMSUyQyUyMDE2JTJDJTIwMyUyQyUyMDIyNCUyQyUyMDIyNCkpJTBBYXVkaW8lMjAlM0QlMjB0b3JjaC5yYW5kbigoMSUyQyUyMDMwNzIwJTJDJTIwMSkpJTBBaW5wdXRzJTIwJTNEJTIwZGljdChpbWFnZSUzRGltYWdlcyUyQyUyMGF1ZGlvJTNEYXVkaW8lMkMlMjBsYWJlbCUzRHRvcmNoLnplcm9zKChpbWFnZXMuc2hhcGUlNUIwJTVEJTJDJTIwNzAwKSkpJTBBJTBBbW9kZWwlMjAlM0QlMjBQZXJjZWl2ZXJGb3JNdWx0aW1vZGFsQXV0b2VuY29kaW5nLmZyb21fcHJldHJhaW5lZCglMjJkZWVwbWluZCUyRm11bHRpbW9kYWwtcGVyY2VpdmVyJTIyKSUwQSUwQSUyMyUyMGluJTIwdGhlJTIwUGVyY2VpdmVyJTIwSU8lMjBwYXBlciUyQyUyMHZpZGVvcyUyMGFyZSUyMGF1dG8tZW5jb2RlZCUyMGluJTIwY2h1bmtzJTBBJTIzJTIwZWFjaCUyMGNodW5rJTIwc3Vic2FtcGxlcyUyMGRpZmZlcmVudCUyMGluZGV4JTIwZGltZW5zaW9ucyUyMG9mJTIwdGhlJTIwaW1hZ2UlMjBhbmQlMjBhdWRpbyUyMG1vZGFsaXR5JTIwZGVjb2RlciUyMHF1ZXJpZXMlMEFuY2h1bmtzJTIwJTNEJTIwMTI4JTBBaW1hZ2VfY2h1bmtfc2l6ZSUyMCUzRCUyMG5wLnByb2QoKDE2JTJDJTIwMjI0JTJDJTIwMjI0KSklMjAlMkYlMkYlMjBuY2h1bmtzJTBBYXVkaW9fY2h1bmtfc2l6ZSUyMCUzRCUyMGF1ZGlvLnNoYXBlJTVCMSU1RCUyMCUyRiUyRiUyMG1vZGVsLmNvbmZpZy5zYW1wbGVzX3Blcl9wYXRjaCUyMCUyRiUyRiUyMG5jaHVua3MlMEElMjMlMjBwcm9jZXNzJTIwdGhlJTIwZmlyc3QlMjBjaHVuayUwQWNodW5rX2lkeCUyMCUzRCUyMDAlMEFzdWJzYW1wbGluZyUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMmltYWdlJTIyJTNBJTIwdG9yY2guYXJhbmdlKGltYWdlX2NodW5rX3NpemUlMjAqJTIwY2h1bmtfaWR4JTJDJTIwaW1hZ2VfY2h1bmtfc2l6ZSUyMColMjAoY2h1bmtfaWR4JTIwJTJCJTIwMSkpJTJDJTBBJTIwJTIwJTIwJTIwJTIyYXVkaW8lMjIlM0ElMjB0b3JjaC5hcmFuZ2UoYXVkaW9fY2h1bmtfc2l6ZSUyMColMjBjaHVua19pZHglMkMlMjBhdWRpb19jaHVua19zaXplJTIwKiUyMChjaHVua19pZHglMjAlMkIlMjAxKSklMkMlMEElMjAlMjAlMjAlMjAlMjJsYWJlbCUyMiUzQSUyME5vbmUlMkMlMEElN0QlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzJTNEaW5wdXRzJTJDJTIwc3Vic2FtcGxlZF9vdXRwdXRfcG9pbnRzJTNEc3Vic2FtcGxpbmcpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFsaXN0KGxvZ2l0cyU1QiUyMmF1ZGlvJTIyJTVELnNoYXBlKSUwQSUwQWxpc3QobG9naXRzJTVCJTIyaW1hZ2UlMjIlNUQuc2hhcGUpJTBBJTBBbGlzdChsb2dpdHMlNUIlMjJsYWJlbCUyMiU1RC5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PerceiverForMultimodalAutoencoding
<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">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create multimodal inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>images = torch.randn((<span class="hljs-number">1</span>, <span class="hljs-number">16</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>audio = torch.randn((<span class="hljs-number">1</span>, <span class="hljs-number">30720</span>, <span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = <span class="hljs-built_in">dict</span>(image=images, audio=audio, label=torch.zeros((images.shape[<span class="hljs-number">0</span>], <span class="hljs-number">700</span>)))

<span class="hljs-meta">&gt;&gt;&gt; </span>model = PerceiverForMultimodalAutoencoding.from_pretrained(<span class="hljs-string">&quot;deepmind/multimodal-perceiver&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># in the Perceiver IO paper, videos are auto-encoded in chunks</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># each chunk subsamples different index dimensions of the image and audio modality decoder queries</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>nchunks = <span class="hljs-number">128</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_chunk_size = np.prod((<span class="hljs-number">16</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>)) // nchunks
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_chunk_size = audio.shape[<span class="hljs-number">1</span>] // model.config.samples_per_patch // nchunks
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># process the first chunk</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>chunk_idx = <span class="hljs-number">0</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>subsampling = {
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;image&quot;</span>: torch.arange(image_chunk_size * chunk_idx, image_chunk_size * (chunk_idx + <span class="hljs-number">1</span>)),
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;audio&quot;</span>: torch.arange(audio_chunk_size * chunk_idx, audio_chunk_size * (chunk_idx + <span class="hljs-number">1</span>)),
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;label&quot;</span>: <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>}

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs=inputs, subsampled_output_points=subsampling)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits[<span class="hljs-string">&quot;audio&quot;</span>].shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">240</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits[<span class="hljs-string">&quot;image&quot;</span>].shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">6272</span>, <span class="hljs-number">3</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits[<span class="hljs-string">&quot;label&quot;</span>].shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">700</span>]`}}),{c(){u=r("p"),k=a("Examples:"),v=c(),_(g.$$.fragment)},l(p){u=s(p,"P",{});var f=n(u);k=i(f,"Examples:"),f.forEach(t),v=d(p),y(g.$$.fragment,p)},m(p,f){h(p,u,f),e(u,k),h(p,v,f),b(g,p,f),T=!0},p:$o,i(p){T||(w(g.$$.fragment,p),T=!0)},o(p){M(g.$$.fragment,p),T=!1},d(p){p&&t(u),p&&t(v),P(g,p)}}}function CM(j){let u,k,v,g,T,p,f,x,jp,Rl,Pe,Co,ia,Dt,Cp,la,xp,Sl,xo,Ep,qt,Ip,Fp,Xl,Eo,Jp,Gt,Up,zp,Ol,Ss,Zp,Hl,Xs,ca,Np,Ll,Os,Wp,Yl,Hs,Bp,Ql,Z,Ap,Ls,Dp,qp,da,Gp,Vp,pa,Rp,Sp,ma,Xp,Op,ha,Hp,Lp,Kl,Ys,Yp,ec,I,Qp,ua,Kp,em,fa,om,tm,ga,rm,sm,va,nm,am,_a,im,lm,ya,cm,dm,oc,Io,ay,tc,Vt,pm,Qs,mm,rc,ve,hm,Rt,um,fm,St,gm,vm,sc,Ks,_m,nc,Fo,Xt,ym,Ot,bm,wm,Mm,Ht,Pm,Lt,Tm,km,ac,Yt,ba,$m,jm,ic,en,_e,Cm,wa,xm,Em,Ma,Im,Fm,Qt,Jm,lc,Te,Jo,Pa,Kt,Um,Ta,zm,cc,ye,ka,on,Zm,Nm,$a,tn,Wm,Bm,ja,rn,Am,dc,ke,Uo,Ca,er,Dm,xa,qm,pc,$e,or,Gm,Ea,Vm,mc,je,tr,Rm,Ia,Sm,hc,Ce,rr,Xm,Fa,Om,uc,xe,sr,Hm,Ja,Lm,fc,Ee,zo,Ua,nr,Ym,za,Qm,gc,G,ar,Km,Ie,eh,sn,oh,th,ir,rh,sh,nh,Fe,ah,nn,ih,lh,an,ch,dh,ph,Zo,vc,Je,No,Za,lr,mh,Na,hh,_c,V,cr,uh,Wa,fh,gh,dr,vh,ln,_h,yh,bh,Wo,pr,wh,Ba,Mh,yc,Ue,Bo,Aa,mr,Ph,Da,Th,bc,ze,hr,kh,Ao,ur,$h,qa,jh,wc,Ze,Do,Ga,fr,Ch,Va,xh,Mc,ne,gr,Eh,Ra,Ih,Fh,qo,vr,Jh,Sa,Uh,Pc,Ne,Go,Xa,_r,zh,Oa,Zh,Tc,ae,yr,Nh,br,Wh,Ha,Bh,Ah,Dh,wr,qh,La,Gh,Vh,kc,We,Vo,Ya,Mr,Rh,Qa,Sh,$c,ie,Pr,Xh,Ka,Oh,Hh,R,Lh,ei,Yh,Qh,oi,Kh,eu,ti,ou,tu,ri,ru,su,jc,Be,Ro,si,Tr,nu,ni,au,Cc,Ae,kr,iu,ai,lu,xc,De,So,ii,$r,cu,li,du,Ec,qe,jr,pu,ci,mu,Ic,Ge,Xo,di,Cr,hu,pi,uu,Fc,le,xr,fu,mi,gu,vu,hi,_u,Jc,Ve,Oo,ui,Er,yu,fi,bu,Uc,Re,Ir,wu,gi,Mu,zc,Se,Ho,vi,Fr,Pu,_i,Tu,Zc,ce,Jr,ku,yi,$u,ju,bi,Cu,Nc,Xe,Lo,wi,Ur,xu,Mi,Eu,Wc,Oe,zr,Iu,Zr,Fu,Pi,Ju,Uu,Bc,He,Yo,Ti,Nr,zu,ki,Zu,Ac,Le,Wr,Nu,$i,Wu,Dc,Ye,Qo,ji,Br,Bu,Ci,Au,qc,Qe,Ar,Du,Dr,qu,xi,Gu,Vu,Gc,Ke,Ko,Ei,qr,Ru,Ii,Su,Vc,de,Gr,Xu,Vr,Ou,Fi,Hu,Lu,Yu,Ji,Qu,Rc,eo,et,Ui,Rr,Ku,zi,ef,Sc,oo,Sr,of,Zi,tf,Xc,to,ot,Ni,Xr,rf,Wi,sf,Oc,ro,Or,nf,Bi,af,Hc,so,tt,Ai,Hr,lf,Di,cf,Lc,no,Lr,df,qi,pf,Yc,ao,rt,Gi,Yr,mf,Vi,hf,Qc,io,Qr,uf,Ri,ff,Kc,lo,st,Si,Kr,gf,Xi,vf,ed,pe,es,_f,os,yf,ts,bf,wf,Mf,S,rs,Pf,co,Tf,cn,kf,$f,Oi,jf,Cf,xf,nt,Ef,at,od,po,it,Hi,ss,If,Li,Ff,td,me,ns,Jf,as,Uf,is,zf,Zf,Nf,X,ls,Wf,mo,Bf,dn,Af,Df,Yi,qf,Gf,Vf,lt,Rf,ct,rd,ho,dt,Qi,cs,Sf,Ki,Xf,sd,he,ds,Of,ps,Hf,ms,Lf,Yf,Qf,O,hs,Kf,uo,eg,pn,og,tg,el,rg,sg,ng,pt,ag,mt,nd,fo,ht,ol,us,ig,tl,lg,ad,J,fs,cg,rl,dg,pg,sl,mg,hg,B,mn,ug,fg,hn,gg,vg,nl,_g,yg,un,bg,wg,fn,Mg,Pg,Tg,gs,kg,vs,$g,jg,Cg,H,_s,xg,go,Eg,gn,Ig,Fg,al,Jg,Ug,zg,ut,Zg,ft,id,vo,gt,il,ys,Ng,ll,Wg,ld,U,bs,Bg,cl,Ag,Dg,dl,qg,Gg,A,vn,Vg,Rg,_n,Sg,Xg,pl,Og,Hg,yn,Lg,Yg,bn,Qg,Kg,ev,ws,ov,Ms,tv,rv,sv,L,Ps,nv,_o,av,wn,iv,lv,ml,cv,dv,pv,vt,mv,_t,cd,yo,yt,hl,Ts,hv,ul,uv,dd,z,ks,fv,fl,gv,vv,gl,_v,yv,D,Mn,bv,wv,Pn,Mv,Pv,vl,Tv,kv,Tn,$v,jv,kn,Cv,xv,Ev,$s,Iv,js,Fv,Jv,Uv,Y,Cs,zv,bo,Zv,$n,Nv,Wv,_l,Bv,Av,Dv,bt,qv,wt,pd,wo,Mt,yl,xs,Gv,bl,Vv,md,N,Es,Rv,W,Sv,jn,Xv,Ov,Cn,Hv,Lv,wl,Yv,Qv,xn,Kv,e_,En,o_,t_,r_,Ml,s_,n_,Is,a_,Fs,i_,l_,c_,Q,Js,d_,Mo,p_,In,m_,h_,Pl,u_,f_,g_,Pt,v_,Tt,hd,Po,kt,Tl,Us,__,kl,y_,ud,E,zs,b_,$l,w_,M_,$t,Fn,P_,T_,Jn,k_,$_,j_,be,Un,C_,x_,zn,E_,I_,Zn,F_,J_,U_,jt,Nn,z_,Z_,Wn,N_,W_,B_,Zs,A_,jl,D_,q_,G_,Cl,V_,R_,Ns,S_,Ws,X_,O_,H_,K,Bs,L_,To,Y_,Bn,Q_,K_,xl,ey,oy,ty,Ct,ry,xt,fd;return p=new C({}),Dt=new C({}),Kt=new C({}),er=new C({}),or=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput",parameters:[{name:"logits",val:": FloatTensor = None"},{name:"last_hidden_state",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_labels)</code>) &#x2014;
Classification (or regression if config.num_labels==1) scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"attentions"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L61"}}),tr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverDecoderOutput",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverDecoderOutput",parameters:[{name:"logits",val:": FloatTensor = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverDecoderOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_labels)</code>) &#x2014;
Output of the basic decoder.`,name:"logits"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L92"}}),rr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Masked language modeling (MLM) loss.`,name:"loss"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"logits"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, num_latents, num_latents)</code>. Attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"attentions"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L110"}}),sr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Classification (or regression if config.num_labels==1) loss.`,name:"loss"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) &#x2014;
Classification (or regression if config.num_labels==1) scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"attentions"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.`,name:"cross_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L141"}}),nr=new C({}),ar=new $({props:{name:"class transformers.PerceiverConfig",anchor:"transformers.PerceiverConfig",parameters:[{name:"num_latents",val:" = 256"},{name:"d_latents",val:" = 1280"},{name:"d_model",val:" = 768"},{name:"num_blocks",val:" = 1"},{name:"num_self_attends_per_block",val:" = 26"},{name:"num_self_attention_heads",val:" = 8"},{name:"num_cross_attention_heads",val:" = 8"},{name:"qk_channels",val:" = None"},{name:"v_channels",val:" = None"},{name:"cross_attention_shape_for_attention",val:" = 'kv'"},{name:"self_attention_widening_factor",val:" = 1"},{name:"cross_attention_widening_factor",val:" = 1"},{name:"hidden_act",val:" = 'gelu'"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_query_residual",val:" = True"},{name:"vocab_size",val:" = 262"},{name:"max_position_embeddings",val:" = 2048"},{name:"image_size",val:" = 56"},{name:"train_size",val:" = [368, 496]"},{name:"num_frames",val:" = 16"},{name:"audio_samples_per_frame",val:" = 1920"},{name:"samples_per_patch",val:" = 16"},{name:"output_shape",val:" = [1, 16, 224, 224]"},{name:"output_num_channels",val:" = 512"},{name:"_label_trainable_num_channels",val:" = 1024"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PerceiverConfig.num_latents",description:`<strong>num_latents</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The number of latents.`,name:"num_latents"},{anchor:"transformers.PerceiverConfig.d_latents",description:`<strong>d_latents</strong> (<code>int</code>, <em>optional</em>, defaults to 1280) &#x2014;
Dimension of the latent embeddings.`,name:"d_latents"},{anchor:"transformers.PerceiverConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the inputs. Should only be provided in case [<em>PerceiverTextPreprocessor</em>] is used or no
preprocessor is provided.`,name:"d_model"},{anchor:"transformers.PerceiverConfig.num_blocks",description:`<strong>num_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of blocks in the Transformer encoder.`,name:"num_blocks"},{anchor:"transformers.PerceiverConfig.num_self_attends_per_block",description:`<strong>num_self_attends_per_block</strong> (<code>int</code>, <em>optional</em>, defaults to 26) &#x2014;
The number of self-attention layers per block.`,name:"num_self_attends_per_block"},{anchor:"transformers.PerceiverConfig.num_self_attention_heads",description:`<strong>num_self_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each self-attention layer in the Transformer encoder.`,name:"num_self_attention_heads"},{anchor:"transformers.PerceiverConfig.num_cross_attention_heads",description:`<strong>num_cross_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each cross-attention layer in the Transformer encoder.`,name:"num_cross_attention_heads"},{anchor:"transformers.PerceiverConfig.qk_channels",description:`<strong>qk_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimension to project the queries + keys before applying attention in the cross-attention and self-attention
layers of the encoder. Will default to preserving the dimension of the queries if not specified.`,name:"qk_channels"},{anchor:"transformers.PerceiverConfig.v_channels",description:`<strong>v_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimension to project the values before applying attention in the cross-attention and self-attention layers
of the encoder. Will default to preserving the dimension of the queries if not specified.`,name:"v_channels"},{anchor:"transformers.PerceiverConfig.cross_attention_shape_for_attention",description:`<strong>cross_attention_shape_for_attention</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&apos;kv&apos;</code>) &#x2014;
Dimension to use when downsampling the queries and keys in the cross-attention layer of the encoder.`,name:"cross_attention_shape_for_attention"},{anchor:"transformers.PerceiverConfig.self_attention_widening_factor",description:`<strong>self_attention_widening_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Dimension of the feed-forward layer in the cross-attention layer of the Transformer encoder.`,name:"self_attention_widening_factor"},{anchor:"transformers.PerceiverConfig.cross_attention_widening_factor",description:`<strong>cross_attention_widening_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Dimension of the feed-forward layer in the self-attention layers of the Transformer encoder.`,name:"cross_attention_widening_factor"},{anchor:"transformers.PerceiverConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.PerceiverConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.PerceiverConfig.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.PerceiverConfig.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.PerceiverConfig.use_query_residual",description:`<strong>use_query_residual</strong> (<code>float</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a query residual in the cross-attention layer of the encoder.`,name:"use_query_residual"},{anchor:"transformers.PerceiverConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 262) &#x2014;
Vocabulary size for the masked language modeling model.`,name:"vocab_size"},{anchor:"transformers.PerceiverConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that the masked language modeling 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.PerceiverConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 56) &#x2014;
Size of the images after preprocessing, for <a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationLearned">PerceiverForImageClassificationLearned</a>.`,name:"image_size"},{anchor:"transformers.PerceiverConfig.train_size",description:`<strong>train_size</strong> (<code>List[int]</code>, <em>optional</em>, defaults to [368, 496]) &#x2014;
Training size of the images for the optical flow model.`,name:"train_size"},{anchor:"transformers.PerceiverConfig.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of video frames used for the multimodal autoencoding model.`,name:"num_frames"},{anchor:"transformers.PerceiverConfig.audio_samples_per_frame",description:`<strong>audio_samples_per_frame</strong> (<code>int</code>, <em>optional</em>, defaults to 1920) &#x2014;
Number of audio samples per frame for the multimodal autoencoding model.`,name:"audio_samples_per_frame"},{anchor:"transformers.PerceiverConfig.samples_per_patch",description:`<strong>samples_per_patch</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of audio samples per patch when preprocessing the audio for the multimodal autoencoding model.`,name:"samples_per_patch"},{anchor:"transformers.PerceiverConfig.output_num_channels",description:`<strong>output_num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Number of output channels for each modalitiy decoder.`,name:"output_num_channels"},{anchor:"transformers.PerceiverConfig.output_shape",description:`<strong>output_shape</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 16, 224, 224]</code>) &#x2014;
Shape of the output (batch_size, num_frames, height, width) for the video decoder queries of the multimodal
autoencoding model. This excludes the channel dimension.`,name:"output_shape"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/configuration_perceiver.py#L36"}}),Zo=new ko({props:{anchor:"transformers.PerceiverConfig.example",$$slots:{default:[pM]},$$scope:{ctx:j}}}),lr=new C({}),cr=new $({props:{name:"class transformers.PerceiverTokenizer",anchor:"transformers.PerceiverTokenizer",parameters:[{name:"pad_token",val:" = '[PAD]'"},{name:"bos_token",val:" = '[BOS]'"},{name:"eos_token",val:" = '[EOS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"model_max_length",val:" = 2048"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PerceiverTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.PerceiverTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[BOS]&quot;</code>) &#x2014;
The BOS token (reserved in the vocab, but not actually used).`,name:"bos_token"},{anchor:"transformers.PerceiverTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[EOS]&quot;</code>) &#x2014;
The end of sequence token (reserved in the vocab, but not actually used).</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.PerceiverTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The MASK token, useful for masked language modeling.`,name:"mask_token"},{anchor:"transformers.PerceiverTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The CLS token (reserved in the vocab, but not actually used).`,name:"cls_token"},{anchor:"transformers.PerceiverTokenizer.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 two sequences.`,name:"sep_token"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/tokenization_perceiver.py#L27"}}),pr=new $({props:{name:"__call__",anchor:"transformers.PerceiverTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PerceiverTokenizer.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.PerceiverTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.PerceiverTokenizer.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.PerceiverTokenizer.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.PerceiverTokenizer.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PerceiverTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PerceiverTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PerceiverTokenizer.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PerceiverTokenizer.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PerceiverTokenizer.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PerceiverTokenizer.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PerceiverTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PerceiverTokenizer.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.PerceiverTokenizer.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.PerceiverTokenizer.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.PerceiverTokenizer.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.PerceiverTokenizer.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.PerceiverTokenizer.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.PerceiverTokenizer.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L2528",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),mr=new C({}),hr=new $({props:{name:"class transformers.PerceiverFeatureExtractor",anchor:"transformers.PerceiverFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/feature_extraction_perceiver.py#L26"}}),ur=new $({props:{name:"__call__",anchor:"transformers.PerceiverFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/image_processing_utils.py#L544"}}),fr=new C({}),gr=new $({props:{name:"class transformers.PerceiverImageProcessor",anchor:"transformers.PerceiverImageProcessor",parameters:[{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PerceiverImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>True</code>) &#x2014;
Whether or not to center crop the image. If the input size if smaller than <code>crop_size</code> along any edge, the
image will be padded with zeros and then center cropped. Can be overridden by the <code>do_center_crop</code>
parameter in the <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.PerceiverImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Desired output size when applying center-cropping. Can be overridden by the <code>crop_size</code> parameter in the
<code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.PerceiverImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image to <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code>. Can be overridden by the <code>do_resize</code>
parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.PerceiverImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.PerceiverImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Defines the resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter
in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.PerceiverImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.PerceiverImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Defines the scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter
in the <code>preprocess</code> method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.PerceiverImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.PerceiverImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/image_processing_perceiver.py#L45"}}),vr=new $({props:{name:"preprocess",anchor:"transformers.PerceiverImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PerceiverImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.PerceiverImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image to <code>crop_size</code>.`,name:"do_center_crop"},{anchor:"transformers.PerceiverImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Desired output size after applying the center crop.`,name:"crop_size"},{anchor:"transformers.PerceiverImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.PerceiverImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing.`,name:"size"},{anchor:"transformers.PerceiverImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.PerceiverImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.PerceiverImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.PerceiverImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.PerceiverImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.PerceiverImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.PerceiverImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PerceiverImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"},{anchor:"transformers.PerceiverImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/image_processing_perceiver.py#L208"}}),_r=new C({}),yr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor",parameters:[{name:"config",val:": PerceiverConfig"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014;
Model configuration.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2846"}}),Mr=new C({}),Pr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor",parameters:[{name:"config",val:""},{name:"prep_type",val:" = 'conv'"},{name:"spatial_downsample",val:": int = 4"},{name:"temporal_downsample",val:": int = 1"},{name:"position_encoding_type",val:": str = 'fourier'"},{name:"in_channels",val:": int = 3"},{name:"out_channels",val:": int = 64"},{name:"conv_after_patching",val:": bool = False"},{name:"conv_after_patching_in_channels",val:": int = 54"},{name:"conv2d_use_batchnorm",val:": bool = True"},{name:"concat_or_add_pos",val:": str = 'concat'"},{name:"project_pos_dim",val:": int = -1"},{name:"**position_encoding_kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.prep_type",description:`<strong>prep_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;conv&quot;</code>) &#x2014;
Preprocessing type. Can be &#x201C;conv1x1&#x201D;, &#x201C;conv&#x201D;, &#x201C;patches&#x201D;, &#x201C;pixels&#x201D;.`,name:"prep_type"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.spatial_downsample",description:`<strong>spatial_downsample</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Spatial downsampling factor.`,name:"spatial_downsample"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.temporal_downsample",description:`<strong>temporal_downsample</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Temporal downsampling factor (only relevant in case a time dimension is present).`,name:"temporal_downsample"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.position_encoding_type",description:`<strong>position_encoding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;fourier&quot;</code>) &#x2014;
Position encoding type. Can be &#x201C;fourier&#x201D; or &#x201C;trainable&#x201D;.`,name:"position_encoding_type"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input.`,name:"in_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of channels in the output.`,name:"out_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.conv_after_patching",description:`<strong>conv_after_patching</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply a convolutional layer after patching.`,name:"conv_after_patching"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.conv_after_patching_in_channels",description:`<strong>conv_after_patching_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 54) &#x2014;
Number of channels in the input of the convolutional layer after patching.`,name:"conv_after_patching_in_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.conv2d_use_batchnorm",description:`<strong>conv2d_use_batchnorm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use batch normalization in the convolutional layer.`,name:"conv2d_use_batchnorm"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.concat_or_add_pos",description:`<strong>concat_or_add_pos</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;concat&quot;</code>) &#x2014;
How to concatenate the position encoding to the input. Can be &#x201C;concat&#x201D; or &#x201C;add&#x201D;.`,name:"concat_or_add_pos"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.project_pos_dim",description:`<strong>project_pos_dim</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Dimension of the position encoding to project to. If -1, no projection is applied.`,name:"project_pos_dim"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor.*position_encoding_kwargs",description:`*<strong>*position_encoding_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Keyword arguments for the position encoding.`,name:"*position_encoding_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L3003"}}),Tr=new C({}),kr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverOneHotPreprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverOneHotPreprocessor",parameters:[{name:"config",val:": PerceiverConfig"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverOneHotPreprocessor.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014;
Model configuration.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L3232"}}),$r=new C({}),jr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor",parameters:[{name:"config",val:""},{name:"prep_type",val:": str = 'patches'"},{name:"samples_per_patch",val:": int = 96"},{name:"position_encoding_type",val:": str = 'fourier'"},{name:"concat_or_add_pos",val:": str = 'concat'"},{name:"out_channels",val:" = 64"},{name:"project_pos_dim",val:" = -1"},{name:"**position_encoding_kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.prep_type",description:`<strong>prep_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;patches&quot;</code>) &#x2014;
Preprocessor type to use. Only &#x201C;patches&#x201D; is supported.`,name:"prep_type"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.samples_per_patch",description:`<strong>samples_per_patch</strong> (<code>int</code>, <em>optional</em>, defaults to 96) &#x2014;
Number of samples per patch.`,name:"samples_per_patch"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.position_encoding_type",description:`<strong>position_encoding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;fourier&quot;</code>) &#x2014;
Type of position encoding to use. Can be &#x201C;trainable&#x201D; or &#x201C;fourier&#x201D;.`,name:"position_encoding_type"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.concat_or_add_pos",description:`<strong>concat_or_add_pos</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;concat&quot;</code>) &#x2014;
How to concatenate the position encoding to the input. Can be &#x201C;concat&#x201D; or &#x201C;add&#x201D;.`,name:"concat_or_add_pos"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of channels in the output.`,name:"out_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.project_pos_dim",description:`<strong>project_pos_dim</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Dimension of the position encoding to project to. If -1, no projection is applied.`,name:"project_pos_dim"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor.*position_encoding_kwargs",description:`*<strong>*position_encoding_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Keyword arguments for the position encoding.`,name:"*position_encoding_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L3258"}}),Cr=new C({}),xr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor",parameters:[{name:"modalities",val:": typing.Mapping[str, typing.Callable[..., typing.Tuple[torch.Tensor, typing.Optional[torch.Tensor], torch.Tensor]]]"},{name:"mask_probs",val:": typing.Union[typing.Mapping[str, float], NoneType] = None"},{name:"min_padding_size",val:": int = 2"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor.modalities",description:`<strong>modalities</strong> (<code>Mapping[str, PreprocessorType]</code>) &#x2014;
Dict mapping modality name to preprocessor.`,name:"modalities"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor.mask_probs",description:`<strong>mask_probs</strong> (<code>Dict[str, float]</code>) &#x2014;
Dict mapping modality name to masking probability of that modality.`,name:"mask_probs"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor.min_padding_size",description:`<strong>min_padding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The minimum padding size for all modalities. The final output will have num_channels equal to the maximum
channels across all modalities plus min_padding_size.`,name:"min_padding_size"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L3355"}}),Er=new C({}),Ir=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverProjectionDecoder",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionDecoder",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionDecoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014;
Model configuration.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2051"}}),Fr=new C({}),Jr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder",parameters:[{name:"config",val:": PerceiverConfig"},{name:"output_num_channels",val:": int"},{name:"position_encoding_type",val:": typing.Optional[str] = 'trainable'"},{name:"output_index_dims",val:": typing.Optional[int] = None"},{name:"num_channels",val:": typing.Optional[int] = 128"},{name:"subsampled_index_dims",val:": typing.Optional[int] = None"},{name:"qk_channels",val:": typing.Optional[int] = None"},{name:"v_channels",val:": typing.Optional[int] = None"},{name:"num_heads",val:": typing.Optional[int] = 1"},{name:"widening_factor",val:": typing.Optional[int] = 1"},{name:"use_query_residual",val:": typing.Optional[bool] = False"},{name:"concat_preprocessed_input",val:": typing.Optional[bool] = False"},{name:"final_project",val:": typing.Optional[bool] = True"},{name:"position_encoding_only",val:": typing.Optional[bool] = False"},{name:"**position_encoding_kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.output_num_channels",description:`<strong>output_num_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of channels in the output. Will only be used in case <em>final_project</em> is set to <code>True</code>.`,name:"output_num_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.position_encoding_type",description:`<strong>position_encoding_type</strong> (<code>str</code>, <em>optional</em>, defaults to &#x201C;trainable&#x201D;) &#x2014;
The type of position encoding to use. Can be either &#x201C;trainable&#x201D;, &#x201C;fourier&#x201D;, or &#x201C;none&#x201D;.`,name:"position_encoding_type"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.output_index_dims",description:`<strong>output_index_dims</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of dimensions of the output queries. Ignored if &#x2018;position_encoding_type&#x2019; == &#x2018;none&#x2019;.`,name:"output_index_dims"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The number of channels of the decoder queries. Ignored if &#x2018;position_encoding_type&#x2019; == &#x2018;none&#x2019;.`,name:"num_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.qk_channels",description:`<strong>qk_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of channels of the queries and keys in the cross-attention layer.`,name:"qk_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.v_channels",description:`<strong>v_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of channels of the values in the cross-attention layer.`,name:"v_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of attention heads in the cross-attention layer.`,name:"num_heads"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.widening_factor",description:`<strong>widening_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The widening factor of the cross-attention layer.`,name:"widening_factor"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.use_query_residual",description:`<strong>use_query_residual</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a residual connection between the query and the output of the cross-attention layer.`,name:"use_query_residual"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.concat_preprocessed_input",description:`<strong>concat_preprocessed_input</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to concatenate the preprocessed input to the query.`,name:"concat_preprocessed_input"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.final_project",description:`<strong>final_project</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to project the output of the cross-attention layer to a target dimension.`,name:"final_project"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder.position_encoding_only",description:`<strong>position_encoding_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only use this class to define output queries.`,name:"position_encoding_only"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2077"}}),Ur=new C({}),zr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder",parameters:[{name:"config",val:""},{name:"**decoder_kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014;
Model configuration.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2263"}}),Nr=new C({}),Wr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverOpticalFlowDecoder",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverOpticalFlowDecoder",parameters:[{name:"config",val:""},{name:"output_image_shape",val:""},{name:"output_num_channels",val:" = 2"},{name:"rescale_factor",val:" = 100.0"},{name:"**decoder_kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2309"}}),Br=new C({}),Ar=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder",parameters:[{name:"config",val:": PerceiverConfig"},{name:"output_shape",val:": typing.List[int]"},{name:"position_encoding_type",val:": str"},{name:"**decoder_kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder.output_shape",description:`<strong>output_shape</strong> (<code>List[int]</code>) &#x2014;
Shape of the output as (batch_size, num_frames, height, width), excluding the channel dimension.`,name:"output_shape"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder.position_encoding_type",description:`<strong>position_encoding_type</strong> (<code>str</code>) &#x2014;
The type of position encoding to use. Can be either &#x201C;trainable&#x201D;, &#x201C;fourier&#x201D;, or &#x201C;none&#x201D;.`,name:"position_encoding_type"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2344"}}),qr=new C({}),Gr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder",parameters:[{name:"config",val:": PerceiverConfig"},{name:"modalities",val:": typing.Dict[str, transformers.models.perceiver.modeling_perceiver.PerceiverAbstractDecoder]"},{name:"num_outputs",val:": int"},{name:"output_num_channels",val:": int"},{name:"min_padding_size",val:": typing.Optional[int] = 2"},{name:"subsampled_index_dims",val:": typing.Union[typing.Dict[str, transformers.models.perceiver.modeling_perceiver.PerceiverAbstractDecoder], NoneType] = None"},{name:"**decoder_kwargs",val:""}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder.modalities",description:`<strong>modalities</strong> (<code>Dict[str, PerceiverAbstractDecoder]</code>) &#x2014;
Dictionary mapping modality name to the decoder of that modality.`,name:"modalities"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder.num_outputs",description:`<strong>num_outputs</strong> (<code>int</code>) &#x2014;
The number of outputs of the decoder.`,name:"num_outputs"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder.output_num_channels",description:`<strong>output_num_channels</strong> (<code>int</code>) &#x2014;
The number of channels in the output.`,name:"output_num_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder.min_padding_size",description:`<strong>min_padding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The minimum padding size for all modalities. The final output will have num_channels equal to the maximum
channels across all modalities plus min_padding_size.`,name:"min_padding_size"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder.subsampled_index_dims",description:`<strong>subsampled_index_dims</strong> (<code>Dict[str, PerceiverAbstractDecoder]</code>, <em>optional</em>) &#x2014;
Dictionary mapping modality name to the subsampled index dimensions to use for the decoder query of that
modality.`,name:"subsampled_index_dims"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2421"}}),Rr=new C({}),Sr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor",parameters:[{name:"in_channels",val:": int"},{name:"out_channels",val:": int"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor.in_channels",description:`<strong>in_channels</strong> (<code>int</code>) &#x2014;
Number of channels in the input.`,name:"in_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor.out_channels",description:`<strong>out_channels</strong> (<code>int</code>) &#x2014;
Number of channels in the output.`,name:"out_channels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2982"}}),Xr=new C({}),Or=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor",parameters:[{name:"config",val:": PerceiverConfig"},{name:"in_channels",val:": int"},{name:"postproc_type",val:": str = 'patches'"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor.in_channels",description:`<strong>in_channels</strong> (<code>int</code>) &#x2014;
Number of channels in the input.`,name:"in_channels"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor.postproc_type",description:`<strong>postproc_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;patches&quot;</code>) &#x2014;
Postprocessor type to use. Currently, only &#x201C;patches&#x201D; is supported.`,name:"postproc_type"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2955"}}),Hr=new C({}),Lr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor",parameters:[{name:"config",val:": PerceiverConfig"},{name:"in_channels",val:": int"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor.config",description:`<strong>config</strong> ([<em>PerceiverConfig</em>]) &#x2014;
Model configuration.`,name:"config"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor.in_channels",description:`<strong>in_channels</strong> (<code>int</code>) &#x2014;
Number of channels in the input.`,name:"in_channels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2935"}}),Yr=new C({}),Qr=new $({props:{name:"class transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor",anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor",parameters:[{name:"modalities",val:": typing.Mapping[str, typing.Callable[..., typing.Any]]"},{name:"input_is_dict",val:": bool = False"}],parametersDescription:[{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor.modalities",description:`<strong>modalities</strong> (<code>Mapping[str, PostprocessorType]</code>) &#x2014;
Dictionary mapping modality name to postprocessor class for that modality.`,name:"modalities"},{anchor:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor.input_is_dict",description:`<strong>input_is_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, input is assumed to be dictionary structured, and outputs keep the same dictionary shape. If
False, input is a tensor which is sliced up during postprocessing by <em>modality_sizes</em>.`,name:"input_is_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L2901"}}),Kr=new C({}),es=new $({props:{name:"class transformers.PerceiverModel",anchor:"transformers.PerceiverModel",parameters:[{name:"config",val:""},{name:"decoder",val:" = None"},{name:"input_preprocessor",val:": typing.Callable[..., typing.Tuple[torch.Tensor, typing.Optional[torch.Tensor], torch.Tensor]] = None"},{name:"output_postprocessor",val:": typing.Callable[..., typing.Any] = None"}],parametersDescription:[{anchor:"transformers.PerceiverModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.PerceiverModel.decoder",description:`<strong>decoder</strong> (<em>DecoderType</em>, <em>optional</em>) &#x2014;
Optional decoder to use to decode the latent representation of the encoder. Examples include
<em>transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder</em>.`,name:"decoder"},{anchor:"transformers.PerceiverModel.input_preprocessor",description:`<strong>input_preprocessor</strong> (<em>PreprocessorType</em>, <em>optional</em>) &#x2014;
Optional input preprocessor to use. Examples include
<em>transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor</em>.`,name:"input_preprocessor"},{anchor:"transformers.PerceiverModel.output_postprocessor",description:`<strong>output_postprocessor</strong> (<em>PostprocessorType</em>, <em>optional</em>) &#x2014;
Optional output postprocessor to use. Examples include
<em>transformers.models.perceiver.modeling_perceiver.PerceiverImagePostprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor</em>,
<em>transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor</em>.`,name:"output_postprocessor"},{anchor:"transformers.PerceiverModel.Note",description:"<strong>Note</strong> that you can define your own decoders, preprocessors and/or postprocessors to fit your use-case. &#x2014;",name:"Note"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L716"}}),rs=new $({props:{name:"forward",anchor:"transformers.PerceiverModel.forward",parameters:[{name:"inputs",val:": FloatTensor"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"subsampled_output_points",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PerceiverModel.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverModel.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.PerceiverModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L752",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><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.</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),nt=new At({props:{$$slots:{default:[mM]},$$scope:{ctx:j}}}),at=new ko({props:{anchor:"transformers.PerceiverModel.forward.example",$$slots:{default:[hM]},$$scope:{ctx:j}}}),ss=new C({}),ns=new $({props:{name:"class transformers.PerceiverForMaskedLM",anchor:"transformers.PerceiverForMaskedLM",parameters:[{name:"config",val:": PerceiverConfig"}],parametersDescription:[{anchor:"transformers.PerceiverForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L954"}}),ls=new $({props:{name:"forward",anchor:"transformers.PerceiverForMaskedLM.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForMaskedLM.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForMaskedLM.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.PerceiverForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L986",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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, num_latents, num_latents)</code>. Attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new At({props:{$$slots:{default:[uM]},$$scope:{ctx:j}}}),ct=new ko({props:{anchor:"transformers.PerceiverForMaskedLM.forward.example",$$slots:{default:[fM]},$$scope:{ctx:j}}}),cs=new C({}),ds=new $({props:{name:"class transformers.PerceiverForSequenceClassification",anchor:"transformers.PerceiverForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PerceiverForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1089"}}),hs=new $({props:{name:"forward",anchor:"transformers.PerceiverForSequenceClassification.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForSequenceClassification.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForSequenceClassification.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.PerceiverForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1110",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new At({props:{$$slots:{default:[gM]},$$scope:{ctx:j}}}),mt=new ko({props:{anchor:"transformers.PerceiverForSequenceClassification.forward.example",$$slots:{default:[vM]},$$scope:{ctx:j}}}),us=new C({}),fs=new $({props:{name:"class transformers.PerceiverForImageClassificationLearned",anchor:"transformers.PerceiverForImageClassificationLearned",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PerceiverForImageClassificationLearned.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1214"}}),_s=new $({props:{name:"forward",anchor:"transformers.PerceiverForImageClassificationLearned.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForImageClassificationLearned.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForImageClassificationLearned.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForImageClassificationLearned.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForImageClassificationLearned.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForImageClassificationLearned.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.PerceiverForImageClassificationLearned.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForImageClassificationLearned.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1245",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ut=new At({props:{$$slots:{default:[_M]},$$scope:{ctx:j}}}),ft=new ko({props:{anchor:"transformers.PerceiverForImageClassificationLearned.forward.example",$$slots:{default:[yM]},$$scope:{ctx:j}}}),ys=new C({}),bs=new $({props:{name:"class transformers.PerceiverForImageClassificationFourier",anchor:"transformers.PerceiverForImageClassificationFourier",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PerceiverForImageClassificationFourier.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1357"}}),Ps=new $({props:{name:"forward",anchor:"transformers.PerceiverForImageClassificationFourier.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForImageClassificationFourier.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForImageClassificationFourier.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForImageClassificationFourier.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForImageClassificationFourier.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForImageClassificationFourier.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.PerceiverForImageClassificationFourier.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForImageClassificationFourier.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1389",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),vt=new At({props:{$$slots:{default:[bM]},$$scope:{ctx:j}}}),_t=new ko({props:{anchor:"transformers.PerceiverForImageClassificationFourier.forward.example",$$slots:{default:[wM]},$$scope:{ctx:j}}}),Ts=new C({}),ks=new $({props:{name:"class transformers.PerceiverForImageClassificationConvProcessing",anchor:"transformers.PerceiverForImageClassificationConvProcessing",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PerceiverForImageClassificationConvProcessing.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1500"}}),Cs=new $({props:{name:"forward",anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForImageClassificationConvProcessing.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.PerceiverForImageClassificationConvProcessing.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1533",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),bt=new At({props:{$$slots:{default:[MM]},$$scope:{ctx:j}}}),wt=new ko({props:{anchor:"transformers.PerceiverForImageClassificationConvProcessing.forward.example",$$slots:{default:[PM]},$$scope:{ctx:j}}}),xs=new C({}),Es=new $({props:{name:"class transformers.PerceiverForOpticalFlow",anchor:"transformers.PerceiverForOpticalFlow",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PerceiverForOpticalFlow.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1644"}}),Js=new $({props:{name:"forward",anchor:"transformers.PerceiverForOpticalFlow.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForOpticalFlow.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForOpticalFlow.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForOpticalFlow.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForOpticalFlow.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForOpticalFlow.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.PerceiverForOpticalFlow.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForOpticalFlow.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the optical flow loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1694",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pt=new At({props:{$$slots:{default:[TM]},$$scope:{ctx:j}}}),Tt=new ko({props:{anchor:"transformers.PerceiverForOpticalFlow.forward.example",$$slots:{default:[kM]},$$scope:{ctx:j}}}),Us=new C({}),zs=new $({props:{name:"class transformers.PerceiverForMultimodalAutoencoding",anchor:"transformers.PerceiverForMultimodalAutoencoding",parameters:[{name:"config",val:": PerceiverConfig"}],parametersDescription:[{anchor:"transformers.PerceiverForMultimodalAutoencoding.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig">PerceiverConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1789"}}),Bs=new $({props:{name:"forward",anchor:"transformers.PerceiverForMultimodalAutoencoding.forward",parameters:[{name:"inputs",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"subsampled_output_points",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PerceiverForMultimodalAutoencoding.forward.inputs",description:`<strong>inputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
Inputs to the perceiver. Can be anything: images, text, audio, video, etc.`,name:"inputs"},{anchor:"transformers.PerceiverForMultimodalAutoencoding.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.PerceiverForMultimodalAutoencoding.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PerceiverForMultimodalAutoencoding.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.PerceiverForMultimodalAutoencoding.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.PerceiverForMultimodalAutoencoding.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PerceiverForMultimodalAutoencoding.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/perceiver/modeling_perceiver.py#L1905",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverConfig"
>PerceiverConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</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>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput"
>transformers.models.perceiver.modeling_perceiver.PerceiverClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ct=new At({props:{$$slots:{default:[$M]},$$scope:{ctx:j}}}),xt=new ko({props:{anchor:"transformers.PerceiverForMultimodalAutoencoding.forward.example",$$slots:{default:[jM]},$$scope:{ctx:j}}}),{c(){u=r("meta"),k=c(),v=r("h1"),g=r("a"),T=r("span"),_(p.$$.fragment),f=c(),x=r("span"),jp=a("Perceiver"),Rl=c(),Pe=r("h2"),Co=r("a"),ia=r("span"),_(Dt.$$.fragment),Cp=c(),la=r("span"),xp=a("Overview"),Sl=c(),xo=r("p"),Ep=a("The Perceiver IO model was proposed in "),qt=r("a"),Ip=a(`Perceiver IO: A General Architecture for Structured Inputs &
Outputs`),Fp=a(` by Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch,
Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier H\xE9naff, Matthew M.
Botvinick, Andrew Zisserman, Oriol Vinyals, Jo\xE3o Carreira.`),Xl=c(),Eo=r("p"),Jp=a("Perceiver IO is a generalization of "),Gt=r("a"),Up=a("Perceiver"),zp=a(` to handle arbitrary outputs in
addition to arbitrary inputs. The original Perceiver only produced a single classification label. In addition to
classification labels, Perceiver IO can produce (for example) language, optical flow, and multimodal videos with audio.
This is done using the same building blocks as the original Perceiver. The computational complexity of Perceiver IO is
linear in the input and output size and the bulk of the processing occurs in the latent space, allowing us to process
inputs and outputs that are much larger than can be handled by standard Transformers. This means, for example,
Perceiver IO can do BERT-style masked language modeling directly using bytes instead of tokenized inputs.`),Ol=c(),Ss=r("p"),Zp=a("The abstract from the paper is the following:"),Hl=c(),Xs=r("p"),ca=r("em"),Np=a(`The recently-proposed Perceiver model obtains good results on several domains (images, audio, multimodal, point
clouds) while scaling linearly in compute and memory with the input size. While the Perceiver supports many kinds of
inputs, it can only produce very simple outputs such as class scores. Perceiver IO overcomes this limitation without
sacrificing the original\u2019s appealing properties by learning to flexibly query the model\u2019s latent space to produce
outputs of arbitrary size and semantics. Perceiver IO still decouples model depth from data size and still scales
linearly with data size, but now with respect to both input and output sizes. The full Perceiver IO model achieves
strong results on tasks with highly structured output spaces, such as natural language and visual understanding,
StarCraft II, and multi-task and multi-modal domains. As highlights, Perceiver IO matches a Transformer-based BERT
baseline on the GLUE language benchmark without the need for input tokenization and achieves state-of-the-art
performance on Sintel optical flow estimation.`),Ll=c(),Os=r("p"),Wp=a("Here\u2019s a TLDR explaining how Perceiver works:"),Yl=c(),Hs=r("p"),Bp=a(`The main problem with the self-attention mechanism of the Transformer is that the time and memory requirements scale
quadratically with the sequence length. Hence, models like BERT and RoBERTa are limited to a max sequence length of 512
tokens. Perceiver aims to solve this issue by, instead of performing self-attention on the inputs, perform it on a set
of latent variables, and only use the inputs for cross-attention. In this way, the time and memory requirements don\u2019t
depend on the length of the inputs anymore, as one uses a fixed amount of latent variables, like 256 or 512. These are
randomly initialized, after which they are trained end-to-end using backpropagation.`),Ql=c(),Z=r("p"),Ap=a("Internally, "),Ls=r("a"),Dp=a("PerceiverModel"),qp=a(" will create the latents, which is a tensor of shape "),da=r("code"),Gp=a("(batch_size, num_latents, d_latents)"),Vp=a(". One must provide "),pa=r("code"),Rp=a("inputs"),Sp=a(` (which could be text, images, audio, you name it!) to the model, which it will
use to perform cross-attention with the latents. The output of the Perceiver encoder is a tensor of the same shape. One
can then, similar to BERT, convert the last hidden states of the latents to classification logits by averaging along
the sequence dimension, and placing a linear layer on top of that to project the `),ma=r("code"),Xp=a("d_latents"),Op=a(" to "),ha=r("code"),Hp=a("num_labels"),Lp=a("."),Kl=c(),Ys=r("p"),Yp=a(`This was the idea of the original Perceiver paper. However, it could only output classification logits. In a follow-up
work, PerceiverIO, they generalized it to let the model also produce outputs of arbitrary size. How, you might ask? The
idea is actually relatively simple: one defines outputs of an arbitrary size, and then applies cross-attention with the
last hidden states of the latents, using the outputs as queries, and the latents as keys and values.`),ec=c(),I=r("p"),Qp=a(`So let\u2019s say one wants to perform masked language modeling (BERT-style) with the Perceiver. As the Perceiver\u2019s input
length will not have an impact on the computation time of the self-attention layers, one can provide raw bytes,
providing `),ua=r("code"),Kp=a("inputs"),em=a(` of length 2048 to the model. If one now masks out certain of these 2048 tokens, one can define the
`),fa=r("code"),om=a("outputs"),tm=a(" as being of shape: "),ga=r("code"),rm=a("(batch_size, 2048, 768)"),sm=a(`. Next, one performs cross-attention with the final hidden states
of the latents to update the `),va=r("code"),nm=a("outputs"),am=a(" tensor. After cross-attention, one still has a tensor of shape "),_a=r("code"),im=a("(batch_size, 2048, 768)"),lm=a(`. One can then place a regular language modeling head on top, to project the last dimension to the
vocabulary size of the model, i.e. creating logits of shape `),ya=r("code"),cm=a("(batch_size, 2048, 262)"),dm=a(` (as Perceiver uses a vocabulary
size of 262 byte IDs).`),oc=c(),Io=r("img"),tc=c(),Vt=r("small"),pm=a("Perceiver IO architecture. Taken from the "),Qs=r("a"),mm=a("original paper"),rc=c(),ve=r("p"),hm=a("This model was contributed by "),Rt=r("a"),um=a("nielsr"),fm=a(`. The original code can be found
`),St=r("a"),gm=a("here"),vm=a("."),sc=c(),Ks=r("p"),_m=a("Tips:"),nc=c(),Fo=r("ul"),Xt=r("li"),ym=a("The quickest way to get started with the Perceiver is by checking the "),Ot=r("a"),bm=a(`tutorial
notebooks`),wm=a("."),Mm=c(),Ht=r("li"),Pm=a("Refer to the "),Lt=r("a"),Tm=a("blog post"),km=a(` if you want to fully understand how the model works and
is implemented in the library. Note that the models available in the library only showcase some examples of what you can do
with the Perceiver. There are many more use cases, including question answering, named-entity recognition, object detection,
audio classification, video classification, etc.`),ac=c(),Yt=r("p"),ba=r("strong"),$m=a("Note"),jm=a(":"),ic=c(),en=r("ul"),_e=r("li"),Cm=a("Perceiver does "),wa=r("strong"),xm=a("not"),Em=a(" work with "),Ma=r("code"),Im=a("torch.nn.DataParallel"),Fm=a(" due to a bug in PyTorch, see "),Qt=r("a"),Jm=a("issue #36035"),lc=c(),Te=r("h2"),Jo=r("a"),Pa=r("span"),_(Kt.$$.fragment),Um=c(),Ta=r("span"),zm=a("Documentation resources"),cc=c(),ye=r("ul"),ka=r("li"),on=r("a"),Zm=a("Text classification task guide"),Nm=c(),$a=r("li"),tn=r("a"),Wm=a("Masked language modeling task guide"),Bm=c(),ja=r("li"),rn=r("a"),Am=a("Image classification task guide"),dc=c(),ke=r("h2"),Uo=r("a"),Ca=r("span"),_(er.$$.fragment),Dm=c(),xa=r("span"),qm=a("Perceiver specific outputs"),pc=c(),$e=r("div"),_(or.$$.fragment),Gm=c(),Ea=r("p"),Vm=a("Base class for Perceiver base model\u2019s outputs, with potential hidden states, attentions and cross-attentions."),mc=c(),je=r("div"),_(tr.$$.fragment),Rm=c(),Ia=r("p"),Sm=a("Base class for Perceiver decoder outputs, with potential cross-attentions."),hc=c(),Ce=r("div"),_(rr.$$.fragment),Xm=c(),Fa=r("p"),Om=a("Base class for Perceiver\u2019s masked language model outputs."),uc=c(),xe=r("div"),_(sr.$$.fragment),Hm=c(),Ja=r("p"),Lm=a(`Base class for Perceiver\u2019s outputs of sequence/image classification models, optical flow and multimodal
autoencoding.`),fc=c(),Ee=r("h2"),zo=r("a"),Ua=r("span"),_(nr.$$.fragment),Ym=c(),za=r("span"),Qm=a("PerceiverConfig"),gc=c(),G=r("div"),_(ar.$$.fragment),Km=c(),Ie=r("p"),eh=a("This is the configuration class to store the configuration of a "),sn=r("a"),oh=a("PerceiverModel"),th=a(`. It is used to instantiate an
Perceiver 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 Perceiver
`),ir=r("a"),rh=a("deepmind/language-perceiver"),sh=a(" architecture."),nh=c(),Fe=r("p"),ah=a("Configuration objects inherit from "),nn=r("a"),ih=a("PretrainedConfig"),lh=a(` and can be used to control the model outputs. Read the
documentation from `),an=r("a"),ch=a("PretrainedConfig"),dh=a(" for more information."),ph=c(),_(Zo.$$.fragment),vc=c(),Je=r("h2"),No=r("a"),Za=r("span"),_(lr.$$.fragment),mh=c(),Na=r("span"),hh=a("PerceiverTokenizer"),_c=c(),V=r("div"),_(cr.$$.fragment),uh=c(),Wa=r("p"),fh=a("Construct a Perceiver tokenizer. The Perceiver simply uses raw bytes utf-8 encoding."),gh=c(),dr=r("p"),vh=a("This tokenizer inherits from "),ln=r("a"),_h=a("PreTrainedTokenizer"),yh=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),bh=c(),Wo=r("div"),_(pr.$$.fragment),wh=c(),Ba=r("p"),Mh=a(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),yc=c(),Ue=r("h2"),Bo=r("a"),Aa=r("span"),_(mr.$$.fragment),Ph=c(),Da=r("span"),Th=a("PerceiverFeatureExtractor"),bc=c(),ze=r("div"),_(hr.$$.fragment),kh=c(),Ao=r("div"),_(ur.$$.fragment),$h=c(),qa=r("p"),jh=a("Preprocess an image or a batch of images."),wc=c(),Ze=r("h2"),Do=r("a"),Ga=r("span"),_(fr.$$.fragment),Ch=c(),Va=r("span"),xh=a("PerceiverImageProcessor"),Mc=c(),ne=r("div"),_(gr.$$.fragment),Eh=c(),Ra=r("p"),Ih=a("Constructs a Perceiver image processor."),Fh=c(),qo=r("div"),_(vr.$$.fragment),Jh=c(),Sa=r("p"),Uh=a("Preprocess an image or batch of images."),Pc=c(),Ne=r("h2"),Go=r("a"),Xa=r("span"),_(_r.$$.fragment),zh=c(),Oa=r("span"),Zh=a("PerceiverTextPreprocessor"),Tc=c(),ae=r("div"),_(yr.$$.fragment),Nh=c(),br=r("p"),Wh=a("Text preprocessing for Perceiver Encoder. Can be used to embed "),Ha=r("code"),Bh=a("inputs"),Ah=a(" and add positional encodings."),Dh=c(),wr=r("p"),qh=a("The dimensionality of the embeddings is determined by the "),La=r("code"),Gh=a("d_model"),Vh=a(" attribute of the configuration."),kc=c(),We=r("h2"),Vo=r("a"),Ya=r("span"),_(Mr.$$.fragment),Rh=c(),Qa=r("span"),Sh=a("PerceiverImagePreprocessor"),$c=c(),ie=r("div"),_(Pr.$$.fragment),Xh=c(),Ka=r("p"),Oh=a("Image preprocessing for Perceiver Encoder."),Hh=c(),R=r("p"),Lh=a("Note: the "),ei=r("em"),Yh=a("out_channels"),Qh=a(" argument refers to the output channels of a convolutional layer, if "),oi=r("em"),Kh=a("prep_type"),eu=a(` is set to
\u201Cconv1x1\u201D or \u201Cconv\u201D. If one adds absolute position embeddings, one must make sure the `),ti=r("em"),ou=a("num_channels"),tu=a(` of the
position encoding kwargs are set equal to the `),ri=r("em"),ru=a("out_channels"),su=a("."),jc=c(),Be=r("h2"),Ro=r("a"),si=r("span"),_(Tr.$$.fragment),nu=c(),ni=r("span"),au=a("PerceiverOneHotPreprocessor"),Cc=c(),Ae=r("div"),_(kr.$$.fragment),iu=c(),ai=r("p"),lu=a("One-hot preprocessor for Perceiver Encoder. Can be used to add a dummy index dimension to the input."),xc=c(),De=r("h2"),So=r("a"),ii=r("span"),_($r.$$.fragment),cu=c(),li=r("span"),du=a("PerceiverAudioPreprocessor"),Ec=c(),qe=r("div"),_(jr.$$.fragment),pu=c(),ci=r("p"),mu=a("Audio preprocessing for Perceiver Encoder."),Ic=c(),Ge=r("h2"),Xo=r("a"),di=r("span"),_(Cr.$$.fragment),hu=c(),pi=r("span"),uu=a("PerceiverMultimodalPreprocessor"),Fc=c(),le=r("div"),_(xr.$$.fragment),fu=c(),mi=r("p"),gu=a("Multimodal preprocessing for Perceiver Encoder."),vu=c(),hi=r("p"),_u=a(`Inputs for each modality are preprocessed, then padded with trainable position embeddings to have the same number
of channels.`),Jc=c(),Ve=r("h2"),Oo=r("a"),ui=r("span"),_(Er.$$.fragment),yu=c(),fi=r("span"),bu=a("PerceiverProjectionDecoder"),Uc=c(),Re=r("div"),_(Ir.$$.fragment),wu=c(),gi=r("p"),Mu=a("Baseline projection decoder (no cross-attention)."),zc=c(),Se=r("h2"),Ho=r("a"),vi=r("span"),_(Fr.$$.fragment),Pu=c(),_i=r("span"),Tu=a("PerceiverBasicDecoder"),Zc=c(),ce=r("div"),_(Jr.$$.fragment),ku=c(),yi=r("p"),$u=a(`Cross-attention-based decoder. This class can be used to decode the final hidden states of the latents using a
cross-attention operation, in which the latents produce keys and values.`),ju=c(),bi=r("p"),Cu=a("The shape of the output of this class depends on how one defines the output queries (also called decoder queries)."),Nc=c(),Xe=r("h2"),Lo=r("a"),wi=r("span"),_(Ur.$$.fragment),xu=c(),Mi=r("span"),Eu=a("PerceiverClassificationDecoder"),Wc=c(),Oe=r("div"),_(zr.$$.fragment),Iu=c(),Zr=r("p"),Fu=a("Cross-attention based classification decoder. Light-weight wrapper of "),Pi=r("code"),Ju=a("PerceiverBasicDecoder"),Uu=a(` for logit output.
Will turn the output of the Perceiver encoder which is of shape (batch_size, num_latents, d_latents) to a tensor of
shape (batch_size, num_labels). The queries are of shape (batch_size, 1, num_labels).`),Bc=c(),He=r("h2"),Yo=r("a"),Ti=r("span"),_(Nr.$$.fragment),zu=c(),ki=r("span"),Zu=a("PerceiverOpticalFlowDecoder"),Ac=c(),Le=r("div"),_(Wr.$$.fragment),Nu=c(),$i=r("p"),Wu=a("Cross-attention based optical flow decoder."),Dc=c(),Ye=r("h2"),Qo=r("a"),ji=r("span"),_(Br.$$.fragment),Bu=c(),Ci=r("span"),Au=a("PerceiverBasicVideoAutoencodingDecoder"),qc=c(),Qe=r("div"),_(Ar.$$.fragment),Du=c(),Dr=r("p"),qu=a("Cross-attention based video-autoencoding decoder. Light-weight wrapper of ["),xi=r("em"),Gu=a("PerceiverBasicDecoder"),Vu=a(`] with video
reshaping logic.`),Gc=c(),Ke=r("h2"),Ko=r("a"),Ei=r("span"),_(qr.$$.fragment),Ru=c(),Ii=r("span"),Su=a("PerceiverMultimodalDecoder"),Vc=c(),de=r("div"),_(Gr.$$.fragment),Xu=c(),Vr=r("p"),Ou=a("Multimodal decoding by composing uni-modal decoders. The "),Fi=r("em"),Hu=a("modalities"),Lu=a(` argument of the constructor is a dictionary
mapping modality name to the decoder of that modality. That decoder will be used to construct queries for that
modality. Modality-specific queries are padded with trainable modality-specific parameters, after which they are
concatenated along the time dimension.`),Yu=c(),Ji=r("p"),Qu=a("Next, there is a shared cross attention operation across all modalities."),Rc=c(),eo=r("h2"),et=r("a"),Ui=r("span"),_(Rr.$$.fragment),Ku=c(),zi=r("span"),ef=a("PerceiverProjectionPostprocessor"),Sc=c(),oo=r("div"),_(Sr.$$.fragment),of=c(),Zi=r("p"),tf=a(`Projection postprocessing for Perceiver. Can be used to project the channels of the decoder output to a lower
dimension.`),Xc=c(),to=r("h2"),ot=r("a"),Ni=r("span"),_(Xr.$$.fragment),rf=c(),Wi=r("span"),sf=a("PerceiverAudioPostprocessor"),Oc=c(),ro=r("div"),_(Or.$$.fragment),nf=c(),Bi=r("p"),af=a("Audio postprocessing for Perceiver. Can be used to convert the decoder output to audio features."),Hc=c(),so=r("h2"),tt=r("a"),Ai=r("span"),_(Hr.$$.fragment),lf=c(),Di=r("span"),cf=a("PerceiverClassificationPostprocessor"),Lc=c(),no=r("div"),_(Lr.$$.fragment),df=c(),qi=r("p"),pf=a("Classification postprocessing for Perceiver. Can be used to convert the decoder output to classification logits."),Yc=c(),ao=r("h2"),rt=r("a"),Gi=r("span"),_(Yr.$$.fragment),mf=c(),Vi=r("span"),hf=a("PerceiverMultimodalPostprocessor"),Qc=c(),io=r("div"),_(Qr.$$.fragment),uf=c(),Ri=r("p"),ff=a(`Multimodal postprocessing for Perceiver. Can be used to combine modality-specific postprocessors into a single
postprocessor.`),Kc=c(),lo=r("h2"),st=r("a"),Si=r("span"),_(Kr.$$.fragment),gf=c(),Xi=r("span"),vf=a("PerceiverModel"),ed=c(),pe=r("div"),_(es.$$.fragment),_f=c(),os=r("p"),yf=a(`The Perceiver: a scalable, fully attentional architecture.
This model is a PyTorch `),ts=r("a"),bf=a("torch.nn.Module"),wf=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Mf=c(),S=r("div"),_(rs.$$.fragment),Pf=c(),co=r("p"),Tf=a("The "),cn=r("a"),kf=a("PerceiverModel"),$f=a(" forward method, overrides the "),Oi=r("code"),jf=a("__call__"),Cf=a(" special method."),xf=c(),_(nt.$$.fragment),Ef=c(),_(at.$$.fragment),od=c(),po=r("h2"),it=r("a"),Hi=r("span"),_(ss.$$.fragment),If=c(),Li=r("span"),Ff=a("PerceiverForMaskedLM"),td=c(),me=r("div"),_(ns.$$.fragment),Jf=c(),as=r("p"),Uf=a(`Example use of Perceiver for masked language modeling.
This model is a PyTorch `),is=r("a"),zf=a("torch.nn.Module"),Zf=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nf=c(),X=r("div"),_(ls.$$.fragment),Wf=c(),mo=r("p"),Bf=a("The "),dn=r("a"),Af=a("PerceiverForMaskedLM"),Df=a(" forward method, overrides the "),Yi=r("code"),qf=a("__call__"),Gf=a(" special method."),Vf=c(),_(lt.$$.fragment),Rf=c(),_(ct.$$.fragment),rd=c(),ho=r("h2"),dt=r("a"),Qi=r("span"),_(cs.$$.fragment),Sf=c(),Ki=r("span"),Xf=a("PerceiverForSequenceClassification"),sd=c(),he=r("div"),_(ds.$$.fragment),Of=c(),ps=r("p"),Hf=a(`Example use of Perceiver for text classification.
This model is a PyTorch `),ms=r("a"),Lf=a("torch.nn.Module"),Yf=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qf=c(),O=r("div"),_(hs.$$.fragment),Kf=c(),uo=r("p"),eg=a("The "),pn=r("a"),og=a("PerceiverForSequenceClassification"),tg=a(" forward method, overrides the "),el=r("code"),rg=a("__call__"),sg=a(" special method."),ng=c(),_(pt.$$.fragment),ag=c(),_(mt.$$.fragment),nd=c(),fo=r("h2"),ht=r("a"),ol=r("span"),_(us.$$.fragment),ig=c(),tl=r("span"),lg=a("PerceiverForImageClassificationLearned"),ad=c(),J=r("div"),_(fs.$$.fragment),cg=c(),rl=r("p"),dg=a("Example use of Perceiver for image classification, for tasks such as ImageNet."),pg=c(),sl=r("p"),mg=a(`This model uses learned position embeddings. In other words, this model is not given any privileged information about
the structure of images. As shown in the paper, this model can achieve a top-1 accuracy of 72.7 on ImageNet.`),hg=c(),B=r("p"),mn=r("a"),ug=a("PerceiverForImageClassificationLearned"),fg=a(" uses "),hn=r("a"),gg=a("PerceiverImagePreprocessor"),vg=a(`
(with `),nl=r("code"),_g=a('prep_type="conv1x1"'),yg=a(`) to preprocess the input images, and
`),un=r("a"),bg=a("PerceiverClassificationDecoder"),wg=a(` to decode the latent representation of
`),fn=r("a"),Mg=a("PerceiverModel"),Pg=a(" into classification logits."),Tg=c(),gs=r("p"),kg=a("This model is a PyTorch "),vs=r("a"),$g=a("torch.nn.Module"),jg=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cg=c(),H=r("div"),_(_s.$$.fragment),xg=c(),go=r("p"),Eg=a("The "),gn=r("a"),Ig=a("PerceiverForImageClassificationLearned"),Fg=a(" forward method, overrides the "),al=r("code"),Jg=a("__call__"),Ug=a(" special method."),zg=c(),_(ut.$$.fragment),Zg=c(),_(ft.$$.fragment),id=c(),vo=r("h2"),gt=r("a"),il=r("span"),_(ys.$$.fragment),Ng=c(),ll=r("span"),Wg=a("PerceiverForImageClassificationFourier"),ld=c(),U=r("div"),_(bs.$$.fragment),Bg=c(),cl=r("p"),Ag=a("Example use of Perceiver for image classification, for tasks such as ImageNet."),Dg=c(),dl=r("p"),qg=a(`This model uses fixed 2D Fourier position embeddings. As shown in the paper, this model can achieve a top-1 accuracy of
79.0 on ImageNet, and 84.5 when pre-trained on a large-scale dataset (i.e. JFT).`),Gg=c(),A=r("p"),vn=r("a"),Vg=a("PerceiverForImageClassificationLearned"),Rg=a(" uses "),_n=r("a"),Sg=a("PerceiverImagePreprocessor"),Xg=a(`
(with `),pl=r("code"),Og=a('prep_type="pixels"'),Hg=a(`) to preprocess the input images, and
`),yn=r("a"),Lg=a("PerceiverClassificationDecoder"),Yg=a(` to decode the latent representation of
`),bn=r("a"),Qg=a("PerceiverModel"),Kg=a(" into classification logits."),ev=c(),ws=r("p"),ov=a("This model is a PyTorch "),Ms=r("a"),tv=a("torch.nn.Module"),rv=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sv=c(),L=r("div"),_(Ps.$$.fragment),nv=c(),_o=r("p"),av=a("The "),wn=r("a"),iv=a("PerceiverForImageClassificationFourier"),lv=a(" forward method, overrides the "),ml=r("code"),cv=a("__call__"),dv=a(" special method."),pv=c(),_(vt.$$.fragment),mv=c(),_(_t.$$.fragment),cd=c(),yo=r("h2"),yt=r("a"),hl=r("span"),_(Ts.$$.fragment),hv=c(),ul=r("span"),uv=a("PerceiverForImageClassificationConvProcessing"),dd=c(),z=r("div"),_(ks.$$.fragment),fv=c(),fl=r("p"),gv=a("Example use of Perceiver for image classification, for tasks such as ImageNet."),vv=c(),gl=r("p"),_v=a(`This model uses a 2D conv+maxpool preprocessing network. As shown in the paper, this model can achieve a top-1 accuracy
of 82.1 on ImageNet.`),yv=c(),D=r("p"),Mn=r("a"),bv=a("PerceiverForImageClassificationLearned"),wv=a(" uses "),Pn=r("a"),Mv=a("PerceiverImagePreprocessor"),Pv=a(`
(with `),vl=r("code"),Tv=a('prep_type="conv"'),kv=a(`) to preprocess the input images, and
`),Tn=r("a"),$v=a("PerceiverClassificationDecoder"),jv=a(` to decode the latent representation of
`),kn=r("a"),Cv=a("PerceiverModel"),xv=a(" into classification logits."),Ev=c(),$s=r("p"),Iv=a("This model is a PyTorch "),js=r("a"),Fv=a("torch.nn.Module"),Jv=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Uv=c(),Y=r("div"),_(Cs.$$.fragment),zv=c(),bo=r("p"),Zv=a("The "),$n=r("a"),Nv=a("PerceiverForImageClassificationConvProcessing"),Wv=a(" forward method, overrides the "),_l=r("code"),Bv=a("__call__"),Av=a(" special method."),Dv=c(),_(bt.$$.fragment),qv=c(),_(wt.$$.fragment),pd=c(),wo=r("h2"),Mt=r("a"),yl=r("span"),_(xs.$$.fragment),Gv=c(),bl=r("span"),Vv=a("PerceiverForOpticalFlow"),md=c(),N=r("div"),_(Es.$$.fragment),Rv=c(),W=r("p"),Sv=a("Example use of Perceiver for optical flow, for tasks such as Sintel and KITTI. "),jn=r("a"),Xv=a("PerceiverForOpticalFlow"),Ov=a(` uses
`),Cn=r("a"),Hv=a("PerceiverImagePreprocessor"),Lv=a(" (with "),wl=r("em"),Yv=a("prep_type=\u201Cpatches\u201D"),Qv=a(`) to preprocess the
input images, and `),xn=r("a"),Kv=a("PerceiverOpticalFlowDecoder"),e_=a(` to decode the latent
representation of `),En=r("a"),o_=a("PerceiverModel"),t_=a("."),r_=c(),Ml=r("p"),s_=a(`As input, one concatenates 2 subsequent frames along the channel dimension and extract a 3 x 3 patch around each pixel
(leading to 3 x 3 x 3 x 2 = 54 values for each pixel). Fixed Fourier position encodings are used to encode the position
of each pixel in the patch. Next, one applies the Perceiver encoder. To decode, one queries the latent representation
using the same encoding used for the input.`),n_=c(),Is=r("p"),a_=a("This model is a PyTorch "),Fs=r("a"),i_=a("torch.nn.Module"),l_=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),c_=c(),Q=r("div"),_(Js.$$.fragment),d_=c(),Mo=r("p"),p_=a("The "),In=r("a"),m_=a("PerceiverForOpticalFlow"),h_=a(" forward method, overrides the "),Pl=r("code"),u_=a("__call__"),f_=a(" special method."),g_=c(),_(Pt.$$.fragment),v_=c(),_(Tt.$$.fragment),hd=c(),Po=r("h2"),kt=r("a"),Tl=r("span"),_(Us.$$.fragment),__=c(),kl=r("span"),y_=a("PerceiverForMultimodalAutoencoding"),ud=c(),E=r("div"),_(zs.$$.fragment),b_=c(),$l=r("p"),w_=a("Example use of Perceiver for multimodal (video) autoencoding, for tasks such as Kinetics-700."),M_=c(),$t=r("p"),Fn=r("a"),P_=a("PerceiverForMultimodalAutoencoding"),T_=a(" uses "),Jn=r("a"),k_=a("PerceiverMultimodalPreprocessor"),$_=a(` to
preprocess the 3 modalities: images, audio and class labels. This preprocessor uses modality-specific preprocessors to
preprocess every modality separately, after which they are concatenated. Trainable position embeddings are used to pad
each modality to the same number of channels to make concatenation along the time dimension possible. Next, one applies
the Perceiver encoder.`),j_=c(),be=r("p"),Un=r("a"),C_=a("PerceiverMultimodalDecoder"),x_=a(` is used to decode the latent representation of
`),zn=r("a"),E_=a("PerceiverModel"),I_=a(`. This decoder uses each modality-specific decoder to construct queries. The decoder queries are
created based on the inputs after preprocessing. However, autoencoding an entire video in a single forward pass is
computationally infeasible, hence one only uses parts of the decoder queries to do cross-attention with the latent
representation. This is determined by the subsampled indices for each modality, which can be provided as additional
input to the forward pass of `),Zn=r("a"),F_=a("PerceiverForMultimodalAutoencoding"),J_=a("."),U_=c(),jt=r("p"),Nn=r("a"),z_=a("PerceiverMultimodalDecoder"),Z_=a(` also pads the decoder queries of the different
modalities to the same number of channels, in order to concatenate them along the time dimension. Next, cross-attention
is performed with the latent representation of `),Wn=r("a"),N_=a("PerceiverModel"),W_=a("."),B_=c(),Zs=r("p"),A_=a("Finally, "),jl=r("code"),D_=a("~models.perceiver.modeling_perceiver.PerceiverMultiModalPostprocessor"),q_=a(` is used to turn this tensor into an
actual video. It first splits up the output into the different modalities, and then applies the respective
postprocessor for each modality.`),G_=c(),Cl=r("p"),V_=a(`Note that, by masking the classification label during evaluation (i.e. simply providing a tensor of zeros for the
\u201Clabel\u201D modality), this auto-encoding model becomes a Kinetics 700 video classifier.`),R_=c(),Ns=r("p"),S_=a("This model is a PyTorch "),Ws=r("a"),X_=a("torch.nn.Module"),O_=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),H_=c(),K=r("div"),_(Bs.$$.fragment),L_=c(),To=r("p"),Y_=a("The "),Bn=r("a"),Q_=a("PerceiverForMultimodalAutoencoding"),K_=a(" forward method, overrides the "),xl=r("code"),ey=a("__call__"),oy=a(" special method."),ty=c(),_(Ct.$$.fragment),ry=c(),_(xt.$$.fragment),this.h()},l(o){const m=lM('[data-svelte="svelte-1phssyn"]',document.head);u=s(m,"META",{name:!0,content:!0}),m.forEach(t),k=d(o),v=s(o,"H1",{class:!0});var As=n(v);g=s(As,"A",{id:!0,class:!0,href:!0});var El=n(g);T=s(El,"SPAN",{});var Il=n(T);y(p.$$.fragment,Il),Il.forEach(t),El.forEach(t),f=d(As),x=s(As,"SPAN",{});var Fl=n(x);jp=i(Fl,"Perceiver"),Fl.forEach(t),As.forEach(t),Rl=d(o),Pe=s(o,"H2",{class:!0});var Ds=n(Pe);Co=s(Ds,"A",{id:!0,class:!0,href:!0});var Jl=n(Co);ia=s(Jl,"SPAN",{});var Ul=n(ia);y(Dt.$$.fragment,Ul),Ul.forEach(t),Jl.forEach(t),Cp=d(Ds),la=s(Ds,"SPAN",{});var zl=n(la);xp=i(zl,"Overview"),zl.forEach(t),Ds.forEach(t),Sl=d(o),xo=s(o,"P",{});var qs=n(xo);Ep=i(qs,"The Perceiver IO model was proposed in "),qt=s(qs,"A",{href:!0,rel:!0});var Zl=n(qt);Ip=i(Zl,`Perceiver IO: A General Architecture for Structured Inputs &
Outputs`),Zl.forEach(t),Fp=i(qs,` by Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch,
Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier H\xE9naff, Matthew M.
Botvinick, Andrew Zisserman, Oriol Vinyals, Jo\xE3o Carreira.`),qs.forEach(t),Xl=d(o),Eo=s(o,"P",{});var Gs=n(Eo);Jp=i(Gs,"Perceiver IO is a generalization of "),Gt=s(Gs,"A",{href:!0,rel:!0});var Nl=n(Gt);Up=i(Nl,"Perceiver"),Nl.forEach(t),zp=i(Gs,` to handle arbitrary outputs in
addition to arbitrary inputs. The original Perceiver only produced a single classification label. In addition to
classification labels, Perceiver IO can produce (for example) language, optical flow, and multimodal videos with audio.
This is done using the same building blocks as the original Perceiver. The computational complexity of Perceiver IO is
linear in the input and output size and the bulk of the processing occurs in the latent space, allowing us to process
inputs and outputs that are much larger than can be handled by standard Transformers. This means, for example,
Perceiver IO can do BERT-style masked language modeling directly using bytes instead of tokenized inputs.`),Gs.forEach(t),Ol=d(o),Ss=s(o,"P",{});var Wl=n(Ss);Zp=i(Wl,"The abstract from the paper is the following:"),Wl.forEach(t),Hl=d(o),Xs=s(o,"P",{});var Bl=n(Xs);ca=s(Bl,"EM",{});var Al=n(ca);Np=i(Al,`The recently-proposed Perceiver model obtains good results on several domains (images, audio, multimodal, point
clouds) while scaling linearly in compute and memory with the input size. While the Perceiver supports many kinds of
inputs, it can only produce very simple outputs such as class scores. Perceiver IO overcomes this limitation without
sacrificing the original\u2019s appealing properties by learning to flexibly query the model\u2019s latent space to produce
outputs of arbitrary size and semantics. Perceiver IO still decouples model depth from data size and still scales
linearly with data size, but now with respect to both input and output sizes. The full Perceiver IO model achieves
strong results on tasks with highly structured output spaces, such as natural language and visual understanding,
StarCraft II, and multi-task and multi-modal domains. As highlights, Perceiver IO matches a Transformer-based BERT
baseline on the GLUE language benchmark without the need for input tokenization and achieves state-of-the-art
performance on Sintel optical flow estimation.`),Al.forEach(t),Bl.forEach(t),Ll=d(o),Os=s(o,"P",{});var Dl=n(Os);Wp=i(Dl,"Here\u2019s a TLDR explaining how Perceiver works:"),Dl.forEach(t),Yl=d(o),Hs=s(o,"P",{});var ql=n(Hs);Bp=i(ql,`The main problem with the self-attention mechanism of the Transformer is that the time and memory requirements scale
quadratically with the sequence length. Hence, models like BERT and RoBERTa are limited to a max sequence length of 512
tokens. Perceiver aims to solve this issue by, instead of performing self-attention on the inputs, perform it on a set
of latent variables, and only use the inputs for cross-attention. In this way, the time and memory requirements don\u2019t
depend on the length of the inputs anymore, as one uses a fixed amount of latent variables, like 256 or 512. These are
randomly initialized, after which they are trained end-to-end using backpropagation.`),ql.forEach(t),Ql=d(o),Z=s(o,"P",{});var ee=n(Z);Ap=i(ee,"Internally, "),Ls=s(ee,"A",{href:!0});var iy=n(Ls);Dp=i(iy,"PerceiverModel"),iy.forEach(t),qp=i(ee," will create the latents, which is a tensor of shape "),da=s(ee,"CODE",{});var ly=n(da);Gp=i(ly,"(batch_size, num_latents, d_latents)"),ly.forEach(t),Vp=i(ee,". One must provide "),pa=s(ee,"CODE",{});var cy=n(pa);Rp=i(cy,"inputs"),cy.forEach(t),Sp=i(ee,` (which could be text, images, audio, you name it!) to the model, which it will
use to perform cross-attention with the latents. The output of the Perceiver encoder is a tensor of the same shape. One
can then, similar to BERT, convert the last hidden states of the latents to classification logits by averaging along
the sequence dimension, and placing a linear layer on top of that to project the `),ma=s(ee,"CODE",{});var dy=n(ma);Xp=i(dy,"d_latents"),dy.forEach(t),Op=i(ee," to "),ha=s(ee,"CODE",{});var py=n(ha);Hp=i(py,"num_labels"),py.forEach(t),Lp=i(ee,"."),ee.forEach(t),Kl=d(o),Ys=s(o,"P",{});var my=n(Ys);Yp=i(my,`This was the idea of the original Perceiver paper. However, it could only output classification logits. In a follow-up
work, PerceiverIO, they generalized it to let the model also produce outputs of arbitrary size. How, you might ask? The
idea is actually relatively simple: one defines outputs of an arbitrary size, and then applies cross-attention with the
last hidden states of the latents, using the outputs as queries, and the latents as keys and values.`),my.forEach(t),ec=d(o),I=s(o,"P",{});var q=n(I);Qp=i(q,`So let\u2019s say one wants to perform masked language modeling (BERT-style) with the Perceiver. As the Perceiver\u2019s input
length will not have an impact on the computation time of the self-attention layers, one can provide raw bytes,
providing `),ua=s(q,"CODE",{});var hy=n(ua);Kp=i(hy,"inputs"),hy.forEach(t),em=i(q,` of length 2048 to the model. If one now masks out certain of these 2048 tokens, one can define the
`),fa=s(q,"CODE",{});var uy=n(fa);om=i(uy,"outputs"),uy.forEach(t),tm=i(q," as being of shape: "),ga=s(q,"CODE",{});var fy=n(ga);rm=i(fy,"(batch_size, 2048, 768)"),fy.forEach(t),sm=i(q,`. Next, one performs cross-attention with the final hidden states
of the latents to update the `),va=s(q,"CODE",{});var gy=n(va);nm=i(gy,"outputs"),gy.forEach(t),am=i(q," tensor. After cross-attention, one still has a tensor of shape "),_a=s(q,"CODE",{});var vy=n(_a);im=i(vy,"(batch_size, 2048, 768)"),vy.forEach(t),lm=i(q,`. One can then place a regular language modeling head on top, to project the last dimension to the
vocabulary size of the model, i.e. creating logits of shape `),ya=s(q,"CODE",{});var _y=n(ya);cm=i(_y,"(batch_size, 2048, 262)"),_y.forEach(t),dm=i(q,` (as Perceiver uses a vocabulary
size of 262 byte IDs).`),q.forEach(t),oc=d(o),Io=s(o,"IMG",{src:!0,alt:!0,width:!0}),tc=d(o),Vt=s(o,"SMALL",{});var sy=n(Vt);pm=i(sy,"Perceiver IO architecture. Taken from the "),Qs=s(sy,"A",{href:!0});var yy=n(Qs);mm=i(yy,"original paper"),yy.forEach(t),sy.forEach(t),rc=d(o),ve=s(o,"P",{});var An=n(ve);hm=i(An,"This model was contributed by "),Rt=s(An,"A",{href:!0,rel:!0});var by=n(Rt);um=i(by,"nielsr"),by.forEach(t),fm=i(An,`. The original code can be found
`),St=s(An,"A",{href:!0,rel:!0});var wy=n(St);gm=i(wy,"here"),wy.forEach(t),vm=i(An,"."),An.forEach(t),sc=d(o),Ks=s(o,"P",{});var My=n(Ks);_m=i(My,"Tips:"),My.forEach(t),nc=d(o),Fo=s(o,"UL",{});var gd=n(Fo);Xt=s(gd,"LI",{});var vd=n(Xt);ym=i(vd,"The quickest way to get started with the Perceiver is by checking the "),Ot=s(vd,"A",{href:!0,rel:!0});var Py=n(Ot);bm=i(Py,`tutorial
notebooks`),Py.forEach(t),wm=i(vd,"."),vd.forEach(t),Mm=d(gd),Ht=s(gd,"LI",{});var _d=n(Ht);Pm=i(_d,"Refer to the "),Lt=s(_d,"A",{href:!0,rel:!0});var Ty=n(Lt);Tm=i(Ty,"blog post"),Ty.forEach(t),km=i(_d,` if you want to fully understand how the model works and
is implemented in the library. Note that the models available in the library only showcase some examples of what you can do
with the Perceiver. There are many more use cases, including question answering, named-entity recognition, object detection,
audio classification, video classification, etc.`),_d.forEach(t),gd.forEach(t),ac=d(o),Yt=s(o,"P",{});var ny=n(Yt);ba=s(ny,"STRONG",{});var ky=n(ba);$m=i(ky,"Note"),ky.forEach(t),jm=i(ny,":"),ny.forEach(t),ic=d(o),en=s(o,"UL",{});var $y=n(en);_e=s($y,"LI",{});var Vs=n(_e);Cm=i(Vs,"Perceiver does "),wa=s(Vs,"STRONG",{});var jy=n(wa);xm=i(jy,"not"),jy.forEach(t),Em=i(Vs," work with "),Ma=s(Vs,"CODE",{});var Cy=n(Ma);Im=i(Cy,"torch.nn.DataParallel"),Cy.forEach(t),Fm=i(Vs," due to a bug in PyTorch, see "),Qt=s(Vs,"A",{href:!0,rel:!0});var xy=n(Qt);Jm=i(xy,"issue #36035"),xy.forEach(t),Vs.forEach(t),$y.forEach(t),lc=d(o),Te=s(o,"H2",{class:!0});var yd=n(Te);Jo=s(yd,"A",{id:!0,class:!0,href:!0});var Ey=n(Jo);Pa=s(Ey,"SPAN",{});var Iy=n(Pa);y(Kt.$$.fragment,Iy),Iy.forEach(t),Ey.forEach(t),Um=d(yd),Ta=s(yd,"SPAN",{});var Fy=n(Ta);zm=i(Fy,"Documentation resources"),Fy.forEach(t),yd.forEach(t),cc=d(o),ye=s(o,"UL",{});var Dn=n(ye);ka=s(Dn,"LI",{});var Jy=n(ka);on=s(Jy,"A",{href:!0});var Uy=n(on);Zm=i(Uy,"Text classification task guide"),Uy.forEach(t),Jy.forEach(t),Nm=d(Dn),$a=s(Dn,"LI",{});var zy=n($a);tn=s(zy,"A",{href:!0});var Zy=n(tn);Wm=i(Zy,"Masked language modeling task guide"),Zy.forEach(t),zy.forEach(t),Bm=d(Dn),ja=s(Dn,"LI",{});var Ny=n(ja);rn=s(Ny,"A",{href:!0});var Wy=n(rn);Am=i(Wy,"Image classification task guide"),Wy.forEach(t),Ny.forEach(t),Dn.forEach(t),dc=d(o),ke=s(o,"H2",{class:!0});var bd=n(ke);Uo=s(bd,"A",{id:!0,class:!0,href:!0});var By=n(Uo);Ca=s(By,"SPAN",{});var Ay=n(Ca);y(er.$$.fragment,Ay),Ay.forEach(t),By.forEach(t),Dm=d(bd),xa=s(bd,"SPAN",{});var Dy=n(xa);qm=i(Dy,"Perceiver specific outputs"),Dy.forEach(t),bd.forEach(t),pc=d(o),$e=s(o,"DIV",{class:!0});var wd=n($e);y(or.$$.fragment,wd),Gm=d(wd),Ea=s(wd,"P",{});var qy=n(Ea);Vm=i(qy,"Base class for Perceiver base model\u2019s outputs, with potential hidden states, attentions and cross-attentions."),qy.forEach(t),wd.forEach(t),mc=d(o),je=s(o,"DIV",{class:!0});var Md=n(je);y(tr.$$.fragment,Md),Rm=d(Md),Ia=s(Md,"P",{});var Gy=n(Ia);Sm=i(Gy,"Base class for Perceiver decoder outputs, with potential cross-attentions."),Gy.forEach(t),Md.forEach(t),hc=d(o),Ce=s(o,"DIV",{class:!0});var Pd=n(Ce);y(rr.$$.fragment,Pd),Xm=d(Pd),Fa=s(Pd,"P",{});var Vy=n(Fa);Om=i(Vy,"Base class for Perceiver\u2019s masked language model outputs."),Vy.forEach(t),Pd.forEach(t),uc=d(o),xe=s(o,"DIV",{class:!0});var Td=n(xe);y(sr.$$.fragment,Td),Hm=d(Td),Ja=s(Td,"P",{});var Ry=n(Ja);Lm=i(Ry,`Base class for Perceiver\u2019s outputs of sequence/image classification models, optical flow and multimodal
autoencoding.`),Ry.forEach(t),Td.forEach(t),fc=d(o),Ee=s(o,"H2",{class:!0});var kd=n(Ee);zo=s(kd,"A",{id:!0,class:!0,href:!0});var Sy=n(zo);Ua=s(Sy,"SPAN",{});var Xy=n(Ua);y(nr.$$.fragment,Xy),Xy.forEach(t),Sy.forEach(t),Ym=d(kd),za=s(kd,"SPAN",{});var Oy=n(za);Qm=i(Oy,"PerceiverConfig"),Oy.forEach(t),kd.forEach(t),gc=d(o),G=s(o,"DIV",{class:!0});var Et=n(G);y(ar.$$.fragment,Et),Km=d(Et),Ie=s(Et,"P",{});var qn=n(Ie);eh=i(qn,"This is the configuration class to store the configuration of a "),sn=s(qn,"A",{href:!0});var Hy=n(sn);oh=i(Hy,"PerceiverModel"),Hy.forEach(t),th=i(qn,`. It is used to instantiate an
Perceiver 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 Perceiver
`),ir=s(qn,"A",{href:!0,rel:!0});var Ly=n(ir);rh=i(Ly,"deepmind/language-perceiver"),Ly.forEach(t),sh=i(qn," architecture."),qn.forEach(t),nh=d(Et),Fe=s(Et,"P",{});var Gn=n(Fe);ah=i(Gn,"Configuration objects inherit from "),nn=s(Gn,"A",{href:!0});var Yy=n(nn);ih=i(Yy,"PretrainedConfig"),Yy.forEach(t),lh=i(Gn,` and can be used to control the model outputs. Read the
documentation from `),an=s(Gn,"A",{href:!0});var Qy=n(an);ch=i(Qy,"PretrainedConfig"),Qy.forEach(t),dh=i(Gn," for more information."),Gn.forEach(t),ph=d(Et),y(Zo.$$.fragment,Et),Et.forEach(t),vc=d(o),Je=s(o,"H2",{class:!0});var $d=n(Je);No=s($d,"A",{id:!0,class:!0,href:!0});var Ky=n(No);Za=s(Ky,"SPAN",{});var eb=n(Za);y(lr.$$.fragment,eb),eb.forEach(t),Ky.forEach(t),mh=d($d),Na=s($d,"SPAN",{});var ob=n(Na);hh=i(ob,"PerceiverTokenizer"),ob.forEach(t),$d.forEach(t),_c=d(o),V=s(o,"DIV",{class:!0});var It=n(V);y(cr.$$.fragment,It),uh=d(It),Wa=s(It,"P",{});var tb=n(Wa);fh=i(tb,"Construct a Perceiver tokenizer. The Perceiver simply uses raw bytes utf-8 encoding."),tb.forEach(t),gh=d(It),dr=s(It,"P",{});var jd=n(dr);vh=i(jd,"This tokenizer inherits from "),ln=s(jd,"A",{href:!0});var rb=n(ln);_h=i(rb,"PreTrainedTokenizer"),rb.forEach(t),yh=i(jd,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),jd.forEach(t),bh=d(It),Wo=s(It,"DIV",{class:!0});var Cd=n(Wo);y(pr.$$.fragment,Cd),wh=d(Cd),Ba=s(Cd,"P",{});var sb=n(Ba);Mh=i(sb,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),sb.forEach(t),Cd.forEach(t),It.forEach(t),yc=d(o),Ue=s(o,"H2",{class:!0});var xd=n(Ue);Bo=s(xd,"A",{id:!0,class:!0,href:!0});var nb=n(Bo);Aa=s(nb,"SPAN",{});var ab=n(Aa);y(mr.$$.fragment,ab),ab.forEach(t),nb.forEach(t),Ph=d(xd),Da=s(xd,"SPAN",{});var ib=n(Da);Th=i(ib,"PerceiverFeatureExtractor"),ib.forEach(t),xd.forEach(t),bc=d(o),ze=s(o,"DIV",{class:!0});var Ed=n(ze);y(hr.$$.fragment,Ed),kh=d(Ed),Ao=s(Ed,"DIV",{class:!0});var Id=n(Ao);y(ur.$$.fragment,Id),$h=d(Id),qa=s(Id,"P",{});var lb=n(qa);jh=i(lb,"Preprocess an image or a batch of images."),lb.forEach(t),Id.forEach(t),Ed.forEach(t),wc=d(o),Ze=s(o,"H2",{class:!0});var Fd=n(Ze);Do=s(Fd,"A",{id:!0,class:!0,href:!0});var cb=n(Do);Ga=s(cb,"SPAN",{});var db=n(Ga);y(fr.$$.fragment,db),db.forEach(t),cb.forEach(t),Ch=d(Fd),Va=s(Fd,"SPAN",{});var pb=n(Va);xh=i(pb,"PerceiverImageProcessor"),pb.forEach(t),Fd.forEach(t),Mc=d(o),ne=s(o,"DIV",{class:!0});var Vn=n(ne);y(gr.$$.fragment,Vn),Eh=d(Vn),Ra=s(Vn,"P",{});var mb=n(Ra);Ih=i(mb,"Constructs a Perceiver image processor."),mb.forEach(t),Fh=d(Vn),qo=s(Vn,"DIV",{class:!0});var Jd=n(qo);y(vr.$$.fragment,Jd),Jh=d(Jd),Sa=s(Jd,"P",{});var hb=n(Sa);Uh=i(hb,"Preprocess an image or batch of images."),hb.forEach(t),Jd.forEach(t),Vn.forEach(t),Pc=d(o),Ne=s(o,"H2",{class:!0});var Ud=n(Ne);Go=s(Ud,"A",{id:!0,class:!0,href:!0});var ub=n(Go);Xa=s(ub,"SPAN",{});var fb=n(Xa);y(_r.$$.fragment,fb),fb.forEach(t),ub.forEach(t),zh=d(Ud),Oa=s(Ud,"SPAN",{});var gb=n(Oa);Zh=i(gb,"PerceiverTextPreprocessor"),gb.forEach(t),Ud.forEach(t),Tc=d(o),ae=s(o,"DIV",{class:!0});var Rn=n(ae);y(yr.$$.fragment,Rn),Nh=d(Rn),br=s(Rn,"P",{});var zd=n(br);Wh=i(zd,"Text preprocessing for Perceiver Encoder. Can be used to embed "),Ha=s(zd,"CODE",{});var vb=n(Ha);Bh=i(vb,"inputs"),vb.forEach(t),Ah=i(zd," and add positional encodings."),zd.forEach(t),Dh=d(Rn),wr=s(Rn,"P",{});var Zd=n(wr);qh=i(Zd,"The dimensionality of the embeddings is determined by the "),La=s(Zd,"CODE",{});var _b=n(La);Gh=i(_b,"d_model"),_b.forEach(t),Vh=i(Zd," attribute of the configuration."),Zd.forEach(t),Rn.forEach(t),kc=d(o),We=s(o,"H2",{class:!0});var Nd=n(We);Vo=s(Nd,"A",{id:!0,class:!0,href:!0});var yb=n(Vo);Ya=s(yb,"SPAN",{});var bb=n(Ya);y(Mr.$$.fragment,bb),bb.forEach(t),yb.forEach(t),Rh=d(Nd),Qa=s(Nd,"SPAN",{});var wb=n(Qa);Sh=i(wb,"PerceiverImagePreprocessor"),wb.forEach(t),Nd.forEach(t),$c=d(o),ie=s(o,"DIV",{class:!0});var Sn=n(ie);y(Pr.$$.fragment,Sn),Xh=d(Sn),Ka=s(Sn,"P",{});var Mb=n(Ka);Oh=i(Mb,"Image preprocessing for Perceiver Encoder."),Mb.forEach(t),Hh=d(Sn),R=s(Sn,"P",{});var we=n(R);Lh=i(we,"Note: the "),ei=s(we,"EM",{});var Pb=n(ei);Yh=i(Pb,"out_channels"),Pb.forEach(t),Qh=i(we," argument refers to the output channels of a convolutional layer, if "),oi=s(we,"EM",{});var Tb=n(oi);Kh=i(Tb,"prep_type"),Tb.forEach(t),eu=i(we,` is set to
\u201Cconv1x1\u201D or \u201Cconv\u201D. If one adds absolute position embeddings, one must make sure the `),ti=s(we,"EM",{});var kb=n(ti);ou=i(kb,"num_channels"),kb.forEach(t),tu=i(we,` of the
position encoding kwargs are set equal to the `),ri=s(we,"EM",{});var $b=n(ri);ru=i($b,"out_channels"),$b.forEach(t),su=i(we,"."),we.forEach(t),Sn.forEach(t),jc=d(o),Be=s(o,"H2",{class:!0});var Wd=n(Be);Ro=s(Wd,"A",{id:!0,class:!0,href:!0});var jb=n(Ro);si=s(jb,"SPAN",{});var Cb=n(si);y(Tr.$$.fragment,Cb),Cb.forEach(t),jb.forEach(t),nu=d(Wd),ni=s(Wd,"SPAN",{});var xb=n(ni);au=i(xb,"PerceiverOneHotPreprocessor"),xb.forEach(t),Wd.forEach(t),Cc=d(o),Ae=s(o,"DIV",{class:!0});var Bd=n(Ae);y(kr.$$.fragment,Bd),iu=d(Bd),ai=s(Bd,"P",{});var Eb=n(ai);lu=i(Eb,"One-hot preprocessor for Perceiver Encoder. Can be used to add a dummy index dimension to the input."),Eb.forEach(t),Bd.forEach(t),xc=d(o),De=s(o,"H2",{class:!0});var Ad=n(De);So=s(Ad,"A",{id:!0,class:!0,href:!0});var Ib=n(So);ii=s(Ib,"SPAN",{});var Fb=n(ii);y($r.$$.fragment,Fb),Fb.forEach(t),Ib.forEach(t),cu=d(Ad),li=s(Ad,"SPAN",{});var Jb=n(li);du=i(Jb,"PerceiverAudioPreprocessor"),Jb.forEach(t),Ad.forEach(t),Ec=d(o),qe=s(o,"DIV",{class:!0});var Dd=n(qe);y(jr.$$.fragment,Dd),pu=d(Dd),ci=s(Dd,"P",{});var Ub=n(ci);mu=i(Ub,"Audio preprocessing for Perceiver Encoder."),Ub.forEach(t),Dd.forEach(t),Ic=d(o),Ge=s(o,"H2",{class:!0});var qd=n(Ge);Xo=s(qd,"A",{id:!0,class:!0,href:!0});var zb=n(Xo);di=s(zb,"SPAN",{});var Zb=n(di);y(Cr.$$.fragment,Zb),Zb.forEach(t),zb.forEach(t),hu=d(qd),pi=s(qd,"SPAN",{});var Nb=n(pi);uu=i(Nb,"PerceiverMultimodalPreprocessor"),Nb.forEach(t),qd.forEach(t),Fc=d(o),le=s(o,"DIV",{class:!0});var Xn=n(le);y(xr.$$.fragment,Xn),fu=d(Xn),mi=s(Xn,"P",{});var Wb=n(mi);gu=i(Wb,"Multimodal preprocessing for Perceiver Encoder."),Wb.forEach(t),vu=d(Xn),hi=s(Xn,"P",{});var Bb=n(hi);_u=i(Bb,`Inputs for each modality are preprocessed, then padded with trainable position embeddings to have the same number
of channels.`),Bb.forEach(t),Xn.forEach(t),Jc=d(o),Ve=s(o,"H2",{class:!0});var Gd=n(Ve);Oo=s(Gd,"A",{id:!0,class:!0,href:!0});var Ab=n(Oo);ui=s(Ab,"SPAN",{});var Db=n(ui);y(Er.$$.fragment,Db),Db.forEach(t),Ab.forEach(t),yu=d(Gd),fi=s(Gd,"SPAN",{});var qb=n(fi);bu=i(qb,"PerceiverProjectionDecoder"),qb.forEach(t),Gd.forEach(t),Uc=d(o),Re=s(o,"DIV",{class:!0});var Vd=n(Re);y(Ir.$$.fragment,Vd),wu=d(Vd),gi=s(Vd,"P",{});var Gb=n(gi);Mu=i(Gb,"Baseline projection decoder (no cross-attention)."),Gb.forEach(t),Vd.forEach(t),zc=d(o),Se=s(o,"H2",{class:!0});var Rd=n(Se);Ho=s(Rd,"A",{id:!0,class:!0,href:!0});var Vb=n(Ho);vi=s(Vb,"SPAN",{});var Rb=n(vi);y(Fr.$$.fragment,Rb),Rb.forEach(t),Vb.forEach(t),Pu=d(Rd),_i=s(Rd,"SPAN",{});var Sb=n(_i);Tu=i(Sb,"PerceiverBasicDecoder"),Sb.forEach(t),Rd.forEach(t),Zc=d(o),ce=s(o,"DIV",{class:!0});var On=n(ce);y(Jr.$$.fragment,On),ku=d(On),yi=s(On,"P",{});var Xb=n(yi);$u=i(Xb,`Cross-attention-based decoder. This class can be used to decode the final hidden states of the latents using a
cross-attention operation, in which the latents produce keys and values.`),Xb.forEach(t),ju=d(On),bi=s(On,"P",{});var Ob=n(bi);Cu=i(Ob,"The shape of the output of this class depends on how one defines the output queries (also called decoder queries)."),Ob.forEach(t),On.forEach(t),Nc=d(o),Xe=s(o,"H2",{class:!0});var Sd=n(Xe);Lo=s(Sd,"A",{id:!0,class:!0,href:!0});var Hb=n(Lo);wi=s(Hb,"SPAN",{});var Lb=n(wi);y(Ur.$$.fragment,Lb),Lb.forEach(t),Hb.forEach(t),xu=d(Sd),Mi=s(Sd,"SPAN",{});var Yb=n(Mi);Eu=i(Yb,"PerceiverClassificationDecoder"),Yb.forEach(t),Sd.forEach(t),Wc=d(o),Oe=s(o,"DIV",{class:!0});var Xd=n(Oe);y(zr.$$.fragment,Xd),Iu=d(Xd),Zr=s(Xd,"P",{});var Od=n(Zr);Fu=i(Od,"Cross-attention based classification decoder. Light-weight wrapper of "),Pi=s(Od,"CODE",{});var Qb=n(Pi);Ju=i(Qb,"PerceiverBasicDecoder"),Qb.forEach(t),Uu=i(Od,` for logit output.
Will turn the output of the Perceiver encoder which is of shape (batch_size, num_latents, d_latents) to a tensor of
shape (batch_size, num_labels). The queries are of shape (batch_size, 1, num_labels).`),Od.forEach(t),Xd.forEach(t),Bc=d(o),He=s(o,"H2",{class:!0});var Hd=n(He);Yo=s(Hd,"A",{id:!0,class:!0,href:!0});var Kb=n(Yo);Ti=s(Kb,"SPAN",{});var e2=n(Ti);y(Nr.$$.fragment,e2),e2.forEach(t),Kb.forEach(t),zu=d(Hd),ki=s(Hd,"SPAN",{});var o2=n(ki);Zu=i(o2,"PerceiverOpticalFlowDecoder"),o2.forEach(t),Hd.forEach(t),Ac=d(o),Le=s(o,"DIV",{class:!0});var Ld=n(Le);y(Wr.$$.fragment,Ld),Nu=d(Ld),$i=s(Ld,"P",{});var t2=n($i);Wu=i(t2,"Cross-attention based optical flow decoder."),t2.forEach(t),Ld.forEach(t),Dc=d(o),Ye=s(o,"H2",{class:!0});var Yd=n(Ye);Qo=s(Yd,"A",{id:!0,class:!0,href:!0});var r2=n(Qo);ji=s(r2,"SPAN",{});var s2=n(ji);y(Br.$$.fragment,s2),s2.forEach(t),r2.forEach(t),Bu=d(Yd),Ci=s(Yd,"SPAN",{});var n2=n(Ci);Au=i(n2,"PerceiverBasicVideoAutoencodingDecoder"),n2.forEach(t),Yd.forEach(t),qc=d(o),Qe=s(o,"DIV",{class:!0});var Qd=n(Qe);y(Ar.$$.fragment,Qd),Du=d(Qd),Dr=s(Qd,"P",{});var Kd=n(Dr);qu=i(Kd,"Cross-attention based video-autoencoding decoder. Light-weight wrapper of ["),xi=s(Kd,"EM",{});var a2=n(xi);Gu=i(a2,"PerceiverBasicDecoder"),a2.forEach(t),Vu=i(Kd,`] with video
reshaping logic.`),Kd.forEach(t),Qd.forEach(t),Gc=d(o),Ke=s(o,"H2",{class:!0});var ep=n(Ke);Ko=s(ep,"A",{id:!0,class:!0,href:!0});var i2=n(Ko);Ei=s(i2,"SPAN",{});var l2=n(Ei);y(qr.$$.fragment,l2),l2.forEach(t),i2.forEach(t),Ru=d(ep),Ii=s(ep,"SPAN",{});var c2=n(Ii);Su=i(c2,"PerceiverMultimodalDecoder"),c2.forEach(t),ep.forEach(t),Vc=d(o),de=s(o,"DIV",{class:!0});var Hn=n(de);y(Gr.$$.fragment,Hn),Xu=d(Hn),Vr=s(Hn,"P",{});var op=n(Vr);Ou=i(op,"Multimodal decoding by composing uni-modal decoders. The "),Fi=s(op,"EM",{});var d2=n(Fi);Hu=i(d2,"modalities"),d2.forEach(t),Lu=i(op,` argument of the constructor is a dictionary
mapping modality name to the decoder of that modality. That decoder will be used to construct queries for that
modality. Modality-specific queries are padded with trainable modality-specific parameters, after which they are
concatenated along the time dimension.`),op.forEach(t),Yu=d(Hn),Ji=s(Hn,"P",{});var p2=n(Ji);Qu=i(p2,"Next, there is a shared cross attention operation across all modalities."),p2.forEach(t),Hn.forEach(t),Rc=d(o),eo=s(o,"H2",{class:!0});var tp=n(eo);et=s(tp,"A",{id:!0,class:!0,href:!0});var m2=n(et);Ui=s(m2,"SPAN",{});var h2=n(Ui);y(Rr.$$.fragment,h2),h2.forEach(t),m2.forEach(t),Ku=d(tp),zi=s(tp,"SPAN",{});var u2=n(zi);ef=i(u2,"PerceiverProjectionPostprocessor"),u2.forEach(t),tp.forEach(t),Sc=d(o),oo=s(o,"DIV",{class:!0});var rp=n(oo);y(Sr.$$.fragment,rp),of=d(rp),Zi=s(rp,"P",{});var f2=n(Zi);tf=i(f2,`Projection postprocessing for Perceiver. Can be used to project the channels of the decoder output to a lower
dimension.`),f2.forEach(t),rp.forEach(t),Xc=d(o),to=s(o,"H2",{class:!0});var sp=n(to);ot=s(sp,"A",{id:!0,class:!0,href:!0});var g2=n(ot);Ni=s(g2,"SPAN",{});var v2=n(Ni);y(Xr.$$.fragment,v2),v2.forEach(t),g2.forEach(t),rf=d(sp),Wi=s(sp,"SPAN",{});var _2=n(Wi);sf=i(_2,"PerceiverAudioPostprocessor"),_2.forEach(t),sp.forEach(t),Oc=d(o),ro=s(o,"DIV",{class:!0});var np=n(ro);y(Or.$$.fragment,np),nf=d(np),Bi=s(np,"P",{});var y2=n(Bi);af=i(y2,"Audio postprocessing for Perceiver. Can be used to convert the decoder output to audio features."),y2.forEach(t),np.forEach(t),Hc=d(o),so=s(o,"H2",{class:!0});var ap=n(so);tt=s(ap,"A",{id:!0,class:!0,href:!0});var b2=n(tt);Ai=s(b2,"SPAN",{});var w2=n(Ai);y(Hr.$$.fragment,w2),w2.forEach(t),b2.forEach(t),lf=d(ap),Di=s(ap,"SPAN",{});var M2=n(Di);cf=i(M2,"PerceiverClassificationPostprocessor"),M2.forEach(t),ap.forEach(t),Lc=d(o),no=s(o,"DIV",{class:!0});var ip=n(no);y(Lr.$$.fragment,ip),df=d(ip),qi=s(ip,"P",{});var P2=n(qi);pf=i(P2,"Classification postprocessing for Perceiver. Can be used to convert the decoder output to classification logits."),P2.forEach(t),ip.forEach(t),Yc=d(o),ao=s(o,"H2",{class:!0});var lp=n(ao);rt=s(lp,"A",{id:!0,class:!0,href:!0});var T2=n(rt);Gi=s(T2,"SPAN",{});var k2=n(Gi);y(Yr.$$.fragment,k2),k2.forEach(t),T2.forEach(t),mf=d(lp),Vi=s(lp,"SPAN",{});var $2=n(Vi);hf=i($2,"PerceiverMultimodalPostprocessor"),$2.forEach(t),lp.forEach(t),Qc=d(o),io=s(o,"DIV",{class:!0});var cp=n(io);y(Qr.$$.fragment,cp),uf=d(cp),Ri=s(cp,"P",{});var j2=n(Ri);ff=i(j2,`Multimodal postprocessing for Perceiver. Can be used to combine modality-specific postprocessors into a single
postprocessor.`),j2.forEach(t),cp.forEach(t),Kc=d(o),lo=s(o,"H2",{class:!0});var dp=n(lo);st=s(dp,"A",{id:!0,class:!0,href:!0});var C2=n(st);Si=s(C2,"SPAN",{});var x2=n(Si);y(Kr.$$.fragment,x2),x2.forEach(t),C2.forEach(t),gf=d(dp),Xi=s(dp,"SPAN",{});var E2=n(Xi);vf=i(E2,"PerceiverModel"),E2.forEach(t),dp.forEach(t),ed=d(o),pe=s(o,"DIV",{class:!0});var Ln=n(pe);y(es.$$.fragment,Ln),_f=d(Ln),os=s(Ln,"P",{});var pp=n(os);yf=i(pp,`The Perceiver: a scalable, fully attentional architecture.
This model is a PyTorch `),ts=s(pp,"A",{href:!0,rel:!0});var I2=n(ts);bf=i(I2,"torch.nn.Module"),I2.forEach(t),wf=i(pp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pp.forEach(t),Mf=d(Ln),S=s(Ln,"DIV",{class:!0});var Ft=n(S);y(rs.$$.fragment,Ft),Pf=d(Ft),co=s(Ft,"P",{});var Yn=n(co);Tf=i(Yn,"The "),cn=s(Yn,"A",{href:!0});var F2=n(cn);kf=i(F2,"PerceiverModel"),F2.forEach(t),$f=i(Yn," forward method, overrides the "),Oi=s(Yn,"CODE",{});var J2=n(Oi);jf=i(J2,"__call__"),J2.forEach(t),Cf=i(Yn," special method."),Yn.forEach(t),xf=d(Ft),y(nt.$$.fragment,Ft),Ef=d(Ft),y(at.$$.fragment,Ft),Ft.forEach(t),Ln.forEach(t),od=d(o),po=s(o,"H2",{class:!0});var mp=n(po);it=s(mp,"A",{id:!0,class:!0,href:!0});var U2=n(it);Hi=s(U2,"SPAN",{});var z2=n(Hi);y(ss.$$.fragment,z2),z2.forEach(t),U2.forEach(t),If=d(mp),Li=s(mp,"SPAN",{});var Z2=n(Li);Ff=i(Z2,"PerceiverForMaskedLM"),Z2.forEach(t),mp.forEach(t),td=d(o),me=s(o,"DIV",{class:!0});var Qn=n(me);y(ns.$$.fragment,Qn),Jf=d(Qn),as=s(Qn,"P",{});var hp=n(as);Uf=i(hp,`Example use of Perceiver for masked language modeling.
This model is a PyTorch `),is=s(hp,"A",{href:!0,rel:!0});var N2=n(is);zf=i(N2,"torch.nn.Module"),N2.forEach(t),Zf=i(hp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hp.forEach(t),Nf=d(Qn),X=s(Qn,"DIV",{class:!0});var Jt=n(X);y(ls.$$.fragment,Jt),Wf=d(Jt),mo=s(Jt,"P",{});var Kn=n(mo);Bf=i(Kn,"The "),dn=s(Kn,"A",{href:!0});var W2=n(dn);Af=i(W2,"PerceiverForMaskedLM"),W2.forEach(t),Df=i(Kn," forward method, overrides the "),Yi=s(Kn,"CODE",{});var B2=n(Yi);qf=i(B2,"__call__"),B2.forEach(t),Gf=i(Kn," special method."),Kn.forEach(t),Vf=d(Jt),y(lt.$$.fragment,Jt),Rf=d(Jt),y(ct.$$.fragment,Jt),Jt.forEach(t),Qn.forEach(t),rd=d(o),ho=s(o,"H2",{class:!0});var up=n(ho);dt=s(up,"A",{id:!0,class:!0,href:!0});var A2=n(dt);Qi=s(A2,"SPAN",{});var D2=n(Qi);y(cs.$$.fragment,D2),D2.forEach(t),A2.forEach(t),Sf=d(up),Ki=s(up,"SPAN",{});var q2=n(Ki);Xf=i(q2,"PerceiverForSequenceClassification"),q2.forEach(t),up.forEach(t),sd=d(o),he=s(o,"DIV",{class:!0});var ea=n(he);y(ds.$$.fragment,ea),Of=d(ea),ps=s(ea,"P",{});var fp=n(ps);Hf=i(fp,`Example use of Perceiver for text classification.
This model is a PyTorch `),ms=s(fp,"A",{href:!0,rel:!0});var G2=n(ms);Lf=i(G2,"torch.nn.Module"),G2.forEach(t),Yf=i(fp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fp.forEach(t),Qf=d(ea),O=s(ea,"DIV",{class:!0});var Ut=n(O);y(hs.$$.fragment,Ut),Kf=d(Ut),uo=s(Ut,"P",{});var oa=n(uo);eg=i(oa,"The "),pn=s(oa,"A",{href:!0});var V2=n(pn);og=i(V2,"PerceiverForSequenceClassification"),V2.forEach(t),tg=i(oa," forward method, overrides the "),el=s(oa,"CODE",{});var R2=n(el);rg=i(R2,"__call__"),R2.forEach(t),sg=i(oa," special method."),oa.forEach(t),ng=d(Ut),y(pt.$$.fragment,Ut),ag=d(Ut),y(mt.$$.fragment,Ut),Ut.forEach(t),ea.forEach(t),nd=d(o),fo=s(o,"H2",{class:!0});var gp=n(fo);ht=s(gp,"A",{id:!0,class:!0,href:!0});var S2=n(ht);ol=s(S2,"SPAN",{});var X2=n(ol);y(us.$$.fragment,X2),X2.forEach(t),S2.forEach(t),ig=d(gp),tl=s(gp,"SPAN",{});var O2=n(tl);lg=i(O2,"PerceiverForImageClassificationLearned"),O2.forEach(t),gp.forEach(t),ad=d(o),J=s(o,"DIV",{class:!0});var oe=n(J);y(fs.$$.fragment,oe),cg=d(oe),rl=s(oe,"P",{});var H2=n(rl);dg=i(H2,"Example use of Perceiver for image classification, for tasks such as ImageNet."),H2.forEach(t),pg=d(oe),sl=s(oe,"P",{});var L2=n(sl);mg=i(L2,`This model uses learned position embeddings. In other words, this model is not given any privileged information about
the structure of images. As shown in the paper, this model can achieve a top-1 accuracy of 72.7 on ImageNet.`),L2.forEach(t),hg=d(oe),B=s(oe,"P",{});var ue=n(B);mn=s(ue,"A",{href:!0});var Y2=n(mn);ug=i(Y2,"PerceiverForImageClassificationLearned"),Y2.forEach(t),fg=i(ue," uses "),hn=s(ue,"A",{href:!0});var Q2=n(hn);gg=i(Q2,"PerceiverImagePreprocessor"),Q2.forEach(t),vg=i(ue,`
(with `),nl=s(ue,"CODE",{});var K2=n(nl);_g=i(K2,'prep_type="conv1x1"'),K2.forEach(t),yg=i(ue,`) to preprocess the input images, and
`),un=s(ue,"A",{href:!0});var ew=n(un);bg=i(ew,"PerceiverClassificationDecoder"),ew.forEach(t),wg=i(ue,` to decode the latent representation of
`),fn=s(ue,"A",{href:!0});var ow=n(fn);Mg=i(ow,"PerceiverModel"),ow.forEach(t),Pg=i(ue," into classification logits."),ue.forEach(t),Tg=d(oe),gs=s(oe,"P",{});var vp=n(gs);kg=i(vp,"This model is a PyTorch "),vs=s(vp,"A",{href:!0,rel:!0});var tw=n(vs);$g=i(tw,"torch.nn.Module"),tw.forEach(t),jg=i(vp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vp.forEach(t),Cg=d(oe),H=s(oe,"DIV",{class:!0});var zt=n(H);y(_s.$$.fragment,zt),xg=d(zt),go=s(zt,"P",{});var ta=n(go);Eg=i(ta,"The "),gn=s(ta,"A",{href:!0});var rw=n(gn);Ig=i(rw,"PerceiverForImageClassificationLearned"),rw.forEach(t),Fg=i(ta," forward method, overrides the "),al=s(ta,"CODE",{});var sw=n(al);Jg=i(sw,"__call__"),sw.forEach(t),Ug=i(ta," special method."),ta.forEach(t),zg=d(zt),y(ut.$$.fragment,zt),Zg=d(zt),y(ft.$$.fragment,zt),zt.forEach(t),oe.forEach(t),id=d(o),vo=s(o,"H2",{class:!0});var _p=n(vo);gt=s(_p,"A",{id:!0,class:!0,href:!0});var nw=n(gt);il=s(nw,"SPAN",{});var aw=n(il);y(ys.$$.fragment,aw),aw.forEach(t),nw.forEach(t),Ng=d(_p),ll=s(_p,"SPAN",{});var iw=n(ll);Wg=i(iw,"PerceiverForImageClassificationFourier"),iw.forEach(t),_p.forEach(t),ld=d(o),U=s(o,"DIV",{class:!0});var te=n(U);y(bs.$$.fragment,te),Bg=d(te),cl=s(te,"P",{});var lw=n(cl);Ag=i(lw,"Example use of Perceiver for image classification, for tasks such as ImageNet."),lw.forEach(t),Dg=d(te),dl=s(te,"P",{});var cw=n(dl);qg=i(cw,`This model uses fixed 2D Fourier position embeddings. As shown in the paper, this model can achieve a top-1 accuracy of
79.0 on ImageNet, and 84.5 when pre-trained on a large-scale dataset (i.e. JFT).`),cw.forEach(t),Gg=d(te),A=s(te,"P",{});var fe=n(A);vn=s(fe,"A",{href:!0});var dw=n(vn);Vg=i(dw,"PerceiverForImageClassificationLearned"),dw.forEach(t),Rg=i(fe," uses "),_n=s(fe,"A",{href:!0});var pw=n(_n);Sg=i(pw,"PerceiverImagePreprocessor"),pw.forEach(t),Xg=i(fe,`
(with `),pl=s(fe,"CODE",{});var mw=n(pl);Og=i(mw,'prep_type="pixels"'),mw.forEach(t),Hg=i(fe,`) to preprocess the input images, and
`),yn=s(fe,"A",{href:!0});var hw=n(yn);Lg=i(hw,"PerceiverClassificationDecoder"),hw.forEach(t),Yg=i(fe,` to decode the latent representation of
`),bn=s(fe,"A",{href:!0});var uw=n(bn);Qg=i(uw,"PerceiverModel"),uw.forEach(t),Kg=i(fe," into classification logits."),fe.forEach(t),ev=d(te),ws=s(te,"P",{});var yp=n(ws);ov=i(yp,"This model is a PyTorch "),Ms=s(yp,"A",{href:!0,rel:!0});var fw=n(Ms);tv=i(fw,"torch.nn.Module"),fw.forEach(t),rv=i(yp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yp.forEach(t),sv=d(te),L=s(te,"DIV",{class:!0});var Zt=n(L);y(Ps.$$.fragment,Zt),nv=d(Zt),_o=s(Zt,"P",{});var ra=n(_o);av=i(ra,"The "),wn=s(ra,"A",{href:!0});var gw=n(wn);iv=i(gw,"PerceiverForImageClassificationFourier"),gw.forEach(t),lv=i(ra," forward method, overrides the "),ml=s(ra,"CODE",{});var vw=n(ml);cv=i(vw,"__call__"),vw.forEach(t),dv=i(ra," special method."),ra.forEach(t),pv=d(Zt),y(vt.$$.fragment,Zt),mv=d(Zt),y(_t.$$.fragment,Zt),Zt.forEach(t),te.forEach(t),cd=d(o),yo=s(o,"H2",{class:!0});var bp=n(yo);yt=s(bp,"A",{id:!0,class:!0,href:!0});var _w=n(yt);hl=s(_w,"SPAN",{});var yw=n(hl);y(Ts.$$.fragment,yw),yw.forEach(t),_w.forEach(t),hv=d(bp),ul=s(bp,"SPAN",{});var bw=n(ul);uv=i(bw,"PerceiverForImageClassificationConvProcessing"),bw.forEach(t),bp.forEach(t),dd=d(o),z=s(o,"DIV",{class:!0});var re=n(z);y(ks.$$.fragment,re),fv=d(re),fl=s(re,"P",{});var ww=n(fl);gv=i(ww,"Example use of Perceiver for image classification, for tasks such as ImageNet."),ww.forEach(t),vv=d(re),gl=s(re,"P",{});var Mw=n(gl);_v=i(Mw,`This model uses a 2D conv+maxpool preprocessing network. As shown in the paper, this model can achieve a top-1 accuracy
of 82.1 on ImageNet.`),Mw.forEach(t),yv=d(re),D=s(re,"P",{});var ge=n(D);Mn=s(ge,"A",{href:!0});var Pw=n(Mn);bv=i(Pw,"PerceiverForImageClassificationLearned"),Pw.forEach(t),wv=i(ge," uses "),Pn=s(ge,"A",{href:!0});var Tw=n(Pn);Mv=i(Tw,"PerceiverImagePreprocessor"),Tw.forEach(t),Pv=i(ge,`
(with `),vl=s(ge,"CODE",{});var kw=n(vl);Tv=i(kw,'prep_type="conv"'),kw.forEach(t),kv=i(ge,`) to preprocess the input images, and
`),Tn=s(ge,"A",{href:!0});var $w=n(Tn);$v=i($w,"PerceiverClassificationDecoder"),$w.forEach(t),jv=i(ge,` to decode the latent representation of
`),kn=s(ge,"A",{href:!0});var jw=n(kn);Cv=i(jw,"PerceiverModel"),jw.forEach(t),xv=i(ge," into classification logits."),ge.forEach(t),Ev=d(re),$s=s(re,"P",{});var wp=n($s);Iv=i(wp,"This model is a PyTorch "),js=s(wp,"A",{href:!0,rel:!0});var Cw=n(js);Fv=i(Cw,"torch.nn.Module"),Cw.forEach(t),Jv=i(wp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wp.forEach(t),Uv=d(re),Y=s(re,"DIV",{class:!0});var Nt=n(Y);y(Cs.$$.fragment,Nt),zv=d(Nt),bo=s(Nt,"P",{});var sa=n(bo);Zv=i(sa,"The "),$n=s(sa,"A",{href:!0});var xw=n($n);Nv=i(xw,"PerceiverForImageClassificationConvProcessing"),xw.forEach(t),Wv=i(sa," forward method, overrides the "),_l=s(sa,"CODE",{});var Ew=n(_l);Bv=i(Ew,"__call__"),Ew.forEach(t),Av=i(sa," special method."),sa.forEach(t),Dv=d(Nt),y(bt.$$.fragment,Nt),qv=d(Nt),y(wt.$$.fragment,Nt),Nt.forEach(t),re.forEach(t),pd=d(o),wo=s(o,"H2",{class:!0});var Mp=n(wo);Mt=s(Mp,"A",{id:!0,class:!0,href:!0});var Iw=n(Mt);yl=s(Iw,"SPAN",{});var Fw=n(yl);y(xs.$$.fragment,Fw),Fw.forEach(t),Iw.forEach(t),Gv=d(Mp),bl=s(Mp,"SPAN",{});var Jw=n(bl);Vv=i(Jw,"PerceiverForOpticalFlow"),Jw.forEach(t),Mp.forEach(t),md=d(o),N=s(o,"DIV",{class:!0});var Me=n(N);y(Es.$$.fragment,Me),Rv=d(Me),W=s(Me,"P",{});var se=n(W);Sv=i(se,"Example use of Perceiver for optical flow, for tasks such as Sintel and KITTI. "),jn=s(se,"A",{href:!0});var Uw=n(jn);Xv=i(Uw,"PerceiverForOpticalFlow"),Uw.forEach(t),Ov=i(se,` uses
`),Cn=s(se,"A",{href:!0});var zw=n(Cn);Hv=i(zw,"PerceiverImagePreprocessor"),zw.forEach(t),Lv=i(se," (with "),wl=s(se,"EM",{});var Zw=n(wl);Yv=i(Zw,"prep_type=\u201Cpatches\u201D"),Zw.forEach(t),Qv=i(se,`) to preprocess the
input images, and `),xn=s(se,"A",{href:!0});var Nw=n(xn);Kv=i(Nw,"PerceiverOpticalFlowDecoder"),Nw.forEach(t),e_=i(se,` to decode the latent
representation of `),En=s(se,"A",{href:!0});var Ww=n(En);o_=i(Ww,"PerceiverModel"),Ww.forEach(t),t_=i(se,"."),se.forEach(t),r_=d(Me),Ml=s(Me,"P",{});var Bw=n(Ml);s_=i(Bw,`As input, one concatenates 2 subsequent frames along the channel dimension and extract a 3 x 3 patch around each pixel
(leading to 3 x 3 x 3 x 2 = 54 values for each pixel). Fixed Fourier position encodings are used to encode the position
of each pixel in the patch. Next, one applies the Perceiver encoder. To decode, one queries the latent representation
using the same encoding used for the input.`),Bw.forEach(t),n_=d(Me),Is=s(Me,"P",{});var Pp=n(Is);a_=i(Pp,"This model is a PyTorch "),Fs=s(Pp,"A",{href:!0,rel:!0});var Aw=n(Fs);i_=i(Aw,"torch.nn.Module"),Aw.forEach(t),l_=i(Pp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pp.forEach(t),c_=d(Me),Q=s(Me,"DIV",{class:!0});var Wt=n(Q);y(Js.$$.fragment,Wt),d_=d(Wt),Mo=s(Wt,"P",{});var na=n(Mo);p_=i(na,"The "),In=s(na,"A",{href:!0});var Dw=n(In);m_=i(Dw,"PerceiverForOpticalFlow"),Dw.forEach(t),h_=i(na," forward method, overrides the "),Pl=s(na,"CODE",{});var qw=n(Pl);u_=i(qw,"__call__"),qw.forEach(t),f_=i(na," special method."),na.forEach(t),g_=d(Wt),y(Pt.$$.fragment,Wt),v_=d(Wt),y(Tt.$$.fragment,Wt),Wt.forEach(t),Me.forEach(t),hd=d(o),Po=s(o,"H2",{class:!0});var Tp=n(Po);kt=s(Tp,"A",{id:!0,class:!0,href:!0});var Gw=n(kt);Tl=s(Gw,"SPAN",{});var Vw=n(Tl);y(Us.$$.fragment,Vw),Vw.forEach(t),Gw.forEach(t),__=d(Tp),kl=s(Tp,"SPAN",{});var Rw=n(kl);y_=i(Rw,"PerceiverForMultimodalAutoencoding"),Rw.forEach(t),Tp.forEach(t),ud=d(o),E=s(o,"DIV",{class:!0});var F=n(E);y(zs.$$.fragment,F),b_=d(F),$l=s(F,"P",{});var Sw=n($l);w_=i(Sw,"Example use of Perceiver for multimodal (video) autoencoding, for tasks such as Kinetics-700."),Sw.forEach(t),M_=d(F),$t=s(F,"P",{});var Gl=n($t);Fn=s(Gl,"A",{href:!0});var Xw=n(Fn);P_=i(Xw,"PerceiverForMultimodalAutoencoding"),Xw.forEach(t),T_=i(Gl," uses "),Jn=s(Gl,"A",{href:!0});var Ow=n(Jn);k_=i(Ow,"PerceiverMultimodalPreprocessor"),Ow.forEach(t),$_=i(Gl,` to
preprocess the 3 modalities: images, audio and class labels. This preprocessor uses modality-specific preprocessors to
preprocess every modality separately, after which they are concatenated. Trainable position embeddings are used to pad
each modality to the same number of channels to make concatenation along the time dimension possible. Next, one applies
the Perceiver encoder.`),Gl.forEach(t),j_=d(F),be=s(F,"P",{});var Rs=n(be);Un=s(Rs,"A",{href:!0});var Hw=n(Un);C_=i(Hw,"PerceiverMultimodalDecoder"),Hw.forEach(t),x_=i(Rs,` is used to decode the latent representation of
`),zn=s(Rs,"A",{href:!0});var Lw=n(zn);E_=i(Lw,"PerceiverModel"),Lw.forEach(t),I_=i(Rs,`. This decoder uses each modality-specific decoder to construct queries. The decoder queries are
created based on the inputs after preprocessing. However, autoencoding an entire video in a single forward pass is
computationally infeasible, hence one only uses parts of the decoder queries to do cross-attention with the latent
representation. This is determined by the subsampled indices for each modality, which can be provided as additional
input to the forward pass of `),Zn=s(Rs,"A",{href:!0});var Yw=n(Zn);F_=i(Yw,"PerceiverForMultimodalAutoencoding"),Yw.forEach(t),J_=i(Rs,"."),Rs.forEach(t),U_=d(F),jt=s(F,"P",{});var Vl=n(jt);Nn=s(Vl,"A",{href:!0});var Qw=n(Nn);z_=i(Qw,"PerceiverMultimodalDecoder"),Qw.forEach(t),Z_=i(Vl,` also pads the decoder queries of the different
modalities to the same number of channels, in order to concatenate them along the time dimension. Next, cross-attention
is performed with the latent representation of `),Wn=s(Vl,"A",{href:!0});var Kw=n(Wn);N_=i(Kw,"PerceiverModel"),Kw.forEach(t),W_=i(Vl,"."),Vl.forEach(t),B_=d(F),Zs=s(F,"P",{});var kp=n(Zs);A_=i(kp,"Finally, "),jl=s(kp,"CODE",{});var eM=n(jl);D_=i(eM,"~models.perceiver.modeling_perceiver.PerceiverMultiModalPostprocessor"),eM.forEach(t),q_=i(kp,` is used to turn this tensor into an
actual video. It first splits up the output into the different modalities, and then applies the respective
postprocessor for each modality.`),kp.forEach(t),G_=d(F),Cl=s(F,"P",{});var oM=n(Cl);V_=i(oM,`Note that, by masking the classification label during evaluation (i.e. simply providing a tensor of zeros for the
\u201Clabel\u201D modality), this auto-encoding model becomes a Kinetics 700 video classifier.`),oM.forEach(t),R_=d(F),Ns=s(F,"P",{});var $p=n(Ns);S_=i($p,"This model is a PyTorch "),Ws=s($p,"A",{href:!0,rel:!0});var tM=n(Ws);X_=i(tM,"torch.nn.Module"),tM.forEach(t),O_=i($p,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$p.forEach(t),H_=d(F),K=s(F,"DIV",{class:!0});var Bt=n(K);y(Bs.$$.fragment,Bt),L_=d(Bt),To=s(Bt,"P",{});var aa=n(To);Y_=i(aa,"The "),Bn=s(aa,"A",{href:!0});var rM=n(Bn);Q_=i(rM,"PerceiverForMultimodalAutoencoding"),rM.forEach(t),K_=i(aa," forward method, overrides the "),xl=s(aa,"CODE",{});var sM=n(xl);ey=i(sM,"__call__"),sM.forEach(t),oy=i(aa," special method."),aa.forEach(t),ty=d(Bt),y(Ct.$$.fragment,Bt),ry=d(Bt),y(xt.$$.fragment,Bt),Bt.forEach(t),F.forEach(t),this.h()},h(){l(u,"name","hf:doc:metadata"),l(u,"content",JSON.stringify(xM)),l(g,"id","perceiver"),l(g,"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"),l(g,"href","#perceiver"),l(v,"class","relative group"),l(Co,"id","overview"),l(Co,"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"),l(Co,"href","#overview"),l(Pe,"class","relative group"),l(qt,"href","https://arxiv.org/abs/2107.14795"),l(qt,"rel","nofollow"),l(Gt,"href","https://arxiv.org/abs/2103.03206"),l(Gt,"rel","nofollow"),l(Ls,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),cM(Io.src,ay="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/perceiver_architecture.jpg")||l(Io,"src",ay),l(Io,"alt","drawing"),l(Io,"width","600"),l(Qs,"href","https://arxiv.org/abs/2105.15203"),l(Rt,"href","https://huggingface.co/nielsr"),l(Rt,"rel","nofollow"),l(St,"href","https://github.com/deepmind/deepmind-research/tree/master/perceiver"),l(St,"rel","nofollow"),l(Ot,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Perceiver"),l(Ot,"rel","nofollow"),l(Lt,"href","https://huggingface.co/blog/perceiver"),l(Lt,"rel","nofollow"),l(Qt,"href","https://github.com/pytorch/pytorch/issues/36035"),l(Qt,"rel","nofollow"),l(Jo,"id","documentation-resources"),l(Jo,"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"),l(Jo,"href","#documentation-resources"),l(Te,"class","relative group"),l(on,"href","../tasks/sequence_classification"),l(tn,"href","../tasks/masked_language_modeling"),l(rn,"href","../tasks/image_classification"),l(Uo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput"),l(Uo,"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"),l(Uo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput"),l(ke,"class","relative group"),l($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(zo,"id","transformers.PerceiverConfig"),l(zo,"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"),l(zo,"href","#transformers.PerceiverConfig"),l(Ee,"class","relative group"),l(sn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(ir,"href","https://huggingface.co/deepmind/language-perceiver"),l(ir,"rel","nofollow"),l(nn,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(an,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(No,"id","transformers.PerceiverTokenizer"),l(No,"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"),l(No,"href","#transformers.PerceiverTokenizer"),l(Je,"class","relative group"),l(ln,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Bo,"id","transformers.PerceiverFeatureExtractor"),l(Bo,"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"),l(Bo,"href","#transformers.PerceiverFeatureExtractor"),l(Ue,"class","relative group"),l(Ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Do,"id","transformers.PerceiverImageProcessor"),l(Do,"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"),l(Do,"href","#transformers.PerceiverImageProcessor"),l(Ze,"class","relative group"),l(qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Go,"id","transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor"),l(Go,"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"),l(Go,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor"),l(Ne,"class","relative group"),l(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Vo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor"),l(Vo,"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"),l(Vo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor"),l(We,"class","relative group"),l(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ro,"id","transformers.models.perceiver.modeling_perceiver.PerceiverOneHotPreprocessor"),l(Ro,"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"),l(Ro,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverOneHotPreprocessor"),l(Be,"class","relative group"),l(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(So,"id","transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor"),l(So,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(So,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor"),l(De,"class","relative group"),l(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Xo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor"),l(Xo,"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"),l(Xo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor"),l(Ge,"class","relative group"),l(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Oo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverProjectionDecoder"),l(Oo,"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"),l(Oo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverProjectionDecoder"),l(Ve,"class","relative group"),l(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ho,"id","transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder"),l(Ho,"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"),l(Ho,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder"),l(Se,"class","relative group"),l(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Lo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder"),l(Lo,"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"),l(Lo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder"),l(Xe,"class","relative group"),l(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Yo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverOpticalFlowDecoder"),l(Yo,"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"),l(Yo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverOpticalFlowDecoder"),l(He,"class","relative group"),l(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Qo,"id","transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder"),l(Qo,"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"),l(Qo,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder"),l(Ye,"class","relative group"),l(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ko,"id","transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder"),l(Ko,"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"),l(Ko,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder"),l(Ke,"class","relative group"),l(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(et,"id","transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor"),l(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"),l(et,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor"),l(eo,"class","relative group"),l(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ot,"id","transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor"),l(ot,"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"),l(ot,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor"),l(to,"class","relative group"),l(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(tt,"id","transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor"),l(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(tt,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor"),l(so,"class","relative group"),l(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rt,"id","transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor"),l(rt,"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"),l(rt,"href","#transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor"),l(ao,"class","relative group"),l(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(st,"id","transformers.PerceiverModel"),l(st,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(st,"href","#transformers.PerceiverModel"),l(lo,"class","relative group"),l(ts,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ts,"rel","nofollow"),l(cn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(it,"id","transformers.PerceiverForMaskedLM"),l(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"),l(it,"href","#transformers.PerceiverForMaskedLM"),l(po,"class","relative group"),l(is,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(is,"rel","nofollow"),l(dn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForMaskedLM"),l(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(dt,"id","transformers.PerceiverForSequenceClassification"),l(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"),l(dt,"href","#transformers.PerceiverForSequenceClassification"),l(ho,"class","relative group"),l(ms,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ms,"rel","nofollow"),l(pn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForSequenceClassification"),l(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ht,"id","transformers.PerceiverForImageClassificationLearned"),l(ht,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ht,"href","#transformers.PerceiverForImageClassificationLearned"),l(fo,"class","relative group"),l(mn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationLearned"),l(hn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor"),l(un,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder"),l(fn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(vs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(vs,"rel","nofollow"),l(gn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationLearned"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(gt,"id","transformers.PerceiverForImageClassificationFourier"),l(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(gt,"href","#transformers.PerceiverForImageClassificationFourier"),l(vo,"class","relative group"),l(vn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationLearned"),l(_n,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor"),l(yn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder"),l(bn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(Ms,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ms,"rel","nofollow"),l(wn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationFourier"),l(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(yt,"id","transformers.PerceiverForImageClassificationConvProcessing"),l(yt,"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"),l(yt,"href","#transformers.PerceiverForImageClassificationConvProcessing"),l(yo,"class","relative group"),l(Mn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationLearned"),l(Pn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor"),l(Tn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder"),l(kn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(js,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(js,"rel","nofollow"),l($n,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForImageClassificationConvProcessing"),l(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Mt,"id","transformers.PerceiverForOpticalFlow"),l(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"),l(Mt,"href","#transformers.PerceiverForOpticalFlow"),l(wo,"class","relative group"),l(jn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForOpticalFlow"),l(Cn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor"),l(xn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverOpticalFlowDecoder"),l(En,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(Fs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Fs,"rel","nofollow"),l(In,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForOpticalFlow"),l(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(kt,"id","transformers.PerceiverForMultimodalAutoencoding"),l(kt,"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"),l(kt,"href","#transformers.PerceiverForMultimodalAutoencoding"),l(Po,"class","relative group"),l(Fn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForMultimodalAutoencoding"),l(Jn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor"),l(Un,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder"),l(zn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(Zn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForMultimodalAutoencoding"),l(Nn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder"),l(Wn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverModel"),l(Ws,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ws,"rel","nofollow"),l(Bn,"href","/docs/transformers/v4.32.0/en/model_doc/perceiver#transformers.PerceiverForMultimodalAutoencoding"),l(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,m){e(document.head,u),h(o,k,m),h(o,v,m),e(v,g),e(g,T),b(p,T,null),e(v,f),e(v,x),e(x,jp),h(o,Rl,m),h(o,Pe,m),e(Pe,Co),e(Co,ia),b(Dt,ia,null),e(Pe,Cp),e(Pe,la),e(la,xp),h(o,Sl,m),h(o,xo,m),e(xo,Ep),e(xo,qt),e(qt,Ip),e(xo,Fp),h(o,Xl,m),h(o,Eo,m),e(Eo,Jp),e(Eo,Gt),e(Gt,Up),e(Eo,zp),h(o,Ol,m),h(o,Ss,m),e(Ss,Zp),h(o,Hl,m),h(o,Xs,m),e(Xs,ca),e(ca,Np),h(o,Ll,m),h(o,Os,m),e(Os,Wp),h(o,Yl,m),h(o,Hs,m),e(Hs,Bp),h(o,Ql,m),h(o,Z,m),e(Z,Ap),e(Z,Ls),e(Ls,Dp),e(Z,qp),e(Z,da),e(da,Gp),e(Z,Vp),e(Z,pa),e(pa,Rp),e(Z,Sp),e(Z,ma),e(ma,Xp),e(Z,Op),e(Z,ha),e(ha,Hp),e(Z,Lp),h(o,Kl,m),h(o,Ys,m),e(Ys,Yp),h(o,ec,m),h(o,I,m),e(I,Qp),e(I,ua),e(ua,Kp),e(I,em),e(I,fa),e(fa,om),e(I,tm),e(I,ga),e(ga,rm),e(I,sm),e(I,va),e(va,nm),e(I,am),e(I,_a),e(_a,im),e(I,lm),e(I,ya),e(ya,cm),e(I,dm),h(o,oc,m),h(o,Io,m),h(o,tc,m),h(o,Vt,m),e(Vt,pm),e(Vt,Qs),e(Qs,mm),h(o,rc,m),h(o,ve,m),e(ve,hm),e(ve,Rt),e(Rt,um),e(ve,fm),e(ve,St),e(St,gm),e(ve,vm),h(o,sc,m),h(o,Ks,m),e(Ks,_m),h(o,nc,m),h(o,Fo,m),e(Fo,Xt),e(Xt,ym),e(Xt,Ot),e(Ot,bm),e(Xt,wm),e(Fo,Mm),e(Fo,Ht),e(Ht,Pm),e(Ht,Lt),e(Lt,Tm),e(Ht,km),h(o,ac,m),h(o,Yt,m),e(Yt,ba),e(ba,$m),e(Yt,jm),h(o,ic,m),h(o,en,m),e(en,_e),e(_e,Cm),e(_e,wa),e(wa,xm),e(_e,Em),e(_e,Ma),e(Ma,Im),e(_e,Fm),e(_e,Qt),e(Qt,Jm),h(o,lc,m),h(o,Te,m),e(Te,Jo),e(Jo,Pa),b(Kt,Pa,null),e(Te,Um),e(Te,Ta),e(Ta,zm),h(o,cc,m),h(o,ye,m),e(ye,ka),e(ka,on),e(on,Zm),e(ye,Nm),e(ye,$a),e($a,tn),e(tn,Wm),e(ye,Bm),e(ye,ja),e(ja,rn),e(rn,Am),h(o,dc,m),h(o,ke,m),e(ke,Uo),e(Uo,Ca),b(er,Ca,null),e(ke,Dm),e(ke,xa),e(xa,qm),h(o,pc,m),h(o,$e,m),b(or,$e,null),e($e,Gm),e($e,Ea),e(Ea,Vm),h(o,mc,m),h(o,je,m),b(tr,je,null),e(je,Rm),e(je,Ia),e(Ia,Sm),h(o,hc,m),h(o,Ce,m),b(rr,Ce,null),e(Ce,Xm),e(Ce,Fa),e(Fa,Om),h(o,uc,m),h(o,xe,m),b(sr,xe,null),e(xe,Hm),e(xe,Ja),e(Ja,Lm),h(o,fc,m),h(o,Ee,m),e(Ee,zo),e(zo,Ua),b(nr,Ua,null),e(Ee,Ym),e(Ee,za),e(za,Qm),h(o,gc,m),h(o,G,m),b(ar,G,null),e(G,Km),e(G,Ie),e(Ie,eh),e(Ie,sn),e(sn,oh),e(Ie,th),e(Ie,ir),e(ir,rh),e(Ie,sh),e(G,nh),e(G,Fe),e(Fe,ah),e(Fe,nn),e(nn,ih),e(Fe,lh),e(Fe,an),e(an,ch),e(Fe,dh),e(G,ph),b(Zo,G,null),h(o,vc,m),h(o,Je,m),e(Je,No),e(No,Za),b(lr,Za,null),e(Je,mh),e(Je,Na),e(Na,hh),h(o,_c,m),h(o,V,m),b(cr,V,null),e(V,uh),e(V,Wa),e(Wa,fh),e(V,gh),e(V,dr),e(dr,vh),e(dr,ln),e(ln,_h),e(dr,yh),e(V,bh),e(V,Wo),b(pr,Wo,null),e(Wo,wh),e(Wo,Ba),e(Ba,Mh),h(o,yc,m),h(o,Ue,m),e(Ue,Bo),e(Bo,Aa),b(mr,Aa,null),e(Ue,Ph),e(Ue,Da),e(Da,Th),h(o,bc,m),h(o,ze,m),b(hr,ze,null),e(ze,kh),e(ze,Ao),b(ur,Ao,null),e(Ao,$h),e(Ao,qa),e(qa,jh),h(o,wc,m),h(o,Ze,m),e(Ze,Do),e(Do,Ga),b(fr,Ga,null),e(Ze,Ch),e(Ze,Va),e(Va,xh),h(o,Mc,m),h(o,ne,m),b(gr,ne,null),e(ne,Eh),e(ne,Ra),e(Ra,Ih),e(ne,Fh),e(ne,qo),b(vr,qo,null),e(qo,Jh),e(qo,Sa),e(Sa,Uh),h(o,Pc,m),h(o,Ne,m),e(Ne,Go),e(Go,Xa),b(_r,Xa,null),e(Ne,zh),e(Ne,Oa),e(Oa,Zh),h(o,Tc,m),h(o,ae,m),b(yr,ae,null),e(ae,Nh),e(ae,br),e(br,Wh),e(br,Ha),e(Ha,Bh),e(br,Ah),e(ae,Dh),e(ae,wr),e(wr,qh),e(wr,La),e(La,Gh),e(wr,Vh),h(o,kc,m),h(o,We,m),e(We,Vo),e(Vo,Ya),b(Mr,Ya,null),e(We,Rh),e(We,Qa),e(Qa,Sh),h(o,$c,m),h(o,ie,m),b(Pr,ie,null),e(ie,Xh),e(ie,Ka),e(Ka,Oh),e(ie,Hh),e(ie,R),e(R,Lh),e(R,ei),e(ei,Yh),e(R,Qh),e(R,oi),e(oi,Kh),e(R,eu),e(R,ti),e(ti,ou),e(R,tu),e(R,ri),e(ri,ru),e(R,su),h(o,jc,m),h(o,Be,m),e(Be,Ro),e(Ro,si),b(Tr,si,null),e(Be,nu),e(Be,ni),e(ni,au),h(o,Cc,m),h(o,Ae,m),b(kr,Ae,null),e(Ae,iu),e(Ae,ai),e(ai,lu),h(o,xc,m),h(o,De,m),e(De,So),e(So,ii),b($r,ii,null),e(De,cu),e(De,li),e(li,du),h(o,Ec,m),h(o,qe,m),b(jr,qe,null),e(qe,pu),e(qe,ci),e(ci,mu),h(o,Ic,m),h(o,Ge,m),e(Ge,Xo),e(Xo,di),b(Cr,di,null),e(Ge,hu),e(Ge,pi),e(pi,uu),h(o,Fc,m),h(o,le,m),b(xr,le,null),e(le,fu),e(le,mi),e(mi,gu),e(le,vu),e(le,hi),e(hi,_u),h(o,Jc,m),h(o,Ve,m),e(Ve,Oo),e(Oo,ui),b(Er,ui,null),e(Ve,yu),e(Ve,fi),e(fi,bu),h(o,Uc,m),h(o,Re,m),b(Ir,Re,null),e(Re,wu),e(Re,gi),e(gi,Mu),h(o,zc,m),h(o,Se,m),e(Se,Ho),e(Ho,vi),b(Fr,vi,null),e(Se,Pu),e(Se,_i),e(_i,Tu),h(o,Zc,m),h(o,ce,m),b(Jr,ce,null),e(ce,ku),e(ce,yi),e(yi,$u),e(ce,ju),e(ce,bi),e(bi,Cu),h(o,Nc,m),h(o,Xe,m),e(Xe,Lo),e(Lo,wi),b(Ur,wi,null),e(Xe,xu),e(Xe,Mi),e(Mi,Eu),h(o,Wc,m),h(o,Oe,m),b(zr,Oe,null),e(Oe,Iu),e(Oe,Zr),e(Zr,Fu),e(Zr,Pi),e(Pi,Ju),e(Zr,Uu),h(o,Bc,m),h(o,He,m),e(He,Yo),e(Yo,Ti),b(Nr,Ti,null),e(He,zu),e(He,ki),e(ki,Zu),h(o,Ac,m),h(o,Le,m),b(Wr,Le,null),e(Le,Nu),e(Le,$i),e($i,Wu),h(o,Dc,m),h(o,Ye,m),e(Ye,Qo),e(Qo,ji),b(Br,ji,null),e(Ye,Bu),e(Ye,Ci),e(Ci,Au),h(o,qc,m),h(o,Qe,m),b(Ar,Qe,null),e(Qe,Du),e(Qe,Dr),e(Dr,qu),e(Dr,xi),e(xi,Gu),e(Dr,Vu),h(o,Gc,m),h(o,Ke,m),e(Ke,Ko),e(Ko,Ei),b(qr,Ei,null),e(Ke,Ru),e(Ke,Ii),e(Ii,Su),h(o,Vc,m),h(o,de,m),b(Gr,de,null),e(de,Xu),e(de,Vr),e(Vr,Ou),e(Vr,Fi),e(Fi,Hu),e(Vr,Lu),e(de,Yu),e(de,Ji),e(Ji,Qu),h(o,Rc,m),h(o,eo,m),e(eo,et),e(et,Ui),b(Rr,Ui,null),e(eo,Ku),e(eo,zi),e(zi,ef),h(o,Sc,m),h(o,oo,m),b(Sr,oo,null),e(oo,of),e(oo,Zi),e(Zi,tf),h(o,Xc,m),h(o,to,m),e(to,ot),e(ot,Ni),b(Xr,Ni,null),e(to,rf),e(to,Wi),e(Wi,sf),h(o,Oc,m),h(o,ro,m),b(Or,ro,null),e(ro,nf),e(ro,Bi),e(Bi,af),h(o,Hc,m),h(o,so,m),e(so,tt),e(tt,Ai),b(Hr,Ai,null),e(so,lf),e(so,Di),e(Di,cf),h(o,Lc,m),h(o,no,m),b(Lr,no,null),e(no,df),e(no,qi),e(qi,pf),h(o,Yc,m),h(o,ao,m),e(ao,rt),e(rt,Gi),b(Yr,Gi,null),e(ao,mf),e(ao,Vi),e(Vi,hf),h(o,Qc,m),h(o,io,m),b(Qr,io,null),e(io,uf),e(io,Ri),e(Ri,ff),h(o,Kc,m),h(o,lo,m),e(lo,st),e(st,Si),b(Kr,Si,null),e(lo,gf),e(lo,Xi),e(Xi,vf),h(o,ed,m),h(o,pe,m),b(es,pe,null),e(pe,_f),e(pe,os),e(os,yf),e(os,ts),e(ts,bf),e(os,wf),e(pe,Mf),e(pe,S),b(rs,S,null),e(S,Pf),e(S,co),e(co,Tf),e(co,cn),e(cn,kf),e(co,$f),e(co,Oi),e(Oi,jf),e(co,Cf),e(S,xf),b(nt,S,null),e(S,Ef),b(at,S,null),h(o,od,m),h(o,po,m),e(po,it),e(it,Hi),b(ss,Hi,null),e(po,If),e(po,Li),e(Li,Ff),h(o,td,m),h(o,me,m),b(ns,me,null),e(me,Jf),e(me,as),e(as,Uf),e(as,is),e(is,zf),e(as,Zf),e(me,Nf),e(me,X),b(ls,X,null),e(X,Wf),e(X,mo),e(mo,Bf),e(mo,dn),e(dn,Af),e(mo,Df),e(mo,Yi),e(Yi,qf),e(mo,Gf),e(X,Vf),b(lt,X,null),e(X,Rf),b(ct,X,null),h(o,rd,m),h(o,ho,m),e(ho,dt),e(dt,Qi),b(cs,Qi,null),e(ho,Sf),e(ho,Ki),e(Ki,Xf),h(o,sd,m),h(o,he,m),b(ds,he,null),e(he,Of),e(he,ps),e(ps,Hf),e(ps,ms),e(ms,Lf),e(ps,Yf),e(he,Qf),e(he,O),b(hs,O,null),e(O,Kf),e(O,uo),e(uo,eg),e(uo,pn),e(pn,og),e(uo,tg),e(uo,el),e(el,rg),e(uo,sg),e(O,ng),b(pt,O,null),e(O,ag),b(mt,O,null),h(o,nd,m),h(o,fo,m),e(fo,ht),e(ht,ol),b(us,ol,null),e(fo,ig),e(fo,tl),e(tl,lg),h(o,ad,m),h(o,J,m),b(fs,J,null),e(J,cg),e(J,rl),e(rl,dg),e(J,pg),e(J,sl),e(sl,mg),e(J,hg),e(J,B),e(B,mn),e(mn,ug),e(B,fg),e(B,hn),e(hn,gg),e(B,vg),e(B,nl),e(nl,_g),e(B,yg),e(B,un),e(un,bg),e(B,wg),e(B,fn),e(fn,Mg),e(B,Pg),e(J,Tg),e(J,gs),e(gs,kg),e(gs,vs),e(vs,$g),e(gs,jg),e(J,Cg),e(J,H),b(_s,H,null),e(H,xg),e(H,go),e(go,Eg),e(go,gn),e(gn,Ig),e(go,Fg),e(go,al),e(al,Jg),e(go,Ug),e(H,zg),b(ut,H,null),e(H,Zg),b(ft,H,null),h(o,id,m),h(o,vo,m),e(vo,gt),e(gt,il),b(ys,il,null),e(vo,Ng),e(vo,ll),e(ll,Wg),h(o,ld,m),h(o,U,m),b(bs,U,null),e(U,Bg),e(U,cl),e(cl,Ag),e(U,Dg),e(U,dl),e(dl,qg),e(U,Gg),e(U,A),e(A,vn),e(vn,Vg),e(A,Rg),e(A,_n),e(_n,Sg),e(A,Xg),e(A,pl),e(pl,Og),e(A,Hg),e(A,yn),e(yn,Lg),e(A,Yg),e(A,bn),e(bn,Qg),e(A,Kg),e(U,ev),e(U,ws),e(ws,ov),e(ws,Ms),e(Ms,tv),e(ws,rv),e(U,sv),e(U,L),b(Ps,L,null),e(L,nv),e(L,_o),e(_o,av),e(_o,wn),e(wn,iv),e(_o,lv),e(_o,ml),e(ml,cv),e(_o,dv),e(L,pv),b(vt,L,null),e(L,mv),b(_t,L,null),h(o,cd,m),h(o,yo,m),e(yo,yt),e(yt,hl),b(Ts,hl,null),e(yo,hv),e(yo,ul),e(ul,uv),h(o,dd,m),h(o,z,m),b(ks,z,null),e(z,fv),e(z,fl),e(fl,gv),e(z,vv),e(z,gl),e(gl,_v),e(z,yv),e(z,D),e(D,Mn),e(Mn,bv),e(D,wv),e(D,Pn),e(Pn,Mv),e(D,Pv),e(D,vl),e(vl,Tv),e(D,kv),e(D,Tn),e(Tn,$v),e(D,jv),e(D,kn),e(kn,Cv),e(D,xv),e(z,Ev),e(z,$s),e($s,Iv),e($s,js),e(js,Fv),e($s,Jv),e(z,Uv),e(z,Y),b(Cs,Y,null),e(Y,zv),e(Y,bo),e(bo,Zv),e(bo,$n),e($n,Nv),e(bo,Wv),e(bo,_l),e(_l,Bv),e(bo,Av),e(Y,Dv),b(bt,Y,null),e(Y,qv),b(wt,Y,null),h(o,pd,m),h(o,wo,m),e(wo,Mt),e(Mt,yl),b(xs,yl,null),e(wo,Gv),e(wo,bl),e(bl,Vv),h(o,md,m),h(o,N,m),b(Es,N,null),e(N,Rv),e(N,W),e(W,Sv),e(W,jn),e(jn,Xv),e(W,Ov),e(W,Cn),e(Cn,Hv),e(W,Lv),e(W,wl),e(wl,Yv),e(W,Qv),e(W,xn),e(xn,Kv),e(W,e_),e(W,En),e(En,o_),e(W,t_),e(N,r_),e(N,Ml),e(Ml,s_),e(N,n_),e(N,Is),e(Is,a_),e(Is,Fs),e(Fs,i_),e(Is,l_),e(N,c_),e(N,Q),b(Js,Q,null),e(Q,d_),e(Q,Mo),e(Mo,p_),e(Mo,In),e(In,m_),e(Mo,h_),e(Mo,Pl),e(Pl,u_),e(Mo,f_),e(Q,g_),b(Pt,Q,null),e(Q,v_),b(Tt,Q,null),h(o,hd,m),h(o,Po,m),e(Po,kt),e(kt,Tl),b(Us,Tl,null),e(Po,__),e(Po,kl),e(kl,y_),h(o,ud,m),h(o,E,m),b(zs,E,null),e(E,b_),e(E,$l),e($l,w_),e(E,M_),e(E,$t),e($t,Fn),e(Fn,P_),e($t,T_),e($t,Jn),e(Jn,k_),e($t,$_),e(E,j_),e(E,be),e(be,Un),e(Un,C_),e(be,x_),e(be,zn),e(zn,E_),e(be,I_),e(be,Zn),e(Zn,F_),e(be,J_),e(E,U_),e(E,jt),e(jt,Nn),e(Nn,z_),e(jt,Z_),e(jt,Wn),e(Wn,N_),e(jt,W_),e(E,B_),e(E,Zs),e(Zs,A_),e(Zs,jl),e(jl,D_),e(Zs,q_),e(E,G_),e(E,Cl),e(Cl,V_),e(E,R_),e(E,Ns),e(Ns,S_),e(Ns,Ws),e(Ws,X_),e(Ns,O_),e(E,H_),e(E,K),b(Bs,K,null),e(K,L_),e(K,To),e(To,Y_),e(To,Bn),e(Bn,Q_),e(To,K_),e(To,xl),e(xl,ey),e(To,oy),e(K,ty),b(Ct,K,null),e(K,ry),b(xt,K,null),fd=!0},p(o,[m]){const As={};m&2&&(As.$$scope={dirty:m,ctx:o}),Zo.$set(As);const El={};m&2&&(El.$$scope={dirty:m,ctx:o}),nt.$set(El);const Il={};m&2&&(Il.$$scope={dirty:m,ctx:o}),at.$set(Il);const Fl={};m&2&&(Fl.$$scope={dirty:m,ctx:o}),lt.$set(Fl);const Ds={};m&2&&(Ds.$$scope={dirty:m,ctx:o}),ct.$set(Ds);const Jl={};m&2&&(Jl.$$scope={dirty:m,ctx:o}),pt.$set(Jl);const Ul={};m&2&&(Ul.$$scope={dirty:m,ctx:o}),mt.$set(Ul);const zl={};m&2&&(zl.$$scope={dirty:m,ctx:o}),ut.$set(zl);const qs={};m&2&&(qs.$$scope={dirty:m,ctx:o}),ft.$set(qs);const Zl={};m&2&&(Zl.$$scope={dirty:m,ctx:o}),vt.$set(Zl);const Gs={};m&2&&(Gs.$$scope={dirty:m,ctx:o}),_t.$set(Gs);const Nl={};m&2&&(Nl.$$scope={dirty:m,ctx:o}),bt.$set(Nl);const Wl={};m&2&&(Wl.$$scope={dirty:m,ctx:o}),wt.$set(Wl);const Bl={};m&2&&(Bl.$$scope={dirty:m,ctx:o}),Pt.$set(Bl);const Al={};m&2&&(Al.$$scope={dirty:m,ctx:o}),Tt.$set(Al);const Dl={};m&2&&(Dl.$$scope={dirty:m,ctx:o}),Ct.$set(Dl);const ql={};m&2&&(ql.$$scope={dirty:m,ctx:o}),xt.$set(ql)},i(o){fd||(w(p.$$.fragment,o),w(Dt.$$.fragment,o),w(Kt.$$.fragment,o),w(er.$$.fragment,o),w(or.$$.fragment,o),w(tr.$$.fragment,o),w(rr.$$.fragment,o),w(sr.$$.fragment,o),w(nr.$$.fragment,o),w(ar.$$.fragment,o),w(Zo.$$.fragment,o),w(lr.$$.fragment,o),w(cr.$$.fragment,o),w(pr.$$.fragment,o),w(mr.$$.fragment,o),w(hr.$$.fragment,o),w(ur.$$.fragment,o),w(fr.$$.fragment,o),w(gr.$$.fragment,o),w(vr.$$.fragment,o),w(_r.$$.fragment,o),w(yr.$$.fragment,o),w(Mr.$$.fragment,o),w(Pr.$$.fragment,o),w(Tr.$$.fragment,o),w(kr.$$.fragment,o),w($r.$$.fragment,o),w(jr.$$.fragment,o),w(Cr.$$.fragment,o),w(xr.$$.fragment,o),w(Er.$$.fragment,o),w(Ir.$$.fragment,o),w(Fr.$$.fragment,o),w(Jr.$$.fragment,o),w(Ur.$$.fragment,o),w(zr.$$.fragment,o),w(Nr.$$.fragment,o),w(Wr.$$.fragment,o),w(Br.$$.fragment,o),w(Ar.$$.fragment,o),w(qr.$$.fragment,o),w(Gr.$$.fragment,o),w(Rr.$$.fragment,o),w(Sr.$$.fragment,o),w(Xr.$$.fragment,o),w(Or.$$.fragment,o),w(Hr.$$.fragment,o),w(Lr.$$.fragment,o),w(Yr.$$.fragment,o),w(Qr.$$.fragment,o),w(Kr.$$.fragment,o),w(es.$$.fragment,o),w(rs.$$.fragment,o),w(nt.$$.fragment,o),w(at.$$.fragment,o),w(ss.$$.fragment,o),w(ns.$$.fragment,o),w(ls.$$.fragment,o),w(lt.$$.fragment,o),w(ct.$$.fragment,o),w(cs.$$.fragment,o),w(ds.$$.fragment,o),w(hs.$$.fragment,o),w(pt.$$.fragment,o),w(mt.$$.fragment,o),w(us.$$.fragment,o),w(fs.$$.fragment,o),w(_s.$$.fragment,o),w(ut.$$.fragment,o),w(ft.$$.fragment,o),w(ys.$$.fragment,o),w(bs.$$.fragment,o),w(Ps.$$.fragment,o),w(vt.$$.fragment,o),w(_t.$$.fragment,o),w(Ts.$$.fragment,o),w(ks.$$.fragment,o),w(Cs.$$.fragment,o),w(bt.$$.fragment,o),w(wt.$$.fragment,o),w(xs.$$.fragment,o),w(Es.$$.fragment,o),w(Js.$$.fragment,o),w(Pt.$$.fragment,o),w(Tt.$$.fragment,o),w(Us.$$.fragment,o),w(zs.$$.fragment,o),w(Bs.$$.fragment,o),w(Ct.$$.fragment,o),w(xt.$$.fragment,o),fd=!0)},o(o){M(p.$$.fragment,o),M(Dt.$$.fragment,o),M(Kt.$$.fragment,o),M(er.$$.fragment,o),M(or.$$.fragment,o),M(tr.$$.fragment,o),M(rr.$$.fragment,o),M(sr.$$.fragment,o),M(nr.$$.fragment,o),M(ar.$$.fragment,o),M(Zo.$$.fragment,o),M(lr.$$.fragment,o),M(cr.$$.fragment,o),M(pr.$$.fragment,o),M(mr.$$.fragment,o),M(hr.$$.fragment,o),M(ur.$$.fragment,o),M(fr.$$.fragment,o),M(gr.$$.fragment,o),M(vr.$$.fragment,o),M(_r.$$.fragment,o),M(yr.$$.fragment,o),M(Mr.$$.fragment,o),M(Pr.$$.fragment,o),M(Tr.$$.fragment,o),M(kr.$$.fragment,o),M($r.$$.fragment,o),M(jr.$$.fragment,o),M(Cr.$$.fragment,o),M(xr.$$.fragment,o),M(Er.$$.fragment,o),M(Ir.$$.fragment,o),M(Fr.$$.fragment,o),M(Jr.$$.fragment,o),M(Ur.$$.fragment,o),M(zr.$$.fragment,o),M(Nr.$$.fragment,o),M(Wr.$$.fragment,o),M(Br.$$.fragment,o),M(Ar.$$.fragment,o),M(qr.$$.fragment,o),M(Gr.$$.fragment,o),M(Rr.$$.fragment,o),M(Sr.$$.fragment,o),M(Xr.$$.fragment,o),M(Or.$$.fragment,o),M(Hr.$$.fragment,o),M(Lr.$$.fragment,o),M(Yr.$$.fragment,o),M(Qr.$$.fragment,o),M(Kr.$$.fragment,o),M(es.$$.fragment,o),M(rs.$$.fragment,o),M(nt.$$.fragment,o),M(at.$$.fragment,o),M(ss.$$.fragment,o),M(ns.$$.fragment,o),M(ls.$$.fragment,o),M(lt.$$.fragment,o),M(ct.$$.fragment,o),M(cs.$$.fragment,o),M(ds.$$.fragment,o),M(hs.$$.fragment,o),M(pt.$$.fragment,o),M(mt.$$.fragment,o),M(us.$$.fragment,o),M(fs.$$.fragment,o),M(_s.$$.fragment,o),M(ut.$$.fragment,o),M(ft.$$.fragment,o),M(ys.$$.fragment,o),M(bs.$$.fragment,o),M(Ps.$$.fragment,o),M(vt.$$.fragment,o),M(_t.$$.fragment,o),M(Ts.$$.fragment,o),M(ks.$$.fragment,o),M(Cs.$$.fragment,o),M(bt.$$.fragment,o),M(wt.$$.fragment,o),M(xs.$$.fragment,o),M(Es.$$.fragment,o),M(Js.$$.fragment,o),M(Pt.$$.fragment,o),M(Tt.$$.fragment,o),M(Us.$$.fragment,o),M(zs.$$.fragment,o),M(Bs.$$.fragment,o),M(Ct.$$.fragment,o),M(xt.$$.fragment,o),fd=!1},d(o){t(u),o&&t(k),o&&t(v),P(p),o&&t(Rl),o&&t(Pe),P(Dt),o&&t(Sl),o&&t(xo),o&&t(Xl),o&&t(Eo),o&&t(Ol),o&&t(Ss),o&&t(Hl),o&&t(Xs),o&&t(Ll),o&&t(Os),o&&t(Yl),o&&t(Hs),o&&t(Ql),o&&t(Z),o&&t(Kl),o&&t(Ys),o&&t(ec),o&&t(I),o&&t(oc),o&&t(Io),o&&t(tc),o&&t(Vt),o&&t(rc),o&&t(ve),o&&t(sc),o&&t(Ks),o&&t(nc),o&&t(Fo),o&&t(ac),o&&t(Yt),o&&t(ic),o&&t(en),o&&t(lc),o&&t(Te),P(Kt),o&&t(cc),o&&t(ye),o&&t(dc),o&&t(ke),P(er),o&&t(pc),o&&t($e),P(or),o&&t(mc),o&&t(je),P(tr),o&&t(hc),o&&t(Ce),P(rr),o&&t(uc),o&&t(xe),P(sr),o&&t(fc),o&&t(Ee),P(nr),o&&t(gc),o&&t(G),P(ar),P(Zo),o&&t(vc),o&&t(Je),P(lr),o&&t(_c),o&&t(V),P(cr),P(pr),o&&t(yc),o&&t(Ue),P(mr),o&&t(bc),o&&t(ze),P(hr),P(ur),o&&t(wc),o&&t(Ze),P(fr),o&&t(Mc),o&&t(ne),P(gr),P(vr),o&&t(Pc),o&&t(Ne),P(_r),o&&t(Tc),o&&t(ae),P(yr),o&&t(kc),o&&t(We),P(Mr),o&&t($c),o&&t(ie),P(Pr),o&&t(jc),o&&t(Be),P(Tr),o&&t(Cc),o&&t(Ae),P(kr),o&&t(xc),o&&t(De),P($r),o&&t(Ec),o&&t(qe),P(jr),o&&t(Ic),o&&t(Ge),P(Cr),o&&t(Fc),o&&t(le),P(xr),o&&t(Jc),o&&t(Ve),P(Er),o&&t(Uc),o&&t(Re),P(Ir),o&&t(zc),o&&t(Se),P(Fr),o&&t(Zc),o&&t(ce),P(Jr),o&&t(Nc),o&&t(Xe),P(Ur),o&&t(Wc),o&&t(Oe),P(zr),o&&t(Bc),o&&t(He),P(Nr),o&&t(Ac),o&&t(Le),P(Wr),o&&t(Dc),o&&t(Ye),P(Br),o&&t(qc),o&&t(Qe),P(Ar),o&&t(Gc),o&&t(Ke),P(qr),o&&t(Vc),o&&t(de),P(Gr),o&&t(Rc),o&&t(eo),P(Rr),o&&t(Sc),o&&t(oo),P(Sr),o&&t(Xc),o&&t(to),P(Xr),o&&t(Oc),o&&t(ro),P(Or),o&&t(Hc),o&&t(so),P(Hr),o&&t(Lc),o&&t(no),P(Lr),o&&t(Yc),o&&t(ao),P(Yr),o&&t(Qc),o&&t(io),P(Qr),o&&t(Kc),o&&t(lo),P(Kr),o&&t(ed),o&&t(pe),P(es),P(rs),P(nt),P(at),o&&t(od),o&&t(po),P(ss),o&&t(td),o&&t(me),P(ns),P(ls),P(lt),P(ct),o&&t(rd),o&&t(ho),P(cs),o&&t(sd),o&&t(he),P(ds),P(hs),P(pt),P(mt),o&&t(nd),o&&t(fo),P(us),o&&t(ad),o&&t(J),P(fs),P(_s),P(ut),P(ft),o&&t(id),o&&t(vo),P(ys),o&&t(ld),o&&t(U),P(bs),P(Ps),P(vt),P(_t),o&&t(cd),o&&t(yo),P(Ts),o&&t(dd),o&&t(z),P(ks),P(Cs),P(bt),P(wt),o&&t(pd),o&&t(wo),P(xs),o&&t(md),o&&t(N),P(Es),P(Js),P(Pt),P(Tt),o&&t(hd),o&&t(Po),P(Us),o&&t(ud),o&&t(E),P(zs),P(Bs),P(Ct),P(xt)}}}const xM={local:"perceiver",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverModelOutput",title:"Perceiver specific outputs"},{local:"transformers.PerceiverConfig",title:"PerceiverConfig"},{local:"transformers.PerceiverTokenizer",title:"PerceiverTokenizer"},{local:"transformers.PerceiverFeatureExtractor",title:"PerceiverFeatureExtractor"},{local:"transformers.PerceiverImageProcessor",title:"PerceiverImageProcessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverTextPreprocessor",title:"PerceiverTextPreprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverImagePreprocessor",title:"PerceiverImagePreprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverOneHotPreprocessor",title:"PerceiverOneHotPreprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPreprocessor",title:"PerceiverAudioPreprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPreprocessor",title:"PerceiverMultimodalPreprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionDecoder",title:"PerceiverProjectionDecoder"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicDecoder",title:"PerceiverBasicDecoder"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationDecoder",title:"PerceiverClassificationDecoder"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverOpticalFlowDecoder",title:"PerceiverOpticalFlowDecoder"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverBasicVideoAutoencodingDecoder",title:"PerceiverBasicVideoAutoencodingDecoder"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalDecoder",title:"PerceiverMultimodalDecoder"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverProjectionPostprocessor",title:"PerceiverProjectionPostprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverAudioPostprocessor",title:"PerceiverAudioPostprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverClassificationPostprocessor",title:"PerceiverClassificationPostprocessor"},{local:"transformers.models.perceiver.modeling_perceiver.PerceiverMultimodalPostprocessor",title:"PerceiverMultimodalPostprocessor"},{local:"transformers.PerceiverModel",title:"PerceiverModel"},{local:"transformers.PerceiverForMaskedLM",title:"PerceiverForMaskedLM"},{local:"transformers.PerceiverForSequenceClassification",title:"PerceiverForSequenceClassification"},{local:"transformers.PerceiverForImageClassificationLearned",title:"PerceiverForImageClassificationLearned"},{local:"transformers.PerceiverForImageClassificationFourier",title:"PerceiverForImageClassificationFourier"},{local:"transformers.PerceiverForImageClassificationConvProcessing",title:"PerceiverForImageClassificationConvProcessing"},{local:"transformers.PerceiverForOpticalFlow",title:"PerceiverForOpticalFlow"},{local:"transformers.PerceiverForMultimodalAutoencoding",title:"PerceiverForMultimodalAutoencoding"}],title:"Perceiver"};function EM(j){return dM(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class NM extends nM{constructor(u){super();aM(this,u,EM,CM,iM,{})}}export{NM as default,xM as metadata};
