class_docstr: Operator base class, implements __init__ and __call__,
  
  Examples:
      class AddOperator(Operator):
          def __init__(self, factor: int):
              self._factor = factor
  
          def __call__(self, num)
              return self._factor + num
class_docstr_tok: ["Operator","base","class",",","implements","__init__","and","__call__",",","Examples",":","class","AddOperator","(","Operator",")",":","def","__init__","(","self",",","factor",":","int",")",":","self._factor","=","factor","def","__call__","(","self",",","num",")","return","self._factor","+","num"]
docstr: Init operator, before a graph starts, the framework will call Operator __init__ function.
  
  Args:
  
  Raises:
      An exception during __init__ can terminate the graph run.
docstr_tok: ["Init","operator",",","before","a","graph","starts",",","the","framework","will","call","Operator","__init__","function",".","Args",":","Raises",":","An","exception","during","__init__","can","terminate","the","graph","run","."]
code: def __init__(self):
      """
      Init operator, before a graph starts, the framework will call Operator __init__ function.
  
      Args:
  
      Raises:
          An exception during __init__ can terminate the graph run.
      """
      from towhee.runtime import (
          get_sys_config,
      )  # pylint: disable=import-outside-toplevel
  
      sys_config = get_sys_config()
      if sys_config is not None:
          self._device_id = sys_config.device_id
      else:
          self._device_id = -1
      self._key = ""
  
imports: from abc import abstractmethod, ABC
  from enum import Enum
  from enum import Flag, auto
label_desc: Use image node_id 1 to create a new Operator object from inherited base classes: ABC with example: obj = Operator()