2024年最新2024网易Python高级面试题及答案,使用Python API(AutoTVM),2024年最新Python 400道面试题通关宝典助你进大厂

收集整理了一份《2024年最新Python全套学习资料》免费送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img



既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Python知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来

如果你需要这些资料,可以添加V无偿获取:hxbc188 (备注666)
img

正文

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

  • 27
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值