问题如题:
如何让一个class里面的func函数被class外部的一个kernel函数调用?
class C:
@ti.func
def func(self):
类内函数
c = C()
@ti.kernel
def kern():
c.func()
试试看这个
这样可行,但感觉这样写是不是不太好?
我目前实现方式把类里面的func函数decorated成classmethod, 也能运行。
问题如题:
如何让一个class里面的func函数被class外部的一个kernel函数调用?
class C:
@ti.func
def func(self):
类内函数
c = C()
@ti.kernel
def kern():
c.func()
试试看这个
这样可行,但感觉这样写是不是不太好?
我目前实现方式把类里面的func函数decorated成classmethod, 也能运行。