pytorch
2973fd80 - [primTorch] add exp2 (prim and ref), log10 (prim and ref), frac (ref) (#78046)

Commit
2 years ago
[primTorch] add exp2 (prim and ref), log10 (prim and ref), frac (ref) (#78046) Adds `exp2`, `log10` to the prims (both also exist in C++ lib and Intel SIMD intrinsic has `exp2`) Adds `exp2`, `log10`, `frac` to refs with corresponding entries to OpInfo. Tried to decompose `exp2` (before adding it as prim) as * `exp(log(2) * x)` but it wasn't stable at large numbers. * `pow(2, x)` in which case there was stride mismatch. At cursory look, `pow` tries to preserve stride of first arg if possible. Tried to decompose `log10` (before adding it as prim) as * `log(x) / log(10)` passed for real dtypes. Failed for complex at extremals. Probably related to https://github.com/pytorch/pytorch/issues/52332 (not a 100% sure) Pull Request resolved: https://github.com/pytorch/pytorch/pull/78046 Approved by: https://github.com/mruberry
Author
Committer
Parents
Loading