class_docstr: Wrap build_func to a function that can be used in measure.
  
  Note: this is a class instead of a closure so that it can be pickled when
  using multiprocessing.
  
  Parameters
  ----------
  build_func : The compilation function
      We expect fcompile to contain an attr "output_format".
  runtime : Optional[Runtime]
      The runtime to generate artifacts for
  
  Returns
  -------
  wrapped_build_func : callable
      The wrapped build function
class_docstr_tok: ["Wrap","build_func","to","a","function","that","can","be","used","in","measure",".","Note",":","this","is","a","class","instead","of","a","closure","so","that","it","can","be","pickled","when","using","multiprocessing",".","Parameters","--","--","--","--","--","build_func",":","The","compilation","function","We","expect","fcompile","to","contain","an","attr","``","output_format","''",".","runtime",":","Optional","[","Runtime","]","The","runtime","to","generate","artifacts","for","Returns","--","--","--","-","wrapped_build_func",":","callable","The","wrapped","build","function"]
code: def __init__(self, build_func, runtime=None):
      if not hasattr(build_func, "output_format"):
          raise AttributeError(
              "Expect build_func to have the attribute output_format."
          )
      self.build_func = build_func
      self.runtime = runtime
  
imports: import contextlib
  import logging
  import os
  import shutil
  import tempfile
  import threading
  import time
  import traceback
  import typing
  import warnings
  from collections import namedtuple
  from random import getrandbits
  import tvm._ffi
  import tvm.ir.transform
  from tvm import nd
  from tvm import rpc
  from tvm.autotvm.env import AutotvmGlobalScope, reset_global_scope
  from tvm.contrib import ndk, stackvm, tar
  from tvm.contrib.popen_pool import PopenPoolExecutor
  from tvm.driver import build
  from tvm.error import TVMError
  from tvm.target import Target
  from ..env import AutotvmGlobalScope
  from ..task.space import InstantiationError
  from ..utils import get_const_tuple
  from .measure import Builder, MeasureErrorNo, MeasureResult, Runner
label_desc: Use image node_id 1 to create a new _WrappedBuildFunc object  with example: obj = _WrappedBuildFunc(build_func, runtime)