class_docstr: Relay VM runtime.
  
  Parameters
  ----------
  exe : Executable
      The VM executable.
  
  device : tvm.runtime.Device or List[tvm.runtime.Device]
      The device(s) on which the model will run.
      Currently at most one device per device type is supported.
  
  memory_cfg : str or Dict[tvm.runtime.Device, str], optional
      Config the type of memory allocator. The allocator type can be ["naive",
      "pooled"]. If memory_cfg is None, all devices will use pooled allocator
      by default. If memory_cfg is string, all devices will use the specified
      allocator type. If memory_cfg is a dict, each device uses the allocator
      type specified in the dict, or pooled allocator if not specified in the
      dict.
docstr: Init devices and allocators.
docstr_tok: ["Init","devices","and","allocators","."]
code: def _setup_device(self, dev, memory_cfg):
      """Init devices and allocators."""
      devs = dev
      if not isinstance(dev, (list, tuple)):
          if not isinstance(dev, tvm.runtime.Device):
              raise TypeError(
                  "dev is expected to be Device or List[Device]"
              )
          devs = [dev]
  
      # CPU is required for executing shape functions
      if not any(
          c.device_type % RPC_SESS_MASK == tvm.cpu().device_type
          for c in devs
      ):
          devs.append(tvm.cpu())
  
      default_alloc_type = VirtualMachine.POOLED_ALLOCATOR
      if memory_cfg is None:
          memory_cfg = {}
      elif isinstance(memory_cfg, str):
          assert memory_cfg in ["naive", "pooled"]
          if memory_cfg == "naive":
              default_alloc_type = VirtualMachine.NAIVE_ALLOCATOR
          memory_cfg = {}
      elif not isinstance(memory_cfg, dict):
          raise TypeError(
              f"memory_cfg is expected be string or dictionary, but received {type(memory_cfg)}"
          )
      init_args = []
      for device in devs:
          init_args.append(device.device_type % RPC_SESS_MASK)
          init_args.append(device.device_id)
          alloc_type = (
              memory_cfg[device]
              if device in memory_cfg
              else default_alloc_type
          )
          init_args.append(alloc_type)
      self._init(*init_args)
  
imports: import numpy
  import tvm
  from tvm.runtime import Module
  from tvm._ffi.runtime_ctypes import TVMByteArray
  from tvm._ffi import base
  from .object import Object
  from .None import _ffi_api, container
  from ..rpc.base import RPC_SESS_MASK
label_desc: Use image node_id 2 for calling the VirtualMachine obj's underlying member method code with example usage: obj._setup_device(dev, memory_cfg) without return types