class_docstr: Moving average block to highlight the trend of time series
class_docstr_tok: ["Moving","average","block","to","highlight","the","trend","of","time","series"]
code: def forward(self, x):
      # padding on the both ends of time series
      front = x[:, 0:1, :].repeat(1, (self.kernel_size - 1) // 2, 1)
      end = x[:, -1:, :].repeat(1, (self.kernel_size - 1) // 2, 1)
      x = torch.cat([front, x, end], dim=1)
      x = self.avg(x.permute(0, 2, 1))
      x = x.permute(0, 2, 1)
      return x
  
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the moving_avg obj's underlying member method code with example usage: obj.forward(x) and returns: x