{-# OPTIONS_GHC -fno-cse #-}
module Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating
( cinv_ , cinv
, sigmoid_ , sigmoid
, log_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.log
, lgamma_ , lgamma
, log1p_ , log1p
, exp_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.exp
, cos_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.cos
, acos_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.acos
, cosh_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.cosh
, sin_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.sin
, asin_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.asin
, sinh_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.sinh
, tan_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.tan
, atan_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.atan
, tanh_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.tanh
, erf_ , erf
, erfinv_ , erfinv
, pow_ , pow
, tpow_ , tpow
, sqrt_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.sqrt
, rsqrt_ , rsqrt
, ceil_ , ceil
, floor_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.floor
, round_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.round
, trunc_ , trunc
, frac_ , frac
, lerp_ , lerp
, atan2_ , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating.atan2
) where
import GHC.Int
import System.IO.Unsafe
import Torch.Indef.Dynamic.Tensor
import qualified Torch.Sig.Tensor.Math.Pointwise.Floating as Sig
import Torch.Indef.Types
cinv :: Dynamic -> Dynamic
cinv t = unsafeDupablePerformIO $ let r = empty in _cinv r t >> pure r
{-# NOINLINE cinv #-}
cinv_ :: Dynamic -> IO ()
cinv_ t = _cinv t t
sigmoid :: Dynamic -> Dynamic
sigmoid t = unsafeDupablePerformIO $ let r = empty in _sigmoid r t >> pure r
{-# NOINLINE sigmoid #-}
sigmoid_ :: Dynamic -> IO ()
sigmoid_ t = _sigmoid t t
log :: Dynamic -> Dynamic
log t = unsafeDupablePerformIO $ let r = empty in _log r t >> pure r
{-# NOINLINE log #-}
log_ :: Dynamic -> IO ()
log_ t = _log t t
lgamma :: Dynamic -> Dynamic
lgamma t = unsafeDupablePerformIO $ let r = empty in _lgamma r t >> pure r
{-# NOINLINE lgamma #-}
lgamma_ :: Dynamic -> IO ()
lgamma_ t = _lgamma t t
log1p :: Dynamic -> Dynamic
log1p t = unsafeDupablePerformIO $ let r = empty in _log1p r t >> pure r
{-# NOINLINE log1p #-}
log1p_ :: Dynamic -> IO ()
log1p_ t = _log1p t t
exp :: Dynamic -> Dynamic
exp t = unsafeDupablePerformIO $ let r = empty in _exp r t >> pure r
{-# NOINLINE exp #-}
exp_ :: Dynamic -> IO ()
exp_ t = _exp t t
cos :: Dynamic -> Dynamic
cos t = unsafeDupablePerformIO $ let r = empty in _cos r t >> pure r
{-# NOINLINE cos #-}
cos_ :: Dynamic -> IO ()
cos_ t = _cos t t
acos :: Dynamic -> Dynamic
acos t = unsafeDupablePerformIO $ let r = empty in _acos r t >> pure r
{-# NOINLINE acos #-}
acos_ :: Dynamic -> IO ()
acos_ t = _acos t t
cosh :: Dynamic -> Dynamic
cosh t = unsafeDupablePerformIO $ let r = empty in _cosh r t >> pure r
{-# NOINLINE cosh #-}
cosh_ :: Dynamic -> IO ()
cosh_ t = _cosh t t
sin :: Dynamic -> Dynamic
sin t = unsafeDupablePerformIO $ let r = empty in _sin r t >> pure r
{-# NOINLINE sin #-}
sin_ :: Dynamic -> IO ()
sin_ t = _sin t t
asin :: Dynamic -> Dynamic
asin t = unsafeDupablePerformIO $ let r = empty in _asin r t >> pure r
{-# NOINLINE asin #-}
asin_ :: Dynamic -> IO ()
asin_ t = _asin t t
sinh :: Dynamic -> Dynamic
sinh t = unsafeDupablePerformIO $ let r = empty in _sinh r t >> pure r
{-# NOINLINE sinh #-}
sinh_ :: Dynamic -> IO ()
sinh_ t = _sinh t t
tan :: Dynamic -> Dynamic
tan t = unsafeDupablePerformIO $ let r = empty in _tan r t >> pure r
{-# NOINLINE tan #-}
tan_ :: Dynamic -> IO ()
tan_ t = _tan t t
atan :: Dynamic -> Dynamic
atan t = unsafeDupablePerformIO $ let r = empty in _atan r t >> pure r
{-# NOINLINE atan #-}
atan_ :: Dynamic -> IO ()
atan_ t = _atan t t
tanh :: Dynamic -> Dynamic
tanh t = unsafeDupablePerformIO $ let r = empty in _tanh r t >> pure r
{-# NOINLINE tanh #-}
tanh_ :: Dynamic -> IO ()
tanh_ t = _tanh t t
erf :: Dynamic -> Dynamic
erf t = unsafeDupablePerformIO $ let r = empty in _erf r t >> pure r
{-# NOINLINE erf #-}
erf_ :: Dynamic -> IO ()
erf_ t = _erf t t
erfinv :: Dynamic -> Dynamic
erfinv t = unsafeDupablePerformIO $ let r = empty in _erfinv r t >> pure r
{-# NOINLINE erfinv #-}
erfinv_ :: Dynamic -> IO ()
erfinv_ t = _erfinv t t
pow :: Dynamic -> HsReal -> Dynamic
pow t v = unsafeDupablePerformIO $ let r = empty in _pow r t v >> pure r
{-# NOINLINE pow #-}
pow_ :: Dynamic -> HsReal -> IO ()
pow_ t v = _pow t t v
tpow
:: HsReal
-> Dynamic
-> Dynamic
tpow v t = unsafeDupablePerformIO $ let r = empty in _tpow r v t >> pure r
{-# NOINLINE tpow #-}
tpow_ :: HsReal -> Dynamic -> IO ()
tpow_ v t = _tpow t v t
sqrt :: Dynamic -> Dynamic
sqrt t = unsafeDupablePerformIO $ let r = empty in _sqrt r t >> pure r
{-# NOINLINE sqrt #-}
sqrt_ :: Dynamic -> IO ()
sqrt_ t = _sqrt t t
rsqrt :: Dynamic -> Dynamic
rsqrt t = unsafeDupablePerformIO $ let r = empty in _rsqrt r t >> pure r
{-# NOINLINE rsqrt #-}
rsqrt_ :: Dynamic -> IO ()
rsqrt_ t = _rsqrt t t
ceil :: Dynamic -> Dynamic
ceil t = unsafeDupablePerformIO $ let r = empty in _ceil r t >> pure r
{-# NOINLINE ceil #-}
ceil_ :: Dynamic -> IO ()
ceil_ t = _ceil t t
floor :: Dynamic -> Dynamic
floor t = unsafeDupablePerformIO $ let r = empty in _floor r t >> pure r
{-# NOINLINE floor #-}
floor_ :: Dynamic -> IO ()
floor_ t = _floor t t
round :: Dynamic -> Dynamic
round t = unsafeDupablePerformIO $ let r = empty in _round r t >> pure r
{-# NOINLINE round #-}
round_ :: Dynamic -> IO ()
round_ t = _round t t
trunc :: Dynamic -> Dynamic
trunc t = unsafeDupablePerformIO $ let r = empty in _trunc r t >> pure r
{-# NOINLINE trunc #-}
trunc_ :: Dynamic -> IO ()
trunc_ t = _trunc t t
frac :: Dynamic -> Dynamic
frac t = unsafeDupablePerformIO $ let r = empty in _frac r t >> pure r
{-# NOINLINE frac #-}
frac_ :: Dynamic -> IO ()
frac_ t = _frac t t
lerp :: Dynamic -> Dynamic -> HsReal -> Dynamic
lerp a b v = unsafeDupablePerformIO $ let r = empty in _lerp r a b v >> pure r
{-# NOINLINE lerp #-}
lerp_ :: Dynamic -> Dynamic -> HsReal -> IO ()
lerp_ a b v = _lerp a a b v
atan2 :: Dynamic -> Dynamic -> Dynamic
atan2 a b = unsafeDupablePerformIO $ let r = empty in _atan2 r a b >> pure r
{-# NOINLINE atan2 #-}
atan2_ :: Dynamic -> Dynamic -> IO ()
atan2_ a b = _atan2 a a b
_cinv, _sigmoid, _log, _lgamma, _log1p, _exp, _cos, _acos, _sinh
:: Dynamic -> Dynamic -> IO ()
_cinv a b = with2DynamicState a b Sig.c_cinv
_sigmoid a b = with2DynamicState a b Sig.c_sigmoid
_log a b = with2DynamicState a b Sig.c_log
_lgamma a b = with2DynamicState a b Sig.c_lgamma
_log1p a b = with2DynamicState a b Sig.c_log1p
_exp a b = with2DynamicState a b Sig.c_exp
_cos a b = with2DynamicState a b Sig.c_cos
_acos a b = with2DynamicState a b Sig.c_acos
_sinh a b = with2DynamicState a b Sig.c_sinh
_asin, _cosh, _sin, _tan, _atan, _tanh, _erf, _erfinv, _sqrt
:: Dynamic -> Dynamic -> IO ()
_asin a b = with2DynamicState a b Sig.c_asin
_cosh a b = with2DynamicState a b Sig.c_cosh
_sin a b = with2DynamicState a b Sig.c_sin
_tan a b = with2DynamicState a b Sig.c_tan
_atan a b = with2DynamicState a b Sig.c_atan
_tanh a b = with2DynamicState a b Sig.c_tanh
_erf a b = with2DynamicState a b Sig.c_erf
_erfinv a b = with2DynamicState a b Sig.c_erfinv
_sqrt a b = with2DynamicState a b Sig.c_sqrt
_rsqrt, _ceil, _floor, _round, _trunc, _frac
:: Dynamic -> Dynamic -> IO ()
_rsqrt a b = with2DynamicState a b Sig.c_rsqrt
_ceil a b = with2DynamicState a b Sig.c_ceil
_floor a b = with2DynamicState a b Sig.c_floor
_round a b = with2DynamicState a b Sig.c_round
_trunc a b = with2DynamicState a b Sig.c_trunc
_frac a b = with2DynamicState a b Sig.c_frac
_atan2 :: Dynamic -> Dynamic -> Dynamic -> IO ()
_atan2 a b c = with3DynamicState a b c Sig.c_atan2
_pow :: Dynamic -> Dynamic -> HsReal -> IO ()
_pow a b v = withLift $ Sig.c_pow
<$> managedState
<*> managedTensor a
<*> managedTensor b
<*> pure (hs2cReal v)
_tpow :: Dynamic -> HsReal -> Dynamic -> IO ()
_tpow a v b = with2DynamicState a b $ \s' a' b' -> Sig.c_tpow s' a' (hs2cReal v) b'
_lerp :: Dynamic -> Dynamic -> Dynamic -> HsReal -> IO ()
_lerp a b c v = with3DynamicState a b c $ \s' a' b' c' -> Sig.c_lerp s' a' b' c' (hs2cReal v)