Coverage for src/flag_gems/runtime/backend/_cambricon/ops/tan.py: 0%
18 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-23 02:03 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-23 02:03 +0800
1import logging
3import triton
4import triton.language as tl
6from flag_gems.utils import tl_extra_shim
8from ..utils.pointwise_dynamic import pointwise_dynamic
10logger = logging.getLogger(__name__)
13@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, "INT_TO_FLOAT")])
14@triton.jit
15def tan_func(x, inplace):
16 y = tl_extra_shim.tan(x.to(tl.float32))
17 return y
20def tan(A):
21 logger.debug("GEMS_CAMBRICON TAN")
22 return tan_func(A, False)
25def tan_(A):
26 logger.debug("GEMS_CAMBRICON TAN_")
27 tan_func(A, True, out0=A)
28 return A