docstr: Parameters
  ----------
  data
      tensor of shape (N, T, C) if ``time_first == True`` or (N, C, T)
      if ``time_first == False`` containing the data to be scaled
  
  observed_indicator
      observed_indicator: binary tensor with the same shape as
      ``data``, that has 1 in correspondence of observed data points,
      and 0 in correspondence of missing data points.
  
  Returns
  -------
  Tensor
      Tensor containing the "scaled" data, shape: (N, T, C) or (N, C, T).
  Tensor
      Tensor containing the scale, of shape (N, C) if ``keepdim == False``,
      and shape (N, 1, C) or (N, C, 1) if ``keepdim == True``.
docstr_tok: ["Parameters","--","--","--","--","--","data","tensor","of","shape","(","N",",","T",",","C",")","if","``","time_first","==","True","``","or","(","N",",","C",",","T",")","if","``","time_first","==","False","``","containing","the","data","to","be","scaled","observed_indicator","observed_indicator",":","binary","tensor","with","the","same","shape","as","``","data","``",",","that","has","1","in","correspondence","of","observed","data","points",",","and","0","in","correspondence","of","missing","data","points",".","Returns","--","--","--","-","Tensor","Tensor","containing","the","``","scaled","''","data",",","shape",":","(","N",",","T",",","C",")","or","(","N",",","C",",","T",")",".","Tensor","Tensor","containing","the","scale",",","of","shape","(","N",",","C",")","if","``","keepdim","==","False","``",",","and","shape","(","N",",","1",",","C",")","or","(","N",",","C",",","1",")","if","``","keepdim","==","True","``","."]
code: def forward(
      self, data: torch.Tensor, observed_indicator: torch.Tensor
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      Parameters
      ----------
      data
          tensor of shape (N, T, C) if ``time_first == True`` or (N, C, T)
          if ``time_first == False`` containing the data to be scaled
  
      observed_indicator
          observed_indicator: binary tensor with the same shape as
          ``data``, that has 1 in correspondence of observed data points,
          and 0 in correspondence of missing data points.
  
      Returns
      -------
      Tensor
          Tensor containing the "scaled" data, shape: (N, T, C) or (N, C, T).
      Tensor
          Tensor containing the scale, of shape (N, C) if ``keepdim == False``,
          and shape (N, 1, C) or (N, C, 1) if ``keepdim == True``.
      """
  
      scale = self.compute_scale(data, observed_indicator)
  
      if self.time_first:
          dim = 1
      else:
          dim = 2
      if self.keepdim:
          scale = scale.unsqueeze(dim=dim)
          return data / scale, scale
      else:
          return data / scale.unsqueeze(dim=dim), scale
  
file_path: gluonts/src/gluonts/nursery/robust-mts-attack/pts/modules/scaler.py
imports: from abc import ABC, abstractmethod
  from typing import Tuple
  import torch
  import torch.nn
  from gluonts.core.component import validated
label_desc: Use image node_id 3 for calling the Scaler obj's underlying member method code with example usage: obj.forward(data, observed_indicator) and returns: unknown,  scale, unknown,  scale