docstr: x: (b, t, d)
docstr_tok: ["x",":","(","b",",","t",",","d",")"]
code: def forward(self, x):
      """x: (b, t, d)"""
  
      if self.output_attention:
          return self.dft_forward(x)
  
      b, t, d = x.shape
      x_freq = fft.rfft(x, dim=1)
  
      if t % 2 == 0:
          x_freq = x_freq[:, self.low_freq : -1]
          f = fft.rfftfreq(t)[self.low_freq : -1]
      else:
          x_freq = x_freq[:, self.low_freq :]
          f = fft.rfftfreq(t)[self.low_freq :]
  
      x_freq, index_tuple = self.topk_freq(x_freq)
      f = repeat(f, "f -> b f d", b=x_freq.size(0), d=x_freq.size(2))
      f = rearrange(f[index_tuple], "b f d -> b f () d").to(
          x_freq.device
      )
  
      return self.extrapolate(x_freq, f, t), None
  
imports: import numpy
  import math
  from math import sqrt
  import os
  from scipy.fftpack import next_fast_len
  from merlion.models.utils.nn_modules.blocks import ExponentialSmoothing, conv1d_fft
label_desc: Use image node_id 2 for calling the FourierLayer obj's underlying member method code with example usage: obj.forward(x) and returns: self,  None, self