class_docstr: A TVM object cost model to support customization on the python side.
  This is NOT the user facing class for function overloading inheritance.
  
  See also: PyCostModel
class_docstr_tok: ["A","TVM","object","cost","model","to","support","customization","on","the","python","side",".","This","is","NOT","the","user","facing","class","for","function","overloading","inheritance",".","See","also",":","PyCostModel"]
docstr: Constructor.
docstr_tok: ["Constructor","."]
code: def __init__(
      self,
      f_load: Callable = None,
      f_save: Callable = None,
      f_update: Callable = None,
      predict_func: Callable = None,
      f_as_string: Callable = None,
  ):
      """Constructor."""
  
      def f_predict(
          context: TuneContext,
          candidates: List[MeasureCandidate],
          return_ptr,
      ) -> None:
          n = len(candidates)
          return_ptr = ctypes.cast(
              return_ptr, ctypes.POINTER(ctypes.c_double)
          )
          array_wrapper = np.ctypeslib.as_array(return_ptr, shape=(n,))
          res = predict_func(context, candidates)
          array_wrapper[:] = res
          assert (
              array_wrapper.dtype == "float64"
          ), "ValueError: Invalid data type returned from CostModel Predict!"
  
      self.__init_handle_by_constructor__(
          _ffi_api.CostModelPyCostModel,  # type: ignore # pylint: disable=no-member
          f_load,
          f_save,
          f_update,
          f_predict,
          f_as_string,
      )
  
imports: import ctypes
  from typing import Callable, List, Union
  from typing_extensions import Literal
  import numpy
  from tvm._ffi import register_object
  from tvm.runtime import Object
  from ..None import _ffi_api
  from ..runner import RunnerResult
  from ..search_strategy import MeasureCandidate
  from ..tune_context import TuneContext
  from ..utils import _get_default_str
label_desc: Use image node_id 1 to create a new _PyCostModel object from inherited base classes: CostModel with example: obj = _PyCostModel(f_load, f_save, f_update, predict_func, f_as_string)