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 with the extremities values
      front = x[:, 0:1, :].repeat(1, self.padding_size_left, 1)
      end = x[:, -1:, :].repeat(1, self.padding_size_right, 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 Optional, Tuple
  import torch
  import torch.nn
  from darts.logging import raise_if
  from darts.models.forecasting.pl_forecasting_module import PLMixedCovariatesModule, io_processor
  from darts.models.forecasting.torch_forecasting_model import MixedCovariatesTorchModel
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