class_docstr: Computes a std scaling  value along dimension ``dim``, and scales the data accordingly.
  
  Parameters
  ----------
  dim
      dimension along which to compute the scale
  keepdim
      controls whether to retain dimension ``dim`` (of length 1) in the
      scale tensor, or suppress it.
  minimum_scale
      default scale that is used for elements that are constantly zero
      along dimension ``dim``.
class_docstr_tok: ["Computes","a","std","scaling","value","along","dimension","``","dim","``",",","and","scales","the","data","accordingly",".","Parameters","--","--","--","--","--","dim","dimension","along","which","to","compute","the","scale","keepdim","controls","whether","to","retain","dimension","``","dim","``","(","of","length","1",")","in","the","scale","tensor",",","or","suppress","it",".","minimum_scale","default","scale","that","is","used","for","elements","that","are","constantly","zero","along","dimension","``","dim","``","."]
code: def __call__(
      self, data: torch.Tensor, weights: torch.Tensor
  ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      assert (
          data.shape == weights.shape
      ), "data and weights must have same shape"
      with torch.no_grad():
          denominator = weights.sum(self.dim, keepdim=self.keepdim)
          denominator = denominator.clamp_min(1.0)
          loc = (data * weights).sum(
              self.dim, keepdim=self.keepdim
          ) / denominator
  
          variance = (((data - loc) * weights) ** 2).sum(
              self.dim, keepdim=self.keepdim
          ) / denominator
          scale = torch.sqrt(variance + self.minimum_scale)
          return (data - loc) / scale, loc, scale
  
file_path: gluonts/src/gluonts/torch/scaler.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from gluonts.core.component import validated
label_desc: Use image node_id 2 for calling the StdScaler obj's underlying member method code with example usage: obj.__call__(data, weights) and returns: unknown,  loc,  scale