code: def forward(self, src, mask, pos_embed):
      # flatten NxCxHxW to HWxNxC
      bs, c, h, w = src.shape
      src = src.flatten(2).permute(2, 0, 1)
      pos_embed = pos_embed.flatten(2).permute(2, 0, 1)
      if mask is not None:
          mask = mask.flatten(1)
  
      memory = self.encoder(
          src, src_key_padding_mask=mask, pos=pos_embed
      )
      return memory.permute(1, 2, 0).view(bs, c, h, w)
  
file_path: mmdetection/projects/XDecoder/xdecoder/pixel_decoder.py
imports: from typing import Callable, Optional, Union
  from torch import nn
  from torch.nn import functional
  from mmdet.registry import MODELS
  from .transformer_blocks import Conv2d, PositionEmbeddingSine, TransformerEncoder, TransformerEncoderLayer, get_norm
label_desc: Use image node_id 3 for calling the TransformerEncoderOnly obj's underlying member method code with example usage: obj.forward(src, mask, pos_embed) and returns: memory