code: def forward(
      self,
      net: Tensor,
      *,
      mask: Optional[Tensor] = None,
      out_queries: Optional[Tensor] = None,
  ) -> Tensor:
      b = net.shape[0]
      in_latent = torch.repeat_interleave(
          self.in_latent[None, ...], b, dim=0
      )
      for cross_attn, cross_ff, self_attn_blocks in self.layers:
          in_latent = cross_attn(in_latent, net, mask=mask) + in_latent
          in_latent = cross_ff(in_latent) + in_latent
          for self_attn, self_ff in self_attn_blocks:
              in_latent = self_attn(in_latent) + in_latent
              in_latent = self_ff(in_latent) + in_latent
      if self.out_latent is not None:
          out_queries = torch.repeat_interleave(
              self.out_latent[None, ...], b, dim=0
          )
      if out_queries is None:
          return in_latent
      return self.decoder_cross_attn(out_queries, in_latent)
  
file_path: carefree-learn/cflearn/modules/blocks/implementations/perceiver.py
imports: import torch
  import torch.nn
  from torch import Tensor
  from typing import Optional
  from torch.nn import Module
  from ..common import reuse_fn
  from ..high_level import PreNorm
  from ..attentions import Attention
  from ..mixed_stacks import FeedForward
label_desc: Use image node_id 2 for calling the PerceiverIO obj's underlying member method code with example usage: obj.forward(net) and returns: self, in_latent