BYODT 框架

BYODT 框架#

BYODT(Bring Your Own Datatype) 框架允许用户在 TVM 中注册和使用自定义数据类型。

import numpy as np
import pytest

import tvm
import tvm.topi.testing
import tvm.testing
from tvm.target.datatype import (
    create_lower_func,  # 创建自定义数据类型的Lower函数
    create_min_lower_func,  # 创建最小值Lower函数
    lower_call_pure_extern,  # 处理外部函数调用
    lower_ite,  # 处理条件分支
    register,  # 注册自定义数据类型
    register_min_func,  # 注册最小值函数
    register_op,  # 注册操作
)
from tvm.tir.op import call_pure_extern
from tvm.script import tir as T