class_docstr: Performs update(x): result = fn(result, x)
  where fn is a custom function
class_docstr_tok: ["Performs","update","(","x",")",":","result","=","fn","(","result",",","x",")","where","fn","is","a","custom","function"]
code: def __init__(self, fn: Callable, name: Optional[str] = None) -> None:
      super().__init__(name=name)
      self.result = None
      self.fn = fn
  
imports: from typing import Any, Callable, List, Optional, TYPE_CHECKING
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 to create a new GeneralAccumFn object from inherited base classes: Stat with example: obj = GeneralAccumFn(fn, name)