mirror of
https://github.com/FlashML-org/FreeToken.git
synced 2026-11-21 01:52:30 +08:00
20 lines
413 B
Python
20 lines
413 B
Python
from __future__ import annotations
|
|
|
|
import functools
|
|
from typing import TYPE_CHECKING
|
|
|
|
from .utils import load_aot
|
|
|
|
if TYPE_CHECKING:
|
|
import torch
|
|
from tvm_ffi import Module
|
|
|
|
|
|
@functools.cache
|
|
def _load_test_tensor_module() -> Module:
|
|
return load_aot("test_tensor", cpp_files=["tensor.cpp"])
|
|
|
|
|
|
def test_tensor(x: torch.Tensor, y: torch.Tensor) -> int:
|
|
return _load_test_tensor_module().test(x, y)
|