class_docstr: 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: from typing import Tuple
  import torch
  from torch import nn
  from gluonts.core.component import validated
  from gluonts.model import Input, InputSpec
  from gluonts.torch.distributions import StudentTOutput
  from gluonts.torch.scaler import StdScaler, MeanScaler, NOPScaler
  from gluonts.torch.model.simple_feedforward import make_linear_layer
  from gluonts.torch.util import weighted_average
label_desc: Use image node_id 2 for calling the MovingAvg obj's underlying member method code with example usage: obj.forward(x) and returns: x