Coverage for src/flag_gems/ops/expm1.py: 94%
18 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-06-04 09:03 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-06-04 09:03 +0800
1import logging
3import triton
4import triton.language as tl
6from flag_gems.utils import pointwise_dynamic
8logger = logging.getLogger(__name__)
11@pointwise_dynamic(promotion_methods=[(0, "INT_TO_FLOAT")])
12@triton.jit
13def expm1_func(x):
14 return tl.exp(x.to(tl.float32)) - 1.0
17def expm1(A):
18 logger.debug("GEMS EXPM1")
19 return expm1_func(A)
22def expm1_(A):
23 logger.debug("GEMS EXPM1_")
24 return expm1_func(A, out0=A)
27# expm1.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
28def expm1_out(A, out):
29 logger.debug("GEMS EXPM1_OUT")
30 return expm1_func(A, out0=out)