-# License .to the Apache Software Foundation (ASF) under one
+# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
class VMCompiler(object):
"""Compiler that compiles Relay module to VM executable."""
+
def __init__(self):
self.mod = _vm._VMCompiler()
self._lower = self.mod["lower"]
target : :py:class:`Target`
The target option to build the function.
"""
+
def __init__(self, mod, ctx, target):
if mod is None:
raise RuntimeError("Must provide module to get VM executor.")
-# License .to the Apache Software Foundation (ASF) under one
+# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
from tvm.runtime import _ffi_api
from . import vm
+
def enabled():
"""Whether vm profiler is enabled."""
return hasattr(_ffi_api, "_VirtualMachineDebug")
+
class VirtualMachineProfiler(vm.VirtualMachine):
"""Relay profile VM runtime."""
+
def __init__(self, mod):
super(VirtualMachineProfiler, self).__init__(mod)
m = mod.module if isinstance(mod, vm.Executable) else mod
-# License .to the Apache Software Foundation (ASF) under one
+# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
from .object import Object
from . import _ffi_api, container
+
def _convert(arg, cargs):
if isinstance(arg, Object):
cargs.append(arg)
class Executable(object):
"""Relay VM executable"""
+
def __init__(self, mod):
self.mod = mod
self._function_params = {}
class VirtualMachine(object):
"""Relay VM runtime."""
+
def __init__(self, mod):
if not isinstance(mod, (Executable, tvm.runtime.Module)):
raise TypeError("mod is expected to be the type of Executable or " +