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 __init__(self, kernel_size, stride):
      super().__init__()
      # asymmetrical padding, shorther on the ts start side
      if kernel_size % 2 == 0:
          self.padding_size_left = kernel_size // 2 - 1
          self.padding_size_right = kernel_size // 2
      else:
          self.padding_size_left = (kernel_size - 1) // 2
          self.padding_size_right = (kernel_size - 1) // 2
      self.avg = nn.AvgPool1d(
          kernel_size=kernel_size, stride=stride, padding=0
      )
  
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 1 to create a new _MovingAvg object from inherited base classes: nn with example: obj = _MovingAvg(kernel_size, stride)