class_docstr: Calculates the average of a tensor
class_docstr_tok: ["Calculates","the","average","of","a","tensor"]
code: def update(self, x):
      n = self.n.get()
  
      if self.rolling_mean is None:
          # Ensures rolling_mean is a float tensor
          self.rolling_mean = (
              x.clone() if x.is_floating_point() else x.double()
          )
      else:
          delta = x - self.rolling_mean
          self.rolling_mean += delta / n
  
imports: from typing import Any, Callable, List, Optional, TYPE_CHECKING
  import torch
  from torch import Tensor
label_desc: Use image node_id 4 for calling the Mean obj's underlying member method code with example usage: obj.update(x) without return types