收集整理了一份《2024年最新Python全套学习资料》免费送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Python知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来
如果你需要这些资料,可以添加V无偿获取:hxbc188 (备注666)
正文
disabled_pass : Optional[Union[List[str], Set[str], Tuple[str]]]
The list of passes that are disabled.
instruments : Optional[Sequence[PassInstrument]]
The list of pass instrument implementations.
config : Optional[Dict[str, Object]]
Additional configurations for specific passes.
“”"
`tvm.relay.build()`构建Relay函数以在TVM图形执行器上运行,返回TVM图执行器的运行时工厂`tvm.relay.backend.executor_factory.ExecutorFactoryModule`。因为使用的是默认参数`executor=Executor("graph")`,因此返回的是`GraphExecutorFactoryModule`:
def build(
ir_mod,
target=None,
target_host=None,
executor=Executor(“graph”),
runtime=Runtime(“cpp”),
workspace_memory_pools=None,
constant_memory_pools=None,
params=None,
mod_name=“default”,
):
# fmt: off
# pylint: disable=line-too-long
“”"Helper function that builds a Relay function to run on TVM graph executor.
Parameters
ir_mod : :py:class:~tvm.IRModule
The IR module to build. Using relay.Function is deprecated.
target : None, or any multi-target like object, see Target.canon_multi_target
For homogeneous compilation, the unique build target.
For heterogeneous compilation, a dictionary or list of possible build targets.
Defaults to the current target in the environment if None.
target_host : None, or any target like object, see Target.canon_target
Host compilation target, if target is device.
executor : Optional[Executor]
The executor configuration with which to build the model.
Defaults to “graph” if no executor specified.
runtime : Optional[Runtime]
Runtime configuration to use when building the model.
Defaults to “cpp” if no runtime specified.
workspace_memory_pools : Optional[WorkspaceMemoryPools]
The object that contains an Array of WorkspacePoolInfo objects
that hold properties of read-write workspace pools that could be
used by the inference.
constant_memory_pools : Optional[ConstantMemoryPools]
The object that contains an Array of ConstantPoolInfo objects
that hold properties of read-only pools that could be
used by the inference.
params : dict of str to NDArray
Input parameters to the graph that do not change
during inference time. Used for constant folding.
mod_name: Optional[str]
The module name we will build
Returns
factory_module : tvm.relay.backend.executor_factory.ExecutorFactoryModule
The runtime factory for the TVM graph executor.
“”"
`tvm.device()`函数使用给定的设备类型和id构造TVM设备:
def device(dev_type, dev_id=0):
“”"Construct a TVM device with given device type and id.
Parameters
dev_type: int or str
The device type mask or name of the device.
dev_id : int, optional
The integer device id
Returns
dev: tvm.runtime.Device
The corresponding device.
Examples
Device can be used to create reflection of device by
string representation of the device type.
… code-block:: py