code: def forward(self, x1, x2):
      assert len(x1.shape) == len(x2.shape)
      if len(x1.shape) == 4 and len(x2.shape) == 4:
          fft1 = rfft(
              x1.permute(0, 2, 3, 1).matmul(self.sketch1), signal_ndim=1
          )
          fft2 = rfft(
              x2.permute(0, 2, 3, 1).matmul(self.sketch2), signal_ndim=1
          )
      else:
          fft1 = rfft(x1.matmul(self.sketch1), signal_ndim=1)
          fft2 = rfft(x2.matmul(self.sketch2), signal_ndim=1)
      fft_product = torch.stack(
          [
              fft1[..., 0] * fft2[..., 0] - fft1[..., 1] * fft2[..., 1],
              fft1[..., 0] * fft2[..., 1] + fft1[..., 1] * fft2[..., 0],
          ],
          dim=-1,
      )
      cbp = (
          irfft(
              fft_product, signal_ndim=1, dim=-1, s=(self.output_dim,)
          )
          * self.output_dim
      )
      if len(x1.shape) == 4 and len(x2.shape) == 4:
          cbp = (
              cbp.sum(dim=[1, 2])
              if self.sum_pool
              else cbp.permute(0, 3, 1, 2)
          )
      return cbp
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.utils.general import get_chunks, get_sizes_list, irfft, rfft
  from mmf.utils.logger import log_class_usage
label_desc: Use image node_id 3 for calling the CompactBilinearPooling obj's underlying member method code with example usage: obj.forward(x1, x2) and returns: cbp