horde-ad-0.2.0.0: Higher Order Reverse Derivatives Efficiently - Automatic Differentiation
Safe HaskellNone
LanguageGHC2024

HordeAd.Core.CarriersAst

Description

Definitions, mostly class instances, needed to make AST a valid carrier for a tensor class algebra (instance) defined in HordeAd.Core.OpsAst. This algebra permits user programs to be instantiated as AST terms, as well as to be interpreted into AST terms and it also permits derivatives to be expressed as AST terms.

Synopsis

Documentation

newtype AstRaw (s :: AstSpanType) (y :: TK) Source #

An AST variant that doesn't vectorize terms and also builds them with ordinary, non-simplifying constructors. It's based on sharing rather than lets and commonly used as the instance for primals inside ADVal and, consequently, used for evaluating delta expressions.

Constructors

AstRaw 

Instances

Instances details
AstSpan s => ConvertTensor (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

tconvert :: forall (a :: TK) (b :: TK). TKConversion a b -> SingletonTK a -> AstRaw s a -> AstRaw s b Source #

kfromR :: GoodScalar r => AstRaw s (TKR 0 r) -> AstRaw s ('TKScalar r) Source #

kfromS :: GoodScalar r => AstRaw s (TKS ('[] :: [Nat]) r) -> AstRaw s ('TKScalar r) Source #

kfromX :: GoodScalar r => AstRaw s (TKX ('[] :: [Maybe Nat]) r) -> AstRaw s ('TKScalar r) Source #

rfromK :: GoodScalar r => AstRaw s ('TKScalar r) -> AstRaw s (TKR 0 r) Source #

rfromS :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstRaw s ('TKS2 sh x) -> AstRaw s ('TKR2 (Rank sh) x) Source #

rfromX :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 sh x) -> AstRaw s ('TKR2 (Rank sh) x) Source #

sfromK :: GoodScalar r => AstRaw s ('TKScalar r) -> AstRaw s (TKS ('[] :: [Nat]) r) Source #

sfromR :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstRaw s ('TKR2 (Rank sh) x) -> AstRaw s ('TKS2 sh x) Source #

sfromX :: forall (sh :: [Nat]) (sh' :: [Maybe Nat]) (x :: TK). (KnownShS sh, Rank sh ~ Rank sh', KnownSTK x) => AstRaw s ('TKX2 sh' x) -> AstRaw s ('TKS2 sh x) Source #

xfromK :: GoodScalar r => AstRaw s ('TKScalar r) -> AstRaw s (TKX ('[] :: [Maybe Nat]) r) Source #

xfromR :: forall (sh' :: [Maybe Nat]) (x :: TK). (KnownShX sh', KnownSTK x) => AstRaw s ('TKR2 (Rank sh') x) -> AstRaw s ('TKX2 sh' x) Source #

xfromS :: forall (sh :: [Nat]) (sh' :: [Maybe Nat]) (x :: TK). (KnownShS sh, KnownShX sh', Rank sh ~ Rank sh', KnownSTK x) => AstRaw s ('TKS2 sh x) -> AstRaw s ('TKX2 sh' x) Source #

rzip :: forall (y :: TK) (z :: TK) (n :: Nat). (KnownSTK y, KnownSTK z) => AstRaw s ('TKProduct ('TKR2 n y) ('TKR2 n z)) -> AstRaw s ('TKR2 n ('TKProduct y z)) Source #

runzip :: forall (y :: TK) (z :: TK) (n :: Nat). AstRaw s ('TKR2 n ('TKProduct y z)) -> AstRaw s ('TKProduct ('TKR2 n y) ('TKR2 n z)) Source #

szip :: forall (y :: TK) (z :: TK) (sh :: [Nat]). (KnownSTK y, KnownSTK z) => AstRaw s ('TKProduct ('TKS2 sh y) ('TKS2 sh z)) -> AstRaw s ('TKS2 sh ('TKProduct y z)) Source #

sunzip :: forall (y :: TK) (z :: TK) (sh :: [Nat]). AstRaw s ('TKS2 sh ('TKProduct y z)) -> AstRaw s ('TKProduct ('TKS2 sh y) ('TKS2 sh z)) Source #

xzip :: forall (y :: TK) (z :: TK) (sh :: [Maybe Nat]). (KnownSTK y, KnownSTK z) => AstRaw s ('TKProduct ('TKX2 sh y) ('TKX2 sh z)) -> AstRaw s ('TKX2 sh ('TKProduct y z)) Source #

xunzip :: forall (y :: TK) (z :: TK) (sh :: [Maybe Nat]). AstRaw s ('TKX2 sh ('TKProduct y z)) -> AstRaw s ('TKProduct ('TKX2 sh y) ('TKX2 sh z)) Source #

rnest :: forall (n :: Nat) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => SNat n -> AstRaw s ('TKR2 (n + m) x) -> AstRaw s ('TKR2 n ('TKR2 m x)) Source #

rnestS :: forall (n :: Nat) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => SNat n -> AstRaw s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ MapJust sh2) x) -> AstRaw s ('TKR2 n ('TKS2 sh2 x)) Source #

rnestX :: forall (n :: Nat) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => SNat n -> AstRaw s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ sh2) x) -> AstRaw s ('TKR2 n ('TKX2 sh2 x)) Source #

snestR :: forall (sh1 :: [Nat]) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => ShS sh1 -> AstRaw s ('TKX2 (MapJust sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) -> AstRaw s ('TKS2 sh1 ('TKR2 m x)) Source #

snest :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => ShS sh1 -> AstRaw s ('TKS2 (sh1 ++ sh2) x) -> AstRaw s ('TKS2 sh1 ('TKS2 sh2 x)) Source #

snestX :: forall (sh1 :: [Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => ShS sh1 -> AstRaw s ('TKX2 (MapJust sh1 ++ sh2) x) -> AstRaw s ('TKS2 sh1 ('TKX2 sh2 x)) Source #

xnestR :: forall (sh1 :: [Maybe Nat]) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => StaticShX sh1 -> AstRaw s ('TKX2 (sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) -> AstRaw s ('TKX2 sh1 ('TKR2 m x)) Source #

xnestS :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => StaticShX sh1 -> AstRaw s ('TKX2 (sh1 ++ MapJust sh2) x) -> AstRaw s ('TKX2 sh1 ('TKS2 sh2 x)) Source #

xnest :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => StaticShX sh1 -> AstRaw s ('TKX2 (sh1 ++ sh2) x) -> AstRaw s ('TKX2 sh1 ('TKX2 sh2 x)) Source #

runNest :: forall (n :: Nat) (m :: Nat) (x :: TK). (KnownNat n, KnownNat m, KnownSTK x) => AstRaw s ('TKR2 n ('TKR2 m x)) -> AstRaw s ('TKR2 (n + m) x) Source #

runNestS :: forall (n :: Nat) (sh2 :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh2, KnownSTK x) => AstRaw s ('TKR2 n ('TKS2 sh2 x)) -> AstRaw s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ MapJust sh2) x) Source #

runNestX :: forall (n :: Nat) (sh2 :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh2, KnownSTK x) => AstRaw s ('TKR2 n ('TKX2 sh2 x)) -> AstRaw s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ sh2) x) Source #

sunNestR :: forall (sh1 :: [Nat]) (m :: Nat) (x :: TK). (KnownShS sh1, KnownNat m, KnownSTK x) => AstRaw s ('TKS2 sh1 ('TKR2 m x)) -> AstRaw s ('TKX2 (MapJust sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) Source #

sunNest :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh1, KnownShS sh2, KnownSTK x) => AstRaw s ('TKS2 sh1 ('TKS2 sh2 x)) -> AstRaw s ('TKS2 (sh1 ++ sh2) x) Source #

sunNestX :: forall (sh1 :: [Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShS sh1, KnownShX sh2, KnownSTK x) => AstRaw s ('TKS2 sh1 ('TKX2 sh2 x)) -> AstRaw s ('TKX2 (MapJust sh1 ++ sh2) x) Source #

xunNestR :: forall (sh1 :: [Maybe Nat]) (m :: Nat) (x :: TK). (KnownShX sh1, KnownNat m, KnownSTK x) => AstRaw s ('TKX2 sh1 ('TKR2 m x)) -> AstRaw s ('TKX2 (sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) Source #

xunNestS :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShX sh1, KnownShS sh2, KnownSTK x) => AstRaw s ('TKX2 sh1 ('TKS2 sh2 x)) -> AstRaw s ('TKX2 (sh1 ++ MapJust sh2) x) Source #

xunNest :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x) => AstRaw s ('TKX2 sh1 ('TKX2 sh2 x)) -> AstRaw s ('TKX2 (sh1 ++ sh2) x) Source #

tpairConv :: forall (x :: TK) (z :: TK). AstRaw s x -> AstRaw s z -> AstRaw s ('TKProduct x z) Source #

tunpairConv :: forall (x :: TK) (z :: TK). AstRaw s ('TKProduct x z) -> (AstRaw s x, AstRaw s z) Source #

AstSpan s => BaseTensor (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

rshape :: forall (n :: Nat) (x :: TK). KnownSTK x => AstRaw s ('TKR2 n x) -> IShR n Source #

rlength :: forall (n :: Nat) (x :: TK). KnownSTK x => AstRaw s ('TKR2 n x) -> Int Source #

rsize :: forall (n :: Nat) (x :: TK). KnownSTK x => AstRaw s ('TKR2 n x) -> Int Source #

rwidth :: forall (n :: Natural) (x :: TK). KnownSTK x => AstRaw s ('TKR2 (1 + n) x) -> Int Source #

sshape :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKS2 sh x) -> ShS sh Source #

slength :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKS2 sh x) -> Int Source #

ssize :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKS2 sh x) -> Int Source #

swidth :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKS2 (n ': sh) x) -> Int Source #

xshape :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 sh x) -> IShX sh Source #

xlength :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 sh x) -> Int Source #

xsize :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 sh x) -> Int Source #

xwidth :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 (mn ': sh) x) -> Int Source #

tsize :: forall (y :: TK). SingletonTK y -> AstRaw s y -> Int Source #

tftk :: forall (y :: TK). SingletonTK y -> AstRaw s y -> FullShapeTK y Source #

tpair :: forall (x :: TK) (z :: TK). AstRaw s x -> AstRaw s z -> AstRaw s ('TKProduct x z) Source #

tproject1 :: forall (x :: TK) (z :: TK). AstRaw s ('TKProduct x z) -> AstRaw s x Source #

tproject2 :: forall (x :: TK) (z :: TK). AstRaw s ('TKProduct x z) -> AstRaw s z Source #

tcond :: forall (y :: TK). Boolean (BoolOf (AstRaw s)) => SingletonTK y -> BoolOf (AstRaw s) -> AstRaw s y -> AstRaw s y -> AstRaw s y Source #

trconcrete :: forall r (n :: Nat). GoodScalar r => Ranked n r -> AstRaw s (TKR n r) Source #

tsconcrete :: forall r (sh :: [Nat]). GoodScalar r => Shaped sh r -> AstRaw s (TKS sh r) Source #

txconcrete :: forall r (sh :: [Maybe Nat]). GoodScalar r => Mixed sh r -> AstRaw s (TKX sh r) Source #

tkconcrete :: GoodScalar r => r -> AstRaw s ('TKScalar r) Source #

tconcrete :: forall (y :: TK). FullShapeTK y -> Concrete y -> AstRaw s y Source #

trfromVector :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Vector (AstRaw s ('TKR2 n x)) -> AstRaw s ('TKR2 (1 + n) x) Source #

trfromVector0N :: forall (n :: Nat) (x :: TK). KnownSTK x => IShR n -> Vector (AstRaw s ('TKR2 0 x)) -> AstRaw s ('TKR2 n x) Source #

trunravelToList :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstRaw s ('TKR2 (1 + n) x) -> [AstRaw s ('TKR2 n x)] Source #

tsfromVector :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => Vector (AstRaw s ('TKS2 sh x)) -> AstRaw s ('TKS2 (n ': sh) x) Source #

tsfromVector0N :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => Vector (AstRaw s ('TKS2 ('[] :: [Nat]) x)) -> AstRaw s ('TKS2 sh x) Source #

tsunravelToList :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => AstRaw s ('TKS2 (n ': sh) x) -> [AstRaw s ('TKS2 sh x)] Source #

txfromVector :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => Vector (AstRaw s ('TKX2 sh x)) -> AstRaw s ('TKX2 ('Just n ': sh) x) Source #

txfromVector0N :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => IShX sh -> Vector (AstRaw s ('TKX2 ('[] :: [Maybe Nat]) x)) -> AstRaw s ('TKX2 sh x) Source #

txunravelToList :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => AstRaw s ('TKX2 ('Just n ': sh) x) -> [AstRaw s ('TKX2 sh x)] Source #

tfromVector :: forall (y :: TK) (k :: Nat). SNat k -> SingletonTK y -> Vector (AstRaw s y) -> AstRaw s (BuildTensorKind k y) Source #

tfromListR :: forall (y :: TK) (k :: Nat). SingletonTK y -> ListR k (AstRaw s y) -> AstRaw s (BuildTensorKind k y) Source #

trsum :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstRaw s ('TKR2 (1 + n) x) -> AstRaw s ('TKR2 n x) Source #

trsum0 :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstRaw s ('TKR2 n x) -> AstRaw s ('TKR2 0 x) Source #

trdot0 :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstRaw s (TKR n r) -> AstRaw s (TKR n r) -> AstRaw s (TKR 0 r) Source #

trdot1In :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstRaw s (TKR (1 + n) r) -> AstRaw s (TKR (1 + n) r) -> AstRaw s (TKR n r) Source #

trmatvecmul :: GoodScalar r => AstRaw s (TKR 2 r) -> AstRaw s (TKR 1 r) -> AstRaw s (TKR 1 r) Source #

trmatmul2 :: GoodScalar r => AstRaw s (TKR 2 r) -> AstRaw s (TKR 2 r) -> AstRaw s (TKR 2 r) Source #

trreplicate :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Int -> AstRaw s ('TKR2 n x) -> AstRaw s ('TKR2 (1 + n) x) Source #

trreplicate0N :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => IShR n -> AstRaw s ('TKR2 0 x) -> AstRaw s ('TKR2 n x) Source #

tssum :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => AstRaw s ('TKS2 (n ': sh) x) -> AstRaw s ('TKS2 sh x) Source #

tssum0 :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstRaw s ('TKS2 sh x) -> AstRaw s ('TKS2 ('[] :: [Nat]) x) Source #

tsdot0 :: forall (sh :: [Nat]) r. (KnownShS sh, GoodScalar r) => AstRaw s (TKS sh r) -> AstRaw s (TKS sh r) -> AstRaw s (TKS ('[] :: [Nat]) r) Source #

tsdot1In :: forall (sh :: [Nat]) r (n :: Nat). (KnownShS sh, GoodScalar r) => SNat n -> AstRaw s (TKS (sh ++ '[n]) r) -> AstRaw s (TKS (sh ++ '[n]) r) -> AstRaw s (TKS sh r) Source #

tsmatvecmul :: forall (m :: Nat) (n :: Nat) r. (KnownNat m, KnownNat n, GoodScalar r) => AstRaw s (TKS '[m, n] r) -> AstRaw s (TKS '[n] r) -> AstRaw s (TKS '[m] r) Source #

tsmatmul2 :: forall (m :: Nat) (n :: Nat) (p :: Nat) r. (KnownNat m, KnownNat n, KnownNat p, GoodScalar r) => AstRaw s (TKS '[m, n] r) -> AstRaw s (TKS '[n, p] r) -> AstRaw s (TKS '[m, p] r) Source #

tsreplicate :: forall (sh :: [Nat]) (k :: Nat) (x :: TK). KnownSTK x => SNat k -> ShS sh -> AstRaw s ('TKS2 sh x) -> AstRaw s ('TKS2 (k ': sh) x) Source #

tsreplicate0N :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => ShS sh -> AstRaw s ('TKS2 ('[] :: [Nat]) x) -> AstRaw s ('TKS2 sh x) Source #

txsum :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => AstRaw s ('TKX2 ('Just n ': sh) x) -> AstRaw s ('TKX2 sh x) Source #

txsum0 :: forall (sh :: [Maybe Nat]) (x :: TK). (KnownShX sh, KnownSTK x, ConvertTensor (AstRaw s)) => AstRaw s ('TKX2 sh x) -> AstRaw s ('TKX2 ('[] :: [Maybe Nat]) x) Source #

txdot0 :: forall (sh :: [Maybe Nat]) r. (KnownShX sh, GoodScalar r, ConvertTensor (AstRaw s)) => AstRaw s (TKX sh r) -> AstRaw s (TKX sh r) -> AstRaw s (TKX ('[] :: [Maybe Nat]) r) Source #

txdot1In :: forall (sh :: [Maybe Nat]) r (n :: Nat). (KnownShX sh, GoodScalar r) => SNat n -> AstRaw s (TKX (sh ++ '['Just n]) r) -> AstRaw s (TKX (sh ++ '['Just n]) r) -> AstRaw s (TKX sh r) Source #

txmatvecmul :: forall (mm :: Maybe Nat) (mn :: Maybe Nat) r. (GoodScalar r, ConvertTensor (AstRaw s)) => SMayNat Int SNat mm -> SMayNat Int SNat mn -> AstRaw s (TKX '[mm, mn] r) -> AstRaw s (TKX '[mn] r) -> AstRaw s (TKX '[mm] r) Source #

txmatmul2 :: forall (m :: Nat) (n :: Nat) (p :: Nat) r. (KnownNat m, KnownNat n, KnownNat p, GoodScalar r, ConvertTensor (AstRaw s)) => AstRaw s (TKX '['Just m, 'Just n] r) -> AstRaw s (TKX '['Just n, 'Just p] r) -> AstRaw s (TKX '['Just m, 'Just p] r) Source #

txreplicate :: forall (sh :: [Maybe Nat]) (k :: Nat) (x :: TK). KnownSTK x => SNat k -> StaticShX sh -> AstRaw s ('TKX2 sh x) -> AstRaw s ('TKX2 ('Just k ': sh) x) Source #

txreplicate0N :: forall (sh :: [Maybe Nat]) (x :: TK). (KnownShX sh, KnownSTK x) => IShX sh -> AstRaw s ('TKX2 ('[] :: [Maybe Nat]) x) -> AstRaw s ('TKX2 sh x) Source #

trindex :: forall (m :: Nat) (n :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownSTK x) => AstRaw s ('TKR2 (m + n) x) -> IxROf (AstRaw s) m -> AstRaw s ('TKR2 n x) Source #

trindex0 :: forall (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => AstRaw s ('TKR2 m x) -> IxROf (AstRaw s) m -> AstRaw s ('TKR2 0 x) Source #

troneHot :: forall (m :: Nat) (n :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownSTK x, BoolOf (PrimalOf (AstRaw s)) ~ BoolOf (AstRaw s), EqH (PrimalOf (AstRaw s)) ('TKScalar Int64)) => IShR m -> AstRaw s ('TKR2 n x) -> IxROf (AstRaw s) m -> AstRaw s ('TKR2 (m + n) x) Source #

trscatter :: forall (m :: Nat) (n :: Nat) (p :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownNat p, KnownSTK x) => IShR (p + n) -> AstRaw s ('TKR2 (m + n) x) -> (IxROf (AstRaw s) m -> IxROf (AstRaw s) p) -> AstRaw s ('TKR2 (p + n) x) Source #

trscatter1 :: forall (n :: Nat) (p :: Nat) (x :: TK). (KnownNat n, KnownNat p, KnownSTK x) => IShR (p + n) -> AstRaw s ('TKR2 (1 + n) x) -> (IntOf (AstRaw s) -> IxROf (AstRaw s) p) -> AstRaw s ('TKR2 (p + n) x) Source #

trgather :: forall (m :: Nat) (n :: Nat) (p :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownNat p, KnownSTK x) => IShR (m + n) -> AstRaw s ('TKR2 (p + n) x) -> (IxROf (AstRaw s) m -> IxROf (AstRaw s) p) -> AstRaw s ('TKR2 (m + n) x) Source #

trgather1 :: forall (n :: Nat) (p :: Nat) (x :: TK). (KnownNat n, KnownNat p, KnownSTK x) => Int -> AstRaw s ('TKR2 (p + n) x) -> (IntOf (AstRaw s) -> IxROf (AstRaw s) p) -> AstRaw s ('TKR2 (1 + n) x) Source #

tsindex :: forall (shm :: [Nat]) (shn :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownSTK x) => AstRaw s ('TKS2 (shm ++ shn) x) -> IxSOf (AstRaw s) shm -> AstRaw s ('TKS2 shn x) Source #

tsindex0 :: forall (sh1 :: [Nat]) (x :: TK). (KnownShS sh1, KnownSTK x) => AstRaw s ('TKS2 sh1 x) -> IxSOf (AstRaw s) sh1 -> AstRaw s ('TKS2 ('[] :: [Nat]) x) Source #

tsoneHot :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh1, KnownShS sh2, KnownSTK x, BoolOf (PrimalOf (AstRaw s)) ~ BoolOf (AstRaw s), EqH (PrimalOf (AstRaw s)) ('TKScalar Int64)) => AstRaw s ('TKS2 sh2 x) -> IxSOf (AstRaw s) sh1 -> AstRaw s ('TKS2 (sh1 ++ sh2) x) Source #

tsscatter :: forall (shm :: [Nat]) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownShS shp, KnownSTK x) => AstRaw s ('TKS2 (shm ++ shn) x) -> (IxSOf (AstRaw s) shm -> IxSOf (AstRaw s) shp) -> AstRaw s ('TKS2 (shp ++ shn) x) Source #

tsscatter1 :: forall (n2 :: Nat) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownNat n2, KnownShS shn, KnownShS shp, KnownSTK x) => AstRaw s ('TKS2 (n2 ': shn) x) -> (IntOf (AstRaw s) -> IxSOf (AstRaw s) shp) -> AstRaw s ('TKS2 (shp ++ shn) x) Source #

tsgather :: forall (shm :: [Nat]) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownShS shp, KnownSTK x) => AstRaw s ('TKS2 (shp ++ shn) x) -> (IxSOf (AstRaw s) shm -> IxSOf (AstRaw s) shp) -> AstRaw s ('TKS2 (shm ++ shn) x) Source #

tsgather1 :: forall (n2 :: Nat) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownNat n2, KnownShS shn, KnownShS shp, KnownSTK x) => AstRaw s ('TKS2 (shp ++ shn) x) -> (IntOf (AstRaw s) -> IxSOf (AstRaw s) shp) -> AstRaw s ('TKS2 (n2 ': shn) x) Source #

txindex :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x) => AstRaw s ('TKX2 (sh1 ++ sh2) x) -> IxXOf (AstRaw s) sh1 -> AstRaw s ('TKX2 sh2 x) Source #

txindex0 :: forall (sh1 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownSTK x) => AstRaw s ('TKX2 sh1 x) -> IxXOf (AstRaw s) sh1 -> AstRaw s ('TKX2 ('[] :: [Maybe Nat]) x) Source #

txoneHot :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x, BoolOf (PrimalOf (AstRaw s)) ~ BoolOf (AstRaw s), EqH (PrimalOf (AstRaw s)) ('TKScalar Int64), ConvertTensor (AstRaw s)) => IShX sh1 -> AstRaw s ('TKX2 sh2 x) -> IxXOf (AstRaw s) sh1 -> AstRaw s ('TKX2 (sh1 ++ sh2) x) Source #

txscatter :: forall (shm :: [Maybe Nat]) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownShX shm, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shp ++ shn) -> AstRaw s ('TKX2 (shm ++ shn) x) -> (IxXOf (AstRaw s) shm -> IxXOf (AstRaw s) shp) -> AstRaw s ('TKX2 (shp ++ shn) x) Source #

txscatter1 :: forall (n2 :: Nat) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownNat n2, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shp ++ shn) -> AstRaw s ('TKX2 ('Just n2 ': shn) x) -> (IntOf (AstRaw s) -> IxXOf (AstRaw s) shp) -> AstRaw s ('TKX2 (shp ++ shn) x) Source #

txgather :: forall (shm :: [Maybe Nat]) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownShX shm, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shm ++ shn) -> AstRaw s ('TKX2 (shp ++ shn) x) -> (IxXOf (AstRaw s) shm -> IxXOf (AstRaw s) shp) -> AstRaw s ('TKX2 (shm ++ shn) x) Source #

txgather1 :: forall (n2 :: Nat) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownNat n2, KnownShX shn, KnownShX shp, KnownSTK x) => SNat n2 -> AstRaw s ('TKX2 (shp ++ shn) x) -> (IntOf (AstRaw s) -> IxXOf (AstRaw s) shp) -> AstRaw s ('TKX2 ('Just n2 ': shn) x) Source #

trfloor :: forall r r2 (n :: Nat). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstRaw s (TKR n r) -> AstRaw s (TKR n r2) Source #

trfromIntegral :: forall r1 r2 (n :: Nat). (GoodScalar r1, Integral r1, GoodScalar r2) => AstRaw s (TKR n r1) -> AstRaw s (TKR n r2) Source #

trcast :: forall r1 r2 (n :: Nat). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstRaw s (TKR n r1) -> AstRaw s (TKR n r2) Source #

trminIndex :: forall (n :: Natural) r r2. (GoodScalar r, GoodScalar r2) => AstRaw s (TKR (1 + n) r) -> AstRaw s (TKR n r2) Source #

trmaxIndex :: forall (n :: Natural) r r2. (GoodScalar r, GoodScalar r2) => AstRaw s (TKR (1 + n) r) -> AstRaw s (TKR n r2) Source #

triota :: GoodScalar r => Int -> AstRaw s (TKR 1 r) Source #

tsfloor :: forall r r2 (sh :: [Nat]). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstRaw s (TKS sh r) -> AstRaw s (TKS sh r2) Source #

tsfromIntegral :: forall r1 r2 (sh :: [Nat]). (GoodScalar r1, Integral r1, GoodScalar r2) => AstRaw s (TKS sh r1) -> AstRaw s (TKS sh r2) Source #

tscast :: forall r1 r2 (sh :: [Nat]). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstRaw s (TKS sh r1) -> AstRaw s (TKS sh r2) Source #

tsminIndex :: forall (n :: Nat) (sh :: [Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstRaw s (TKS (n ': sh) r) -> AstRaw s (TKS (Init (n ': sh)) r2) Source #

tsmaxIndex :: forall (n :: Nat) (sh :: [Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstRaw s (TKS (n ': sh) r) -> AstRaw s (TKS (Init (n ': sh)) r2) Source #

tsiota :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstRaw s (TKS '[n] r) Source #

txfloor :: forall r r2 (sh :: [Maybe Nat]). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstRaw s (TKX sh r) -> AstRaw s (TKX sh r2) Source #

txfromIntegral :: forall r1 r2 (sh :: [Maybe Nat]). (GoodScalar r1, Integral r1, GoodScalar r2) => AstRaw s (TKX sh r1) -> AstRaw s (TKX sh r2) Source #

txcast :: forall r1 r2 (sh :: [Maybe Nat]). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstRaw s (TKX sh r1) -> AstRaw s (TKX sh r2) Source #

txminIndex :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstRaw s (TKX (mn ': sh) r) -> AstRaw s (TKX (Init (mn ': sh)) r2) Source #

txmaxIndex :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstRaw s (TKX (mn ': sh) r) -> AstRaw s (TKX (Init (mn ': sh)) r2) Source #

txiota :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstRaw s (TKX '['Just n] r) Source #

tkfloor :: (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstRaw s ('TKScalar r) -> AstRaw s ('TKScalar r2) Source #

tkfromIntegral :: (GoodScalar r1, Integral r1, GoodScalar r2) => AstRaw s ('TKScalar r1) -> AstRaw s ('TKScalar r2) Source #

tkcast :: (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstRaw s ('TKScalar r1) -> AstRaw s ('TKScalar r2) Source #

trappend :: forall (n :: Natural) (x :: TK). KnownSTK x => AstRaw s ('TKR2 (1 + n) x) -> AstRaw s ('TKR2 (1 + n) x) -> AstRaw s ('TKR2 (1 + n) x) Source #

trslice :: forall (n :: Natural) (x :: TK). KnownSTK x => Int -> Int -> AstRaw s ('TKR2 (1 + n) x) -> AstRaw s ('TKR2 (1 + n) x) Source #

trreverse :: forall (n :: Natural) (x :: TK). KnownSTK x => AstRaw s ('TKR2 (1 + n) x) -> AstRaw s ('TKR2 (1 + n) x) Source #

trtranspose :: forall (n :: Nat) (x :: TK). KnownSTK x => PermR -> AstRaw s ('TKR2 n x) -> AstRaw s ('TKR2 n x) Source #

trreshape :: forall (n :: Nat) (m :: Nat) (x :: TK). KnownSTK x => IShR m -> AstRaw s ('TKR2 n x) -> AstRaw s ('TKR2 m x) Source #

tsappend :: forall (m :: Nat) (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKS2 (m ': sh) x) -> AstRaw s ('TKS2 (n ': sh) x) -> AstRaw s ('TKS2 ((m + n) ': sh) x) Source #

tsslice :: forall (i :: Nat) (n :: Nat) (k :: Nat) (sh :: [Natural]) (x :: TK). KnownSTK x => SNat i -> SNat n -> SNat k -> AstRaw s ('TKS2 (((i + n) + k) ': sh) x) -> AstRaw s ('TKS2 (n ': sh) x) Source #

tsreverse :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKS2 (n ': sh) x) -> AstRaw s ('TKS2 (n ': sh) x) Source #

tstranspose :: forall (perm :: [Natural]) (sh :: [Nat]) (x :: TK). (IsPermutation perm, Rank perm <= Rank sh, KnownSTK x) => Perm perm -> AstRaw s ('TKS2 sh x) -> AstRaw s ('TKS2 (PermutePrefix perm sh) x) Source #

tsreshape :: forall (sh :: [Natural]) (sh2 :: [Natural]) (x :: TK). (Product sh ~ Product sh2, KnownSTK x) => ShS sh2 -> AstRaw s ('TKS2 sh x) -> AstRaw s ('TKS2 sh2 x) Source #

txappend :: forall (m :: Nat) (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 ('Just m ': sh) x) -> AstRaw s ('TKX2 ('Just n ': sh) x) -> AstRaw s ('TKX2 ('Just (m + n) ': sh) x) Source #

txslice :: forall (i :: Nat) (n :: Nat) (k :: Nat) (sh :: [Maybe Natural]) (x :: TK). KnownSTK x => SNat i -> SNat n -> SNat k -> AstRaw s ('TKX2 ('Just ((i + n) + k) ': sh) x) -> AstRaw s ('TKX2 ('Just n ': sh) x) Source #

txreverse :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstRaw s ('TKX2 (mn ': sh) x) -> AstRaw s ('TKX2 (mn ': sh) x) Source #

txtranspose :: forall (perm :: [Natural]) (sh :: [Maybe Nat]) (x :: TK). (IsPermutation perm, Rank perm <= Rank sh, KnownSTK x) => Perm perm -> AstRaw s ('TKX2 sh x) -> AstRaw s ('TKX2 (PermutePrefix perm sh) x) Source #

txreshape :: forall (sh :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). KnownSTK x => IShX sh2 -> AstRaw s ('TKX2 sh x) -> AstRaw s ('TKX2 sh2 x) Source #

trbuild1 :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Int -> (IntOf (AstRaw s) -> AstRaw s ('TKR2 n x)) -> AstRaw s ('TKR2 (1 + n) x) Source #

trmap0N :: forall (n :: Nat) (x :: TK) (x1 :: TK). (KnownNat n, KnownSTK x, KnownSTK x1) => (AstRaw s ('TKR2 0 x1) -> AstRaw s ('TKR2 0 x)) -> AstRaw s ('TKR2 n x1) -> AstRaw s ('TKR2 n x) Source #

trzipWith0N :: forall (n :: Nat) (x :: TK) (x1 :: TK) (x2 :: TK). (KnownNat n, KnownSTK x, KnownSTK x1, KnownSTK x2) => (AstRaw s ('TKR2 0 x1) -> AstRaw s ('TKR2 0 x2) -> AstRaw s ('TKR2 0 x)) -> AstRaw s ('TKR2 n x1) -> AstRaw s ('TKR2 n x2) -> AstRaw s ('TKR2 n x) Source #

tsbuild1 :: forall (k :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat k, KnownShS sh, KnownSTK x) => (IntOf (AstRaw s) -> AstRaw s ('TKS2 sh x)) -> AstRaw s ('TKS2 (k ': sh) x) Source #

tsmap0N :: forall (sh :: [Nat]) (x :: TK) (x1 :: TK). (KnownShS sh, KnownSTK x, KnownSTK x1) => (AstRaw s ('TKS2 ('[] :: [Nat]) x1) -> AstRaw s ('TKS2 ('[] :: [Nat]) x)) -> AstRaw s ('TKS2 sh x1) -> AstRaw s ('TKS2 sh x) Source #

tszipWith0N :: forall (sh :: [Nat]) (x :: TK) (x1 :: TK) (x2 :: TK). (KnownShS sh, KnownSTK x, KnownSTK x1, KnownSTK x2) => (AstRaw s ('TKS2 ('[] :: [Nat]) x1) -> AstRaw s ('TKS2 ('[] :: [Nat]) x2) -> AstRaw s ('TKS2 ('[] :: [Nat]) x)) -> AstRaw s ('TKS2 sh x1) -> AstRaw s ('TKS2 sh x2) -> AstRaw s ('TKS2 sh x) Source #

txbuild1 :: forall (k :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat k, KnownShX sh, KnownSTK x) => (IntOf (AstRaw s) -> AstRaw s ('TKX2 sh x)) -> AstRaw s ('TKX2 ('Just k ': sh) x) Source #

tbuild1 :: forall (y :: TK) (k :: Nat). ConvertTensor (AstRaw s) => SNat k -> SingletonTK y -> (IntOf (AstRaw s) -> AstRaw s y) -> AstRaw s (BuildTensorKind k y) Source #

tmapAccumRDer :: forall (accy :: TK) (by :: TK) (ey :: TK) (k :: Nat). Proxy (AstRaw s) -> SNat k -> FullShapeTK accy -> FullShapeTK by -> FullShapeTK ey -> HFunOf (AstRaw s) ('TKProduct accy ey) ('TKProduct accy by) -> HFunOf (AstRaw s) ('TKProduct (ADTensorKind ('TKProduct accy ey)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy by)) -> HFunOf (AstRaw s) ('TKProduct (ADTensorKind ('TKProduct accy by)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy ey)) -> AstRaw s accy -> AstRaw s (BuildTensorKind k ey) -> AstRaw s ('TKProduct accy (BuildTensorKind k by)) Source #

tmapAccumLDer :: forall (accy :: TK) (by :: TK) (ey :: TK) (k :: Nat). Proxy (AstRaw s) -> SNat k -> FullShapeTK accy -> FullShapeTK by -> FullShapeTK ey -> HFunOf (AstRaw s) ('TKProduct accy ey) ('TKProduct accy by) -> HFunOf (AstRaw s) ('TKProduct (ADTensorKind ('TKProduct accy ey)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy by)) -> HFunOf (AstRaw s) ('TKProduct (ADTensorKind ('TKProduct accy by)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy ey)) -> AstRaw s accy -> AstRaw s (BuildTensorKind k ey) -> AstRaw s ('TKProduct accy (BuildTensorKind k by)) Source #

tApply :: forall (x :: TK) (z :: TK). HFunOf (AstRaw s) x z -> AstRaw s x -> AstRaw s z Source #

tlambda :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstRaw s) x z Source #

tgrad :: forall (x :: TK) r. FullShapeTK x -> HFun x ('TKScalar r) -> HFunOf (AstRaw s) x (ADTensorKind x) Source #

tvjp :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstRaw s) ('TKProduct (ADTensorKind z) x) (ADTensorKind x) Source #

tjvp :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstRaw s) ('TKProduct (ADTensorKind x) x) (ADTensorKind z) Source #

tprimalPart :: forall (y :: TK). AstRaw s y -> PrimalOf (AstRaw s) y Source #

tdualPart :: forall (y :: TK). SingletonTK y -> AstRaw s y -> DualOf (AstRaw s) y Source #

tfromPrimal :: forall (y :: TK). SingletonTK y -> PrimalOf (AstRaw s) y -> AstRaw s y Source #

tfromDual :: forall (y :: TK). DualOf (AstRaw s) y -> AstRaw s y Source #

tScale :: forall (y :: TK). (Num (AstRaw s y), Num (PrimalOf (AstRaw s) y)) => SingletonTK y -> PrimalOf (AstRaw s) y -> DualOf (AstRaw s) y -> DualOf (AstRaw s) y Source #

tsum :: forall (z :: TK) (k :: Nat). ConvertTensor (AstRaw s) => SNat k -> SingletonTK z -> AstRaw s (BuildTensorKind k z) -> AstRaw s z Source #

treplicate :: forall (z :: TK) (k :: Nat). ConvertTensor (AstRaw s) => SNat k -> SingletonTK z -> AstRaw s z -> AstRaw s (BuildTensorKind k z) Source #

tindexBuild :: forall (z :: TK) (k :: Nat). ConvertTensor (AstRaw s) => SNat k -> SingletonTK z -> AstRaw s (BuildTensorKind k z) -> IntOf (AstRaw s) -> AstRaw s z Source #

treplTarget :: forall (y :: TK). (forall r. GoodScalar r => r) -> FullShapeTK y -> AstRaw s y Source #

tdefTarget :: forall (y :: TK). FullShapeTK y -> AstRaw s y Source #

taddTarget :: forall (y :: TK). SingletonTK y -> AstRaw s y -> AstRaw s y -> AstRaw s y Source #

tmultTarget :: forall (y :: TK). SingletonTK y -> AstRaw s y -> AstRaw s y -> AstRaw s y Source #

tsum0Target :: forall (y :: TK). FullShapeTK y -> AstRaw s y -> AstRaw s ('TKScalar Double) Source #

tdot0Target :: forall (y :: TK). FullShapeTK y -> AstRaw s y -> AstRaw s y -> AstRaw s ('TKScalar Double) Source #

xmcast :: forall (x :: TK) (sh :: [Maybe Nat]) (sh2 :: [Maybe Nat]). (KnownSTK x, KnownShX sh, Rank sh ~ Rank sh2, ConvertTensor (AstRaw s)) => StaticShX sh2 -> AstRaw s ('TKX2 sh x) -> AstRaw s ('TKX2 sh2 x) Source #

AstSpan s => ShareTensor (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

tshare :: forall (y :: TK). AstRaw s y -> AstRaw s y Source #

tunpair :: forall (x :: TK) (z :: TK). AstRaw s ('TKProduct x z) -> (AstRaw s x, AstRaw s z) Source #

tunravelToListShare :: forall (y :: TK) (k :: Nat). (BaseTensor (AstRaw s), ConvertTensor (AstRaw s)) => SNat k -> SingletonTK y -> AstRaw s (BuildTensorKind k y) -> [AstRaw s y] Source #

EqH (AstTensor 'AstMethodShare s) y => EqH (AstRaw s) y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

(==.) :: AstRaw s y -> AstRaw s y -> BoolOf (AstRaw s) Source #

(/=.) :: AstRaw s y -> AstRaw s y -> BoolOf (AstRaw s) Source #

OrdH (AstTensor 'AstMethodShare s) y => OrdH (AstRaw s) y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

(<.) :: AstRaw s y -> AstRaw s y -> BoolOf (AstRaw s) Source #

(<=.) :: AstRaw s y -> AstRaw s y -> BoolOf (AstRaw s) Source #

(>.) :: AstRaw s y -> AstRaw s y -> BoolOf (AstRaw s) Source #

(>=.) :: AstRaw s y -> AstRaw s y -> BoolOf (AstRaw s) Source #

Floating (AstTensor 'AstMethodShare s y) => Floating (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

pi :: AstRaw s y #

exp :: AstRaw s y -> AstRaw s y #

log :: AstRaw s y -> AstRaw s y #

sqrt :: AstRaw s y -> AstRaw s y #

(**) :: AstRaw s y -> AstRaw s y -> AstRaw s y #

logBase :: AstRaw s y -> AstRaw s y -> AstRaw s y #

sin :: AstRaw s y -> AstRaw s y #

cos :: AstRaw s y -> AstRaw s y #

tan :: AstRaw s y -> AstRaw s y #

asin :: AstRaw s y -> AstRaw s y #

acos :: AstRaw s y -> AstRaw s y #

atan :: AstRaw s y -> AstRaw s y #

sinh :: AstRaw s y -> AstRaw s y #

cosh :: AstRaw s y -> AstRaw s y #

tanh :: AstRaw s y -> AstRaw s y #

asinh :: AstRaw s y -> AstRaw s y #

acosh :: AstRaw s y -> AstRaw s y #

atanh :: AstRaw s y -> AstRaw s y #

log1p :: AstRaw s y -> AstRaw s y #

expm1 :: AstRaw s y -> AstRaw s y #

log1pexp :: AstRaw s y -> AstRaw s y #

log1mexp :: AstRaw s y -> AstRaw s y #

Num (AstTensor 'AstMethodShare s y) => Num (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

(+) :: AstRaw s y -> AstRaw s y -> AstRaw s y #

(-) :: AstRaw s y -> AstRaw s y -> AstRaw s y #

(*) :: AstRaw s y -> AstRaw s y -> AstRaw s y #

negate :: AstRaw s y -> AstRaw s y #

abs :: AstRaw s y -> AstRaw s y #

signum :: AstRaw s y -> AstRaw s y #

fromInteger :: Integer -> AstRaw s y #

Fractional (AstTensor 'AstMethodShare s y) => Fractional (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

(/) :: AstRaw s y -> AstRaw s y -> AstRaw s y #

recip :: AstRaw s y -> AstRaw s y #

fromRational :: Rational -> AstRaw s y #

Show (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

showsPrec :: Int -> AstRaw s y -> ShowS #

show :: AstRaw s y -> String #

showList :: [AstRaw s y] -> ShowS #

Eq (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

(==) :: AstRaw s y -> AstRaw s y -> Bool #

(/=) :: AstRaw s y -> AstRaw s y -> Bool #

Ord (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

compare :: AstRaw s y -> AstRaw s y -> Ordering #

(<) :: AstRaw s y -> AstRaw s y -> Bool #

(<=) :: AstRaw s y -> AstRaw s y -> Bool #

(>) :: AstRaw s y -> AstRaw s y -> Bool #

(>=) :: AstRaw s y -> AstRaw s y -> Bool #

max :: AstRaw s y -> AstRaw s y -> AstRaw s y #

min :: AstRaw s y -> AstRaw s y -> AstRaw s y #

IntegralH (AstTensor 'AstMethodShare s y) => IntegralH (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

quotH :: AstRaw s y -> AstRaw s y -> AstRaw s y Source #

remH :: AstRaw s y -> AstRaw s y -> AstRaw s y Source #

RealFloatH (AstTensor 'AstMethodShare s y) => RealFloatH (AstRaw s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

atan2H :: AstRaw s y -> AstRaw s y -> AstRaw s y Source #

type BoolOf (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type DualOf (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type PrimalOf (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type ShareOf (AstRaw s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type ShareOf (AstRaw s) = AstRaw s
type HFunOf (AstRaw s) x y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type HFunOf (AstRaw s) x y = AstHFun s s x y

newtype AstNoVectorize (s :: AstSpanType) (y :: TK) Source #

An AST variant for testing that doesn't vectorize terms, but still builds them using simplifying smart constructors.

Instances

Instances details
AstSpan s => ConvertTensor (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

tconvert :: forall (a :: TK) (b :: TK). TKConversion a b -> SingletonTK a -> AstNoVectorize s a -> AstNoVectorize s b Source #

kfromR :: GoodScalar r => AstNoVectorize s (TKR 0 r) -> AstNoVectorize s ('TKScalar r) Source #

kfromS :: GoodScalar r => AstNoVectorize s (TKS ('[] :: [Nat]) r) -> AstNoVectorize s ('TKScalar r) Source #

kfromX :: GoodScalar r => AstNoVectorize s (TKX ('[] :: [Maybe Nat]) r) -> AstNoVectorize s ('TKScalar r) Source #

rfromK :: GoodScalar r => AstNoVectorize s ('TKScalar r) -> AstNoVectorize s (TKR 0 r) Source #

rfromS :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstNoVectorize s ('TKS2 sh x) -> AstNoVectorize s ('TKR2 (Rank sh) x) Source #

rfromX :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 sh x) -> AstNoVectorize s ('TKR2 (Rank sh) x) Source #

sfromK :: GoodScalar r => AstNoVectorize s ('TKScalar r) -> AstNoVectorize s (TKS ('[] :: [Nat]) r) Source #

sfromR :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstNoVectorize s ('TKR2 (Rank sh) x) -> AstNoVectorize s ('TKS2 sh x) Source #

sfromX :: forall (sh :: [Nat]) (sh' :: [Maybe Nat]) (x :: TK). (KnownShS sh, Rank sh ~ Rank sh', KnownSTK x) => AstNoVectorize s ('TKX2 sh' x) -> AstNoVectorize s ('TKS2 sh x) Source #

xfromK :: GoodScalar r => AstNoVectorize s ('TKScalar r) -> AstNoVectorize s (TKX ('[] :: [Maybe Nat]) r) Source #

xfromR :: forall (sh' :: [Maybe Nat]) (x :: TK). (KnownShX sh', KnownSTK x) => AstNoVectorize s ('TKR2 (Rank sh') x) -> AstNoVectorize s ('TKX2 sh' x) Source #

xfromS :: forall (sh :: [Nat]) (sh' :: [Maybe Nat]) (x :: TK). (KnownShS sh, KnownShX sh', Rank sh ~ Rank sh', KnownSTK x) => AstNoVectorize s ('TKS2 sh x) -> AstNoVectorize s ('TKX2 sh' x) Source #

rzip :: forall (y :: TK) (z :: TK) (n :: Nat). (KnownSTK y, KnownSTK z) => AstNoVectorize s ('TKProduct ('TKR2 n y) ('TKR2 n z)) -> AstNoVectorize s ('TKR2 n ('TKProduct y z)) Source #

runzip :: forall (y :: TK) (z :: TK) (n :: Nat). AstNoVectorize s ('TKR2 n ('TKProduct y z)) -> AstNoVectorize s ('TKProduct ('TKR2 n y) ('TKR2 n z)) Source #

szip :: forall (y :: TK) (z :: TK) (sh :: [Nat]). (KnownSTK y, KnownSTK z) => AstNoVectorize s ('TKProduct ('TKS2 sh y) ('TKS2 sh z)) -> AstNoVectorize s ('TKS2 sh ('TKProduct y z)) Source #

sunzip :: forall (y :: TK) (z :: TK) (sh :: [Nat]). AstNoVectorize s ('TKS2 sh ('TKProduct y z)) -> AstNoVectorize s ('TKProduct ('TKS2 sh y) ('TKS2 sh z)) Source #

xzip :: forall (y :: TK) (z :: TK) (sh :: [Maybe Nat]). (KnownSTK y, KnownSTK z) => AstNoVectorize s ('TKProduct ('TKX2 sh y) ('TKX2 sh z)) -> AstNoVectorize s ('TKX2 sh ('TKProduct y z)) Source #

xunzip :: forall (y :: TK) (z :: TK) (sh :: [Maybe Nat]). AstNoVectorize s ('TKX2 sh ('TKProduct y z)) -> AstNoVectorize s ('TKProduct ('TKX2 sh y) ('TKX2 sh z)) Source #

rnest :: forall (n :: Nat) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => SNat n -> AstNoVectorize s ('TKR2 (n + m) x) -> AstNoVectorize s ('TKR2 n ('TKR2 m x)) Source #

rnestS :: forall (n :: Nat) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => SNat n -> AstNoVectorize s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ MapJust sh2) x) -> AstNoVectorize s ('TKR2 n ('TKS2 sh2 x)) Source #

rnestX :: forall (n :: Nat) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => SNat n -> AstNoVectorize s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ sh2) x) -> AstNoVectorize s ('TKR2 n ('TKX2 sh2 x)) Source #

snestR :: forall (sh1 :: [Nat]) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => ShS sh1 -> AstNoVectorize s ('TKX2 (MapJust sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) -> AstNoVectorize s ('TKS2 sh1 ('TKR2 m x)) Source #

snest :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => ShS sh1 -> AstNoVectorize s ('TKS2 (sh1 ++ sh2) x) -> AstNoVectorize s ('TKS2 sh1 ('TKS2 sh2 x)) Source #

snestX :: forall (sh1 :: [Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => ShS sh1 -> AstNoVectorize s ('TKX2 (MapJust sh1 ++ sh2) x) -> AstNoVectorize s ('TKS2 sh1 ('TKX2 sh2 x)) Source #

xnestR :: forall (sh1 :: [Maybe Nat]) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => StaticShX sh1 -> AstNoVectorize s ('TKX2 (sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) -> AstNoVectorize s ('TKX2 sh1 ('TKR2 m x)) Source #

xnestS :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => StaticShX sh1 -> AstNoVectorize s ('TKX2 (sh1 ++ MapJust sh2) x) -> AstNoVectorize s ('TKX2 sh1 ('TKS2 sh2 x)) Source #

xnest :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => StaticShX sh1 -> AstNoVectorize s ('TKX2 (sh1 ++ sh2) x) -> AstNoVectorize s ('TKX2 sh1 ('TKX2 sh2 x)) Source #

runNest :: forall (n :: Nat) (m :: Nat) (x :: TK). (KnownNat n, KnownNat m, KnownSTK x) => AstNoVectorize s ('TKR2 n ('TKR2 m x)) -> AstNoVectorize s ('TKR2 (n + m) x) Source #

runNestS :: forall (n :: Nat) (sh2 :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh2, KnownSTK x) => AstNoVectorize s ('TKR2 n ('TKS2 sh2 x)) -> AstNoVectorize s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ MapJust sh2) x) Source #

runNestX :: forall (n :: Nat) (sh2 :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh2, KnownSTK x) => AstNoVectorize s ('TKR2 n ('TKX2 sh2 x)) -> AstNoVectorize s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ sh2) x) Source #

sunNestR :: forall (sh1 :: [Nat]) (m :: Nat) (x :: TK). (KnownShS sh1, KnownNat m, KnownSTK x) => AstNoVectorize s ('TKS2 sh1 ('TKR2 m x)) -> AstNoVectorize s ('TKX2 (MapJust sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) Source #

sunNest :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh1, KnownShS sh2, KnownSTK x) => AstNoVectorize s ('TKS2 sh1 ('TKS2 sh2 x)) -> AstNoVectorize s ('TKS2 (sh1 ++ sh2) x) Source #

sunNestX :: forall (sh1 :: [Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShS sh1, KnownShX sh2, KnownSTK x) => AstNoVectorize s ('TKS2 sh1 ('TKX2 sh2 x)) -> AstNoVectorize s ('TKX2 (MapJust sh1 ++ sh2) x) Source #

xunNestR :: forall (sh1 :: [Maybe Nat]) (m :: Nat) (x :: TK). (KnownShX sh1, KnownNat m, KnownSTK x) => AstNoVectorize s ('TKX2 sh1 ('TKR2 m x)) -> AstNoVectorize s ('TKX2 (sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) Source #

xunNestS :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShX sh1, KnownShS sh2, KnownSTK x) => AstNoVectorize s ('TKX2 sh1 ('TKS2 sh2 x)) -> AstNoVectorize s ('TKX2 (sh1 ++ MapJust sh2) x) Source #

xunNest :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x) => AstNoVectorize s ('TKX2 sh1 ('TKX2 sh2 x)) -> AstNoVectorize s ('TKX2 (sh1 ++ sh2) x) Source #

tpairConv :: forall (x :: TK) (z :: TK). AstNoVectorize s x -> AstNoVectorize s z -> AstNoVectorize s ('TKProduct x z) Source #

tunpairConv :: forall (x :: TK) (z :: TK). AstNoVectorize s ('TKProduct x z) -> (AstNoVectorize s x, AstNoVectorize s z) Source #

AstSpan s => BaseTensor (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

rshape :: forall (n :: Nat) (x :: TK). KnownSTK x => AstNoVectorize s ('TKR2 n x) -> IShR n Source #

rlength :: forall (n :: Nat) (x :: TK). KnownSTK x => AstNoVectorize s ('TKR2 n x) -> Int Source #

rsize :: forall (n :: Nat) (x :: TK). KnownSTK x => AstNoVectorize s ('TKR2 n x) -> Int Source #

rwidth :: forall (n :: Natural) (x :: TK). KnownSTK x => AstNoVectorize s ('TKR2 (1 + n) x) -> Int Source #

sshape :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKS2 sh x) -> ShS sh Source #

slength :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKS2 sh x) -> Int Source #

ssize :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKS2 sh x) -> Int Source #

swidth :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKS2 (n ': sh) x) -> Int Source #

xshape :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 sh x) -> IShX sh Source #

xlength :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 sh x) -> Int Source #

xsize :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 sh x) -> Int Source #

xwidth :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 (mn ': sh) x) -> Int Source #

tsize :: forall (y :: TK). SingletonTK y -> AstNoVectorize s y -> Int Source #

tftk :: forall (y :: TK). SingletonTK y -> AstNoVectorize s y -> FullShapeTK y Source #

tpair :: forall (x :: TK) (z :: TK). AstNoVectorize s x -> AstNoVectorize s z -> AstNoVectorize s ('TKProduct x z) Source #

tproject1 :: forall (x :: TK) (z :: TK). AstNoVectorize s ('TKProduct x z) -> AstNoVectorize s x Source #

tproject2 :: forall (x :: TK) (z :: TK). AstNoVectorize s ('TKProduct x z) -> AstNoVectorize s z Source #

tcond :: forall (y :: TK). Boolean (BoolOf (AstNoVectorize s)) => SingletonTK y -> BoolOf (AstNoVectorize s) -> AstNoVectorize s y -> AstNoVectorize s y -> AstNoVectorize s y Source #

trconcrete :: forall r (n :: Nat). GoodScalar r => Ranked n r -> AstNoVectorize s (TKR n r) Source #

tsconcrete :: forall r (sh :: [Nat]). GoodScalar r => Shaped sh r -> AstNoVectorize s (TKS sh r) Source #

txconcrete :: forall r (sh :: [Maybe Nat]). GoodScalar r => Mixed sh r -> AstNoVectorize s (TKX sh r) Source #

tkconcrete :: GoodScalar r => r -> AstNoVectorize s ('TKScalar r) Source #

tconcrete :: forall (y :: TK). FullShapeTK y -> Concrete y -> AstNoVectorize s y Source #

trfromVector :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Vector (AstNoVectorize s ('TKR2 n x)) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

trfromVector0N :: forall (n :: Nat) (x :: TK). KnownSTK x => IShR n -> Vector (AstNoVectorize s ('TKR2 0 x)) -> AstNoVectorize s ('TKR2 n x) Source #

trunravelToList :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstNoVectorize s ('TKR2 (1 + n) x) -> [AstNoVectorize s ('TKR2 n x)] Source #

tsfromVector :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => Vector (AstNoVectorize s ('TKS2 sh x)) -> AstNoVectorize s ('TKS2 (n ': sh) x) Source #

tsfromVector0N :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => Vector (AstNoVectorize s ('TKS2 ('[] :: [Nat]) x)) -> AstNoVectorize s ('TKS2 sh x) Source #

tsunravelToList :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => AstNoVectorize s ('TKS2 (n ': sh) x) -> [AstNoVectorize s ('TKS2 sh x)] Source #

txfromVector :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => Vector (AstNoVectorize s ('TKX2 sh x)) -> AstNoVectorize s ('TKX2 ('Just n ': sh) x) Source #

txfromVector0N :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => IShX sh -> Vector (AstNoVectorize s ('TKX2 ('[] :: [Maybe Nat]) x)) -> AstNoVectorize s ('TKX2 sh x) Source #

txunravelToList :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => AstNoVectorize s ('TKX2 ('Just n ': sh) x) -> [AstNoVectorize s ('TKX2 sh x)] Source #

tfromVector :: forall (y :: TK) (k :: Nat). SNat k -> SingletonTK y -> Vector (AstNoVectorize s y) -> AstNoVectorize s (BuildTensorKind k y) Source #

tfromListR :: forall (y :: TK) (k :: Nat). SingletonTK y -> ListR k (AstNoVectorize s y) -> AstNoVectorize s (BuildTensorKind k y) Source #

trsum :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstNoVectorize s ('TKR2 (1 + n) x) -> AstNoVectorize s ('TKR2 n x) Source #

trsum0 :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstNoVectorize s ('TKR2 n x) -> AstNoVectorize s ('TKR2 0 x) Source #

trdot0 :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoVectorize s (TKR n r) -> AstNoVectorize s (TKR n r) -> AstNoVectorize s (TKR 0 r) Source #

trdot1In :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoVectorize s (TKR (1 + n) r) -> AstNoVectorize s (TKR (1 + n) r) -> AstNoVectorize s (TKR n r) Source #

trmatvecmul :: GoodScalar r => AstNoVectorize s (TKR 2 r) -> AstNoVectorize s (TKR 1 r) -> AstNoVectorize s (TKR 1 r) Source #

trmatmul2 :: GoodScalar r => AstNoVectorize s (TKR 2 r) -> AstNoVectorize s (TKR 2 r) -> AstNoVectorize s (TKR 2 r) Source #

trreplicate :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Int -> AstNoVectorize s ('TKR2 n x) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

trreplicate0N :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => IShR n -> AstNoVectorize s ('TKR2 0 x) -> AstNoVectorize s ('TKR2 n x) Source #

tssum :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => AstNoVectorize s ('TKS2 (n ': sh) x) -> AstNoVectorize s ('TKS2 sh x) Source #

tssum0 :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstNoVectorize s ('TKS2 sh x) -> AstNoVectorize s ('TKS2 ('[] :: [Nat]) x) Source #

tsdot0 :: forall (sh :: [Nat]) r. (KnownShS sh, GoodScalar r) => AstNoVectorize s (TKS sh r) -> AstNoVectorize s (TKS sh r) -> AstNoVectorize s (TKS ('[] :: [Nat]) r) Source #

tsdot1In :: forall (sh :: [Nat]) r (n :: Nat). (KnownShS sh, GoodScalar r) => SNat n -> AstNoVectorize s (TKS (sh ++ '[n]) r) -> AstNoVectorize s (TKS (sh ++ '[n]) r) -> AstNoVectorize s (TKS sh r) Source #

tsmatvecmul :: forall (m :: Nat) (n :: Nat) r. (KnownNat m, KnownNat n, GoodScalar r) => AstNoVectorize s (TKS '[m, n] r) -> AstNoVectorize s (TKS '[n] r) -> AstNoVectorize s (TKS '[m] r) Source #

tsmatmul2 :: forall (m :: Nat) (n :: Nat) (p :: Nat) r. (KnownNat m, KnownNat n, KnownNat p, GoodScalar r) => AstNoVectorize s (TKS '[m, n] r) -> AstNoVectorize s (TKS '[n, p] r) -> AstNoVectorize s (TKS '[m, p] r) Source #

tsreplicate :: forall (sh :: [Nat]) (k :: Nat) (x :: TK). KnownSTK x => SNat k -> ShS sh -> AstNoVectorize s ('TKS2 sh x) -> AstNoVectorize s ('TKS2 (k ': sh) x) Source #

tsreplicate0N :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => ShS sh -> AstNoVectorize s ('TKS2 ('[] :: [Nat]) x) -> AstNoVectorize s ('TKS2 sh x) Source #

txsum :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => AstNoVectorize s ('TKX2 ('Just n ': sh) x) -> AstNoVectorize s ('TKX2 sh x) Source #

txsum0 :: forall (sh :: [Maybe Nat]) (x :: TK). (KnownShX sh, KnownSTK x, ConvertTensor (AstNoVectorize s)) => AstNoVectorize s ('TKX2 sh x) -> AstNoVectorize s ('TKX2 ('[] :: [Maybe Nat]) x) Source #

txdot0 :: forall (sh :: [Maybe Nat]) r. (KnownShX sh, GoodScalar r, ConvertTensor (AstNoVectorize s)) => AstNoVectorize s (TKX sh r) -> AstNoVectorize s (TKX sh r) -> AstNoVectorize s (TKX ('[] :: [Maybe Nat]) r) Source #

txdot1In :: forall (sh :: [Maybe Nat]) r (n :: Nat). (KnownShX sh, GoodScalar r) => SNat n -> AstNoVectorize s (TKX (sh ++ '['Just n]) r) -> AstNoVectorize s (TKX (sh ++ '['Just n]) r) -> AstNoVectorize s (TKX sh r) Source #

txmatvecmul :: forall (mm :: Maybe Nat) (mn :: Maybe Nat) r. (GoodScalar r, ConvertTensor (AstNoVectorize s)) => SMayNat Int SNat mm -> SMayNat Int SNat mn -> AstNoVectorize s (TKX '[mm, mn] r) -> AstNoVectorize s (TKX '[mn] r) -> AstNoVectorize s (TKX '[mm] r) Source #

txmatmul2 :: forall (m :: Nat) (n :: Nat) (p :: Nat) r. (KnownNat m, KnownNat n, KnownNat p, GoodScalar r, ConvertTensor (AstNoVectorize s)) => AstNoVectorize s (TKX '['Just m, 'Just n] r) -> AstNoVectorize s (TKX '['Just n, 'Just p] r) -> AstNoVectorize s (TKX '['Just m, 'Just p] r) Source #

txreplicate :: forall (sh :: [Maybe Nat]) (k :: Nat) (x :: TK). KnownSTK x => SNat k -> StaticShX sh -> AstNoVectorize s ('TKX2 sh x) -> AstNoVectorize s ('TKX2 ('Just k ': sh) x) Source #

txreplicate0N :: forall (sh :: [Maybe Nat]) (x :: TK). (KnownShX sh, KnownSTK x) => IShX sh -> AstNoVectorize s ('TKX2 ('[] :: [Maybe Nat]) x) -> AstNoVectorize s ('TKX2 sh x) Source #

trindex :: forall (m :: Nat) (n :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownSTK x) => AstNoVectorize s ('TKR2 (m + n) x) -> IxROf (AstNoVectorize s) m -> AstNoVectorize s ('TKR2 n x) Source #

trindex0 :: forall (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => AstNoVectorize s ('TKR2 m x) -> IxROf (AstNoVectorize s) m -> AstNoVectorize s ('TKR2 0 x) Source #

troneHot :: forall (m :: Nat) (n :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownSTK x, BoolOf (PrimalOf (AstNoVectorize s)) ~ BoolOf (AstNoVectorize s), EqH (PrimalOf (AstNoVectorize s)) ('TKScalar Int64)) => IShR m -> AstNoVectorize s ('TKR2 n x) -> IxROf (AstNoVectorize s) m -> AstNoVectorize s ('TKR2 (m + n) x) Source #

trscatter :: forall (m :: Nat) (n :: Nat) (p :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownNat p, KnownSTK x) => IShR (p + n) -> AstNoVectorize s ('TKR2 (m + n) x) -> (IxROf (AstNoVectorize s) m -> IxROf (AstNoVectorize s) p) -> AstNoVectorize s ('TKR2 (p + n) x) Source #

trscatter1 :: forall (n :: Nat) (p :: Nat) (x :: TK). (KnownNat n, KnownNat p, KnownSTK x) => IShR (p + n) -> AstNoVectorize s ('TKR2 (1 + n) x) -> (IntOf (AstNoVectorize s) -> IxROf (AstNoVectorize s) p) -> AstNoVectorize s ('TKR2 (p + n) x) Source #

trgather :: forall (m :: Nat) (n :: Nat) (p :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownNat p, KnownSTK x) => IShR (m + n) -> AstNoVectorize s ('TKR2 (p + n) x) -> (IxROf (AstNoVectorize s) m -> IxROf (AstNoVectorize s) p) -> AstNoVectorize s ('TKR2 (m + n) x) Source #

trgather1 :: forall (n :: Nat) (p :: Nat) (x :: TK). (KnownNat n, KnownNat p, KnownSTK x) => Int -> AstNoVectorize s ('TKR2 (p + n) x) -> (IntOf (AstNoVectorize s) -> IxROf (AstNoVectorize s) p) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

tsindex :: forall (shm :: [Nat]) (shn :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownSTK x) => AstNoVectorize s ('TKS2 (shm ++ shn) x) -> IxSOf (AstNoVectorize s) shm -> AstNoVectorize s ('TKS2 shn x) Source #

tsindex0 :: forall (sh1 :: [Nat]) (x :: TK). (KnownShS sh1, KnownSTK x) => AstNoVectorize s ('TKS2 sh1 x) -> IxSOf (AstNoVectorize s) sh1 -> AstNoVectorize s ('TKS2 ('[] :: [Nat]) x) Source #

tsoneHot :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh1, KnownShS sh2, KnownSTK x, BoolOf (PrimalOf (AstNoVectorize s)) ~ BoolOf (AstNoVectorize s), EqH (PrimalOf (AstNoVectorize s)) ('TKScalar Int64)) => AstNoVectorize s ('TKS2 sh2 x) -> IxSOf (AstNoVectorize s) sh1 -> AstNoVectorize s ('TKS2 (sh1 ++ sh2) x) Source #

tsscatter :: forall (shm :: [Nat]) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoVectorize s ('TKS2 (shm ++ shn) x) -> (IxSOf (AstNoVectorize s) shm -> IxSOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKS2 (shp ++ shn) x) Source #

tsscatter1 :: forall (n2 :: Nat) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownNat n2, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoVectorize s ('TKS2 (n2 ': shn) x) -> (IntOf (AstNoVectorize s) -> IxSOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKS2 (shp ++ shn) x) Source #

tsgather :: forall (shm :: [Nat]) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoVectorize s ('TKS2 (shp ++ shn) x) -> (IxSOf (AstNoVectorize s) shm -> IxSOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKS2 (shm ++ shn) x) Source #

tsgather1 :: forall (n2 :: Nat) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownNat n2, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoVectorize s ('TKS2 (shp ++ shn) x) -> (IntOf (AstNoVectorize s) -> IxSOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKS2 (n2 ': shn) x) Source #

txindex :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x) => AstNoVectorize s ('TKX2 (sh1 ++ sh2) x) -> IxXOf (AstNoVectorize s) sh1 -> AstNoVectorize s ('TKX2 sh2 x) Source #

txindex0 :: forall (sh1 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownSTK x) => AstNoVectorize s ('TKX2 sh1 x) -> IxXOf (AstNoVectorize s) sh1 -> AstNoVectorize s ('TKX2 ('[] :: [Maybe Nat]) x) Source #

txoneHot :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x, BoolOf (PrimalOf (AstNoVectorize s)) ~ BoolOf (AstNoVectorize s), EqH (PrimalOf (AstNoVectorize s)) ('TKScalar Int64), ConvertTensor (AstNoVectorize s)) => IShX sh1 -> AstNoVectorize s ('TKX2 sh2 x) -> IxXOf (AstNoVectorize s) sh1 -> AstNoVectorize s ('TKX2 (sh1 ++ sh2) x) Source #

txscatter :: forall (shm :: [Maybe Nat]) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownShX shm, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shp ++ shn) -> AstNoVectorize s ('TKX2 (shm ++ shn) x) -> (IxXOf (AstNoVectorize s) shm -> IxXOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKX2 (shp ++ shn) x) Source #

txscatter1 :: forall (n2 :: Nat) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownNat n2, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shp ++ shn) -> AstNoVectorize s ('TKX2 ('Just n2 ': shn) x) -> (IntOf (AstNoVectorize s) -> IxXOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKX2 (shp ++ shn) x) Source #

txgather :: forall (shm :: [Maybe Nat]) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownShX shm, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shm ++ shn) -> AstNoVectorize s ('TKX2 (shp ++ shn) x) -> (IxXOf (AstNoVectorize s) shm -> IxXOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKX2 (shm ++ shn) x) Source #

txgather1 :: forall (n2 :: Nat) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownNat n2, KnownShX shn, KnownShX shp, KnownSTK x) => SNat n2 -> AstNoVectorize s ('TKX2 (shp ++ shn) x) -> (IntOf (AstNoVectorize s) -> IxXOf (AstNoVectorize s) shp) -> AstNoVectorize s ('TKX2 ('Just n2 ': shn) x) Source #

trfloor :: forall r r2 (n :: Nat). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoVectorize s (TKR n r) -> AstNoVectorize s (TKR n r2) Source #

trfromIntegral :: forall r1 r2 (n :: Nat). (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoVectorize s (TKR n r1) -> AstNoVectorize s (TKR n r2) Source #

trcast :: forall r1 r2 (n :: Nat). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoVectorize s (TKR n r1) -> AstNoVectorize s (TKR n r2) Source #

trminIndex :: forall (n :: Natural) r r2. (GoodScalar r, GoodScalar r2) => AstNoVectorize s (TKR (1 + n) r) -> AstNoVectorize s (TKR n r2) Source #

trmaxIndex :: forall (n :: Natural) r r2. (GoodScalar r, GoodScalar r2) => AstNoVectorize s (TKR (1 + n) r) -> AstNoVectorize s (TKR n r2) Source #

triota :: GoodScalar r => Int -> AstNoVectorize s (TKR 1 r) Source #

tsfloor :: forall r r2 (sh :: [Nat]). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoVectorize s (TKS sh r) -> AstNoVectorize s (TKS sh r2) Source #

tsfromIntegral :: forall r1 r2 (sh :: [Nat]). (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoVectorize s (TKS sh r1) -> AstNoVectorize s (TKS sh r2) Source #

tscast :: forall r1 r2 (sh :: [Nat]). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoVectorize s (TKS sh r1) -> AstNoVectorize s (TKS sh r2) Source #

tsminIndex :: forall (n :: Nat) (sh :: [Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoVectorize s (TKS (n ': sh) r) -> AstNoVectorize s (TKS (Init (n ': sh)) r2) Source #

tsmaxIndex :: forall (n :: Nat) (sh :: [Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoVectorize s (TKS (n ': sh) r) -> AstNoVectorize s (TKS (Init (n ': sh)) r2) Source #

tsiota :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoVectorize s (TKS '[n] r) Source #

txfloor :: forall r r2 (sh :: [Maybe Nat]). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoVectorize s (TKX sh r) -> AstNoVectorize s (TKX sh r2) Source #

txfromIntegral :: forall r1 r2 (sh :: [Maybe Nat]). (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoVectorize s (TKX sh r1) -> AstNoVectorize s (TKX sh r2) Source #

txcast :: forall r1 r2 (sh :: [Maybe Nat]). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoVectorize s (TKX sh r1) -> AstNoVectorize s (TKX sh r2) Source #

txminIndex :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoVectorize s (TKX (mn ': sh) r) -> AstNoVectorize s (TKX (Init (mn ': sh)) r2) Source #

txmaxIndex :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoVectorize s (TKX (mn ': sh) r) -> AstNoVectorize s (TKX (Init (mn ': sh)) r2) Source #

txiota :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoVectorize s (TKX '['Just n] r) Source #

tkfloor :: (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoVectorize s ('TKScalar r) -> AstNoVectorize s ('TKScalar r2) Source #

tkfromIntegral :: (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoVectorize s ('TKScalar r1) -> AstNoVectorize s ('TKScalar r2) Source #

tkcast :: (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoVectorize s ('TKScalar r1) -> AstNoVectorize s ('TKScalar r2) Source #

trappend :: forall (n :: Natural) (x :: TK). KnownSTK x => AstNoVectorize s ('TKR2 (1 + n) x) -> AstNoVectorize s ('TKR2 (1 + n) x) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

trslice :: forall (n :: Natural) (x :: TK). KnownSTK x => Int -> Int -> AstNoVectorize s ('TKR2 (1 + n) x) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

trreverse :: forall (n :: Natural) (x :: TK). KnownSTK x => AstNoVectorize s ('TKR2 (1 + n) x) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

trtranspose :: forall (n :: Nat) (x :: TK). KnownSTK x => PermR -> AstNoVectorize s ('TKR2 n x) -> AstNoVectorize s ('TKR2 n x) Source #

trreshape :: forall (n :: Nat) (m :: Nat) (x :: TK). KnownSTK x => IShR m -> AstNoVectorize s ('TKR2 n x) -> AstNoVectorize s ('TKR2 m x) Source #

tsappend :: forall (m :: Nat) (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKS2 (m ': sh) x) -> AstNoVectorize s ('TKS2 (n ': sh) x) -> AstNoVectorize s ('TKS2 ((m + n) ': sh) x) Source #

tsslice :: forall (i :: Nat) (n :: Nat) (k :: Nat) (sh :: [Natural]) (x :: TK). KnownSTK x => SNat i -> SNat n -> SNat k -> AstNoVectorize s ('TKS2 (((i + n) + k) ': sh) x) -> AstNoVectorize s ('TKS2 (n ': sh) x) Source #

tsreverse :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKS2 (n ': sh) x) -> AstNoVectorize s ('TKS2 (n ': sh) x) Source #

tstranspose :: forall (perm :: [Natural]) (sh :: [Nat]) (x :: TK). (IsPermutation perm, Rank perm <= Rank sh, KnownSTK x) => Perm perm -> AstNoVectorize s ('TKS2 sh x) -> AstNoVectorize s ('TKS2 (PermutePrefix perm sh) x) Source #

tsreshape :: forall (sh :: [Natural]) (sh2 :: [Natural]) (x :: TK). (Product sh ~ Product sh2, KnownSTK x) => ShS sh2 -> AstNoVectorize s ('TKS2 sh x) -> AstNoVectorize s ('TKS2 sh2 x) Source #

txappend :: forall (m :: Nat) (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 ('Just m ': sh) x) -> AstNoVectorize s ('TKX2 ('Just n ': sh) x) -> AstNoVectorize s ('TKX2 ('Just (m + n) ': sh) x) Source #

txslice :: forall (i :: Nat) (n :: Nat) (k :: Nat) (sh :: [Maybe Natural]) (x :: TK). KnownSTK x => SNat i -> SNat n -> SNat k -> AstNoVectorize s ('TKX2 ('Just ((i + n) + k) ': sh) x) -> AstNoVectorize s ('TKX2 ('Just n ': sh) x) Source #

txreverse :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoVectorize s ('TKX2 (mn ': sh) x) -> AstNoVectorize s ('TKX2 (mn ': sh) x) Source #

txtranspose :: forall (perm :: [Natural]) (sh :: [Maybe Nat]) (x :: TK). (IsPermutation perm, Rank perm <= Rank sh, KnownSTK x) => Perm perm -> AstNoVectorize s ('TKX2 sh x) -> AstNoVectorize s ('TKX2 (PermutePrefix perm sh) x) Source #

txreshape :: forall (sh :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). KnownSTK x => IShX sh2 -> AstNoVectorize s ('TKX2 sh x) -> AstNoVectorize s ('TKX2 sh2 x) Source #

trbuild1 :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Int -> (IntOf (AstNoVectorize s) -> AstNoVectorize s ('TKR2 n x)) -> AstNoVectorize s ('TKR2 (1 + n) x) Source #

trmap0N :: forall (n :: Nat) (x :: TK) (x1 :: TK). (KnownNat n, KnownSTK x, KnownSTK x1) => (AstNoVectorize s ('TKR2 0 x1) -> AstNoVectorize s ('TKR2 0 x)) -> AstNoVectorize s ('TKR2 n x1) -> AstNoVectorize s ('TKR2 n x) Source #

trzipWith0N :: forall (n :: Nat) (x :: TK) (x1 :: TK) (x2 :: TK). (KnownNat n, KnownSTK x, KnownSTK x1, KnownSTK x2) => (AstNoVectorize s ('TKR2 0 x1) -> AstNoVectorize s ('TKR2 0 x2) -> AstNoVectorize s ('TKR2 0 x)) -> AstNoVectorize s ('TKR2 n x1) -> AstNoVectorize s ('TKR2 n x2) -> AstNoVectorize s ('TKR2 n x) Source #

tsbuild1 :: forall (k :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat k, KnownShS sh, KnownSTK x) => (IntOf (AstNoVectorize s) -> AstNoVectorize s ('TKS2 sh x)) -> AstNoVectorize s ('TKS2 (k ': sh) x) Source #

tsmap0N :: forall (sh :: [Nat]) (x :: TK) (x1 :: TK). (KnownShS sh, KnownSTK x, KnownSTK x1) => (AstNoVectorize s ('TKS2 ('[] :: [Nat]) x1) -> AstNoVectorize s ('TKS2 ('[] :: [Nat]) x)) -> AstNoVectorize s ('TKS2 sh x1) -> AstNoVectorize s ('TKS2 sh x) Source #

tszipWith0N :: forall (sh :: [Nat]) (x :: TK) (x1 :: TK) (x2 :: TK). (KnownShS sh, KnownSTK x, KnownSTK x1, KnownSTK x2) => (AstNoVectorize s ('TKS2 ('[] :: [Nat]) x1) -> AstNoVectorize s ('TKS2 ('[] :: [Nat]) x2) -> AstNoVectorize s ('TKS2 ('[] :: [Nat]) x)) -> AstNoVectorize s ('TKS2 sh x1) -> AstNoVectorize s ('TKS2 sh x2) -> AstNoVectorize s ('TKS2 sh x) Source #

txbuild1 :: forall (k :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat k, KnownShX sh, KnownSTK x) => (IntOf (AstNoVectorize s) -> AstNoVectorize s ('TKX2 sh x)) -> AstNoVectorize s ('TKX2 ('Just k ': sh) x) Source #

tbuild1 :: forall (y :: TK) (k :: Nat). ConvertTensor (AstNoVectorize s) => SNat k -> SingletonTK y -> (IntOf (AstNoVectorize s) -> AstNoVectorize s y) -> AstNoVectorize s (BuildTensorKind k y) Source #

tmapAccumRDer :: forall (accy :: TK) (by :: TK) (ey :: TK) (k :: Nat). Proxy (AstNoVectorize s) -> SNat k -> FullShapeTK accy -> FullShapeTK by -> FullShapeTK ey -> HFunOf (AstNoVectorize s) ('TKProduct accy ey) ('TKProduct accy by) -> HFunOf (AstNoVectorize s) ('TKProduct (ADTensorKind ('TKProduct accy ey)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy by)) -> HFunOf (AstNoVectorize s) ('TKProduct (ADTensorKind ('TKProduct accy by)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy ey)) -> AstNoVectorize s accy -> AstNoVectorize s (BuildTensorKind k ey) -> AstNoVectorize s ('TKProduct accy (BuildTensorKind k by)) Source #

tmapAccumLDer :: forall (accy :: TK) (by :: TK) (ey :: TK) (k :: Nat). Proxy (AstNoVectorize s) -> SNat k -> FullShapeTK accy -> FullShapeTK by -> FullShapeTK ey -> HFunOf (AstNoVectorize s) ('TKProduct accy ey) ('TKProduct accy by) -> HFunOf (AstNoVectorize s) ('TKProduct (ADTensorKind ('TKProduct accy ey)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy by)) -> HFunOf (AstNoVectorize s) ('TKProduct (ADTensorKind ('TKProduct accy by)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy ey)) -> AstNoVectorize s accy -> AstNoVectorize s (BuildTensorKind k ey) -> AstNoVectorize s ('TKProduct accy (BuildTensorKind k by)) Source #

tApply :: forall (x :: TK) (z :: TK). HFunOf (AstNoVectorize s) x z -> AstNoVectorize s x -> AstNoVectorize s z Source #

tlambda :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstNoVectorize s) x z Source #

tgrad :: forall (x :: TK) r. FullShapeTK x -> HFun x ('TKScalar r) -> HFunOf (AstNoVectorize s) x (ADTensorKind x) Source #

tvjp :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstNoVectorize s) ('TKProduct (ADTensorKind z) x) (ADTensorKind x) Source #

tjvp :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstNoVectorize s) ('TKProduct (ADTensorKind x) x) (ADTensorKind z) Source #

tprimalPart :: forall (y :: TK). AstNoVectorize s y -> PrimalOf (AstNoVectorize s) y Source #

tdualPart :: forall (y :: TK). SingletonTK y -> AstNoVectorize s y -> DualOf (AstNoVectorize s) y Source #

tfromPrimal :: forall (y :: TK). SingletonTK y -> PrimalOf (AstNoVectorize s) y -> AstNoVectorize s y Source #

tfromDual :: forall (y :: TK). DualOf (AstNoVectorize s) y -> AstNoVectorize s y Source #

tScale :: forall (y :: TK). (Num (AstNoVectorize s y), Num (PrimalOf (AstNoVectorize s) y)) => SingletonTK y -> PrimalOf (AstNoVectorize s) y -> DualOf (AstNoVectorize s) y -> DualOf (AstNoVectorize s) y Source #

tsum :: forall (z :: TK) (k :: Nat). ConvertTensor (AstNoVectorize s) => SNat k -> SingletonTK z -> AstNoVectorize s (BuildTensorKind k z) -> AstNoVectorize s z Source #

treplicate :: forall (z :: TK) (k :: Nat). ConvertTensor (AstNoVectorize s) => SNat k -> SingletonTK z -> AstNoVectorize s z -> AstNoVectorize s (BuildTensorKind k z) Source #

tindexBuild :: forall (z :: TK) (k :: Nat). ConvertTensor (AstNoVectorize s) => SNat k -> SingletonTK z -> AstNoVectorize s (BuildTensorKind k z) -> IntOf (AstNoVectorize s) -> AstNoVectorize s z Source #

treplTarget :: forall (y :: TK). (forall r. GoodScalar r => r) -> FullShapeTK y -> AstNoVectorize s y Source #

tdefTarget :: forall (y :: TK). FullShapeTK y -> AstNoVectorize s y Source #

taddTarget :: forall (y :: TK). SingletonTK y -> AstNoVectorize s y -> AstNoVectorize s y -> AstNoVectorize s y Source #

tmultTarget :: forall (y :: TK). SingletonTK y -> AstNoVectorize s y -> AstNoVectorize s y -> AstNoVectorize s y Source #

tsum0Target :: forall (y :: TK). FullShapeTK y -> AstNoVectorize s y -> AstNoVectorize s ('TKScalar Double) Source #

tdot0Target :: forall (y :: TK). FullShapeTK y -> AstNoVectorize s y -> AstNoVectorize s y -> AstNoVectorize s ('TKScalar Double) Source #

xmcast :: forall (x :: TK) (sh :: [Maybe Nat]) (sh2 :: [Maybe Nat]). (KnownSTK x, KnownShX sh, Rank sh ~ Rank sh2, ConvertTensor (AstNoVectorize s)) => StaticShX sh2 -> AstNoVectorize s ('TKX2 sh x) -> AstNoVectorize s ('TKX2 sh2 x) Source #

AstSpan s => LetTensor (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

ttlet :: forall (x :: TK) (z :: TK). AstNoVectorize s x -> (AstNoVectorize s x -> AstNoVectorize s z) -> AstNoVectorize s z Source #

ttletPrimal :: forall (x :: TK) (z :: TK). PrimalOf (AstNoVectorize s) x -> (PrimalOf (AstNoVectorize s) x -> AstNoVectorize s z) -> AstNoVectorize s z Source #

toShare :: forall (y :: TK). AstNoVectorize s y -> ShareOf (AstNoVectorize s) y Source #

tunshare :: forall (y :: TK). ShareOf (AstNoVectorize s) y -> AstNoVectorize s y Source #

tappend :: forall (m :: Nat) (n :: Nat) (y :: TK). BaseTensor (AstNoVectorize s) => SNat m -> SNat n -> SingletonTK y -> AstNoVectorize s (BuildTensorKind m y) -> AstNoVectorize s (BuildTensorKind n y) -> AstNoVectorize s (BuildTensorKind (m + n) y) Source #

tD :: forall (y :: TK). BaseTensor (AstNoVectorize s) => SingletonTK y -> PrimalOf (AstNoVectorize s) y -> DualOf (AstNoVectorize s) y -> AstNoVectorize s y Source #

tfold :: forall (yn :: TK) (ym :: TK) (k :: Nat). BaseTensor (AstNoVectorize s) => SNat k -> SingletonTK yn -> SingletonTK ym -> (forall (f :: Target). ADReady f => f yn -> f ym -> f yn) -> AstNoVectorize s yn -> AstNoVectorize s (BuildTensorKind k ym) -> AstNoVectorize s yn Source #

tscan :: forall (yn :: TK) (ym :: TK) (k :: Nat). BaseTensor (AstNoVectorize s) => SNat k -> SingletonTK yn -> SingletonTK ym -> (forall (f :: Target). ADReady f => f yn -> f ym -> f yn) -> AstNoVectorize s yn -> AstNoVectorize s (BuildTensorKind k ym) -> AstNoVectorize s (BuildTensorKind (1 + k) yn) Source #

EqH (AstTensor 'AstMethodLet s) y => EqH (AstNoVectorize s) y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

OrdH (AstTensor 'AstMethodLet s) y => OrdH (AstNoVectorize s) y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Floating (AstTensor 'AstMethodLet s y) => Floating (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Num (AstTensor 'AstMethodLet s y) => Num (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Fractional (AstTensor 'AstMethodLet s y) => Fractional (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Show (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Eq (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Ord (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

IntegralH (AstTensor 'AstMethodLet s y) => IntegralH (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

RealFloatH (AstTensor 'AstMethodLet s y) => RealFloatH (AstNoVectorize s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type BoolOf (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type DualOf (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type PrimalOf (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type ShareOf (AstNoVectorize s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type HFunOf (AstNoVectorize s) x z Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type HFunOf (AstNoVectorize s) x z = AstHFun s s x z

newtype AstNoSimplify (s :: AstSpanType) (y :: TK) Source #

An AST variant for testing that vectorizes terms, but builds them with ordinary, non-simplifying constructors.

Instances

Instances details
AstSpan s => ConvertTensor (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

tconvert :: forall (a :: TK) (b :: TK). TKConversion a b -> SingletonTK a -> AstNoSimplify s a -> AstNoSimplify s b Source #

kfromR :: GoodScalar r => AstNoSimplify s (TKR 0 r) -> AstNoSimplify s ('TKScalar r) Source #

kfromS :: GoodScalar r => AstNoSimplify s (TKS ('[] :: [Nat]) r) -> AstNoSimplify s ('TKScalar r) Source #

kfromX :: GoodScalar r => AstNoSimplify s (TKX ('[] :: [Maybe Nat]) r) -> AstNoSimplify s ('TKScalar r) Source #

rfromK :: GoodScalar r => AstNoSimplify s ('TKScalar r) -> AstNoSimplify s (TKR 0 r) Source #

rfromS :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstNoSimplify s ('TKS2 sh x) -> AstNoSimplify s ('TKR2 (Rank sh) x) Source #

rfromX :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 sh x) -> AstNoSimplify s ('TKR2 (Rank sh) x) Source #

sfromK :: GoodScalar r => AstNoSimplify s ('TKScalar r) -> AstNoSimplify s (TKS ('[] :: [Nat]) r) Source #

sfromR :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstNoSimplify s ('TKR2 (Rank sh) x) -> AstNoSimplify s ('TKS2 sh x) Source #

sfromX :: forall (sh :: [Nat]) (sh' :: [Maybe Nat]) (x :: TK). (KnownShS sh, Rank sh ~ Rank sh', KnownSTK x) => AstNoSimplify s ('TKX2 sh' x) -> AstNoSimplify s ('TKS2 sh x) Source #

xfromK :: GoodScalar r => AstNoSimplify s ('TKScalar r) -> AstNoSimplify s (TKX ('[] :: [Maybe Nat]) r) Source #

xfromR :: forall (sh' :: [Maybe Nat]) (x :: TK). (KnownShX sh', KnownSTK x) => AstNoSimplify s ('TKR2 (Rank sh') x) -> AstNoSimplify s ('TKX2 sh' x) Source #

xfromS :: forall (sh :: [Nat]) (sh' :: [Maybe Nat]) (x :: TK). (KnownShS sh, KnownShX sh', Rank sh ~ Rank sh', KnownSTK x) => AstNoSimplify s ('TKS2 sh x) -> AstNoSimplify s ('TKX2 sh' x) Source #

rzip :: forall (y :: TK) (z :: TK) (n :: Nat). (KnownSTK y, KnownSTK z) => AstNoSimplify s ('TKProduct ('TKR2 n y) ('TKR2 n z)) -> AstNoSimplify s ('TKR2 n ('TKProduct y z)) Source #

runzip :: forall (y :: TK) (z :: TK) (n :: Nat). AstNoSimplify s ('TKR2 n ('TKProduct y z)) -> AstNoSimplify s ('TKProduct ('TKR2 n y) ('TKR2 n z)) Source #

szip :: forall (y :: TK) (z :: TK) (sh :: [Nat]). (KnownSTK y, KnownSTK z) => AstNoSimplify s ('TKProduct ('TKS2 sh y) ('TKS2 sh z)) -> AstNoSimplify s ('TKS2 sh ('TKProduct y z)) Source #

sunzip :: forall (y :: TK) (z :: TK) (sh :: [Nat]). AstNoSimplify s ('TKS2 sh ('TKProduct y z)) -> AstNoSimplify s ('TKProduct ('TKS2 sh y) ('TKS2 sh z)) Source #

xzip :: forall (y :: TK) (z :: TK) (sh :: [Maybe Nat]). (KnownSTK y, KnownSTK z) => AstNoSimplify s ('TKProduct ('TKX2 sh y) ('TKX2 sh z)) -> AstNoSimplify s ('TKX2 sh ('TKProduct y z)) Source #

xunzip :: forall (y :: TK) (z :: TK) (sh :: [Maybe Nat]). AstNoSimplify s ('TKX2 sh ('TKProduct y z)) -> AstNoSimplify s ('TKProduct ('TKX2 sh y) ('TKX2 sh z)) Source #

rnest :: forall (n :: Nat) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => SNat n -> AstNoSimplify s ('TKR2 (n + m) x) -> AstNoSimplify s ('TKR2 n ('TKR2 m x)) Source #

rnestS :: forall (n :: Nat) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => SNat n -> AstNoSimplify s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ MapJust sh2) x) -> AstNoSimplify s ('TKR2 n ('TKS2 sh2 x)) Source #

rnestX :: forall (n :: Nat) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => SNat n -> AstNoSimplify s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ sh2) x) -> AstNoSimplify s ('TKR2 n ('TKX2 sh2 x)) Source #

snestR :: forall (sh1 :: [Nat]) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => ShS sh1 -> AstNoSimplify s ('TKX2 (MapJust sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) -> AstNoSimplify s ('TKS2 sh1 ('TKR2 m x)) Source #

snest :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => ShS sh1 -> AstNoSimplify s ('TKS2 (sh1 ++ sh2) x) -> AstNoSimplify s ('TKS2 sh1 ('TKS2 sh2 x)) Source #

snestX :: forall (sh1 :: [Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => ShS sh1 -> AstNoSimplify s ('TKX2 (MapJust sh1 ++ sh2) x) -> AstNoSimplify s ('TKS2 sh1 ('TKX2 sh2 x)) Source #

xnestR :: forall (sh1 :: [Maybe Nat]) (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => StaticShX sh1 -> AstNoSimplify s ('TKX2 (sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) -> AstNoSimplify s ('TKX2 sh1 ('TKR2 m x)) Source #

xnestS :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh2, KnownSTK x) => StaticShX sh1 -> AstNoSimplify s ('TKX2 (sh1 ++ MapJust sh2) x) -> AstNoSimplify s ('TKX2 sh1 ('TKS2 sh2 x)) Source #

xnest :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh2, KnownSTK x) => StaticShX sh1 -> AstNoSimplify s ('TKX2 (sh1 ++ sh2) x) -> AstNoSimplify s ('TKX2 sh1 ('TKX2 sh2 x)) Source #

runNest :: forall (n :: Nat) (m :: Nat) (x :: TK). (KnownNat n, KnownNat m, KnownSTK x) => AstNoSimplify s ('TKR2 n ('TKR2 m x)) -> AstNoSimplify s ('TKR2 (n + m) x) Source #

runNestS :: forall (n :: Nat) (sh2 :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh2, KnownSTK x) => AstNoSimplify s ('TKR2 n ('TKS2 sh2 x)) -> AstNoSimplify s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ MapJust sh2) x) Source #

runNestX :: forall (n :: Nat) (sh2 :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh2, KnownSTK x) => AstNoSimplify s ('TKR2 n ('TKX2 sh2 x)) -> AstNoSimplify s ('TKX2 (Replicate n ('Nothing :: Maybe Nat) ++ sh2) x) Source #

sunNestR :: forall (sh1 :: [Nat]) (m :: Nat) (x :: TK). (KnownShS sh1, KnownNat m, KnownSTK x) => AstNoSimplify s ('TKS2 sh1 ('TKR2 m x)) -> AstNoSimplify s ('TKX2 (MapJust sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) Source #

sunNest :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh1, KnownShS sh2, KnownSTK x) => AstNoSimplify s ('TKS2 sh1 ('TKS2 sh2 x)) -> AstNoSimplify s ('TKS2 (sh1 ++ sh2) x) Source #

sunNestX :: forall (sh1 :: [Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShS sh1, KnownShX sh2, KnownSTK x) => AstNoSimplify s ('TKS2 sh1 ('TKX2 sh2 x)) -> AstNoSimplify s ('TKX2 (MapJust sh1 ++ sh2) x) Source #

xunNestR :: forall (sh1 :: [Maybe Nat]) (m :: Nat) (x :: TK). (KnownShX sh1, KnownNat m, KnownSTK x) => AstNoSimplify s ('TKX2 sh1 ('TKR2 m x)) -> AstNoSimplify s ('TKX2 (sh1 ++ Replicate m ('Nothing :: Maybe Nat)) x) Source #

xunNestS :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShX sh1, KnownShS sh2, KnownSTK x) => AstNoSimplify s ('TKX2 sh1 ('TKS2 sh2 x)) -> AstNoSimplify s ('TKX2 (sh1 ++ MapJust sh2) x) Source #

xunNest :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x) => AstNoSimplify s ('TKX2 sh1 ('TKX2 sh2 x)) -> AstNoSimplify s ('TKX2 (sh1 ++ sh2) x) Source #

tpairConv :: forall (x :: TK) (z :: TK). AstNoSimplify s x -> AstNoSimplify s z -> AstNoSimplify s ('TKProduct x z) Source #

tunpairConv :: forall (x :: TK) (z :: TK). AstNoSimplify s ('TKProduct x z) -> (AstNoSimplify s x, AstNoSimplify s z) Source #

AstSpan s => BaseTensor (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

rshape :: forall (n :: Nat) (x :: TK). KnownSTK x => AstNoSimplify s ('TKR2 n x) -> IShR n Source #

rlength :: forall (n :: Nat) (x :: TK). KnownSTK x => AstNoSimplify s ('TKR2 n x) -> Int Source #

rsize :: forall (n :: Nat) (x :: TK). KnownSTK x => AstNoSimplify s ('TKR2 n x) -> Int Source #

rwidth :: forall (n :: Natural) (x :: TK). KnownSTK x => AstNoSimplify s ('TKR2 (1 + n) x) -> Int Source #

sshape :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKS2 sh x) -> ShS sh Source #

slength :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKS2 sh x) -> Int Source #

ssize :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKS2 sh x) -> Int Source #

swidth :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKS2 (n ': sh) x) -> Int Source #

xshape :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 sh x) -> IShX sh Source #

xlength :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 sh x) -> Int Source #

xsize :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 sh x) -> Int Source #

xwidth :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 (mn ': sh) x) -> Int Source #

tsize :: forall (y :: TK). SingletonTK y -> AstNoSimplify s y -> Int Source #

tftk :: forall (y :: TK). SingletonTK y -> AstNoSimplify s y -> FullShapeTK y Source #

tpair :: forall (x :: TK) (z :: TK). AstNoSimplify s x -> AstNoSimplify s z -> AstNoSimplify s ('TKProduct x z) Source #

tproject1 :: forall (x :: TK) (z :: TK). AstNoSimplify s ('TKProduct x z) -> AstNoSimplify s x Source #

tproject2 :: forall (x :: TK) (z :: TK). AstNoSimplify s ('TKProduct x z) -> AstNoSimplify s z Source #

tcond :: forall (y :: TK). Boolean (BoolOf (AstNoSimplify s)) => SingletonTK y -> BoolOf (AstNoSimplify s) -> AstNoSimplify s y -> AstNoSimplify s y -> AstNoSimplify s y Source #

trconcrete :: forall r (n :: Nat). GoodScalar r => Ranked n r -> AstNoSimplify s (TKR n r) Source #

tsconcrete :: forall r (sh :: [Nat]). GoodScalar r => Shaped sh r -> AstNoSimplify s (TKS sh r) Source #

txconcrete :: forall r (sh :: [Maybe Nat]). GoodScalar r => Mixed sh r -> AstNoSimplify s (TKX sh r) Source #

tkconcrete :: GoodScalar r => r -> AstNoSimplify s ('TKScalar r) Source #

tconcrete :: forall (y :: TK). FullShapeTK y -> Concrete y -> AstNoSimplify s y Source #

trfromVector :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Vector (AstNoSimplify s ('TKR2 n x)) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

trfromVector0N :: forall (n :: Nat) (x :: TK). KnownSTK x => IShR n -> Vector (AstNoSimplify s ('TKR2 0 x)) -> AstNoSimplify s ('TKR2 n x) Source #

trunravelToList :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstNoSimplify s ('TKR2 (1 + n) x) -> [AstNoSimplify s ('TKR2 n x)] Source #

tsfromVector :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => Vector (AstNoSimplify s ('TKS2 sh x)) -> AstNoSimplify s ('TKS2 (n ': sh) x) Source #

tsfromVector0N :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => Vector (AstNoSimplify s ('TKS2 ('[] :: [Nat]) x)) -> AstNoSimplify s ('TKS2 sh x) Source #

tsunravelToList :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => AstNoSimplify s ('TKS2 (n ': sh) x) -> [AstNoSimplify s ('TKS2 sh x)] Source #

txfromVector :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => Vector (AstNoSimplify s ('TKX2 sh x)) -> AstNoSimplify s ('TKX2 ('Just n ': sh) x) Source #

txfromVector0N :: forall (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => IShX sh -> Vector (AstNoSimplify s ('TKX2 ('[] :: [Maybe Nat]) x)) -> AstNoSimplify s ('TKX2 sh x) Source #

txunravelToList :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => AstNoSimplify s ('TKX2 ('Just n ': sh) x) -> [AstNoSimplify s ('TKX2 sh x)] Source #

tfromVector :: forall (y :: TK) (k :: Nat). SNat k -> SingletonTK y -> Vector (AstNoSimplify s y) -> AstNoSimplify s (BuildTensorKind k y) Source #

tfromListR :: forall (y :: TK) (k :: Nat). SingletonTK y -> ListR k (AstNoSimplify s y) -> AstNoSimplify s (BuildTensorKind k y) Source #

trsum :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstNoSimplify s ('TKR2 (1 + n) x) -> AstNoSimplify s ('TKR2 n x) Source #

trsum0 :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => AstNoSimplify s ('TKR2 n x) -> AstNoSimplify s ('TKR2 0 x) Source #

trdot0 :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoSimplify s (TKR n r) -> AstNoSimplify s (TKR n r) -> AstNoSimplify s (TKR 0 r) Source #

trdot1In :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoSimplify s (TKR (1 + n) r) -> AstNoSimplify s (TKR (1 + n) r) -> AstNoSimplify s (TKR n r) Source #

trmatvecmul :: GoodScalar r => AstNoSimplify s (TKR 2 r) -> AstNoSimplify s (TKR 1 r) -> AstNoSimplify s (TKR 1 r) Source #

trmatmul2 :: GoodScalar r => AstNoSimplify s (TKR 2 r) -> AstNoSimplify s (TKR 2 r) -> AstNoSimplify s (TKR 2 r) Source #

trreplicate :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Int -> AstNoSimplify s ('TKR2 n x) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

trreplicate0N :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => IShR n -> AstNoSimplify s ('TKR2 0 x) -> AstNoSimplify s ('TKR2 n x) Source #

tssum :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat n, KnownShS sh, KnownSTK x) => AstNoSimplify s ('TKS2 (n ': sh) x) -> AstNoSimplify s ('TKS2 sh x) Source #

tssum0 :: forall (sh :: [Nat]) (x :: TK). (KnownShS sh, KnownSTK x) => AstNoSimplify s ('TKS2 sh x) -> AstNoSimplify s ('TKS2 ('[] :: [Nat]) x) Source #

tsdot0 :: forall (sh :: [Nat]) r. (KnownShS sh, GoodScalar r) => AstNoSimplify s (TKS sh r) -> AstNoSimplify s (TKS sh r) -> AstNoSimplify s (TKS ('[] :: [Nat]) r) Source #

tsdot1In :: forall (sh :: [Nat]) r (n :: Nat). (KnownShS sh, GoodScalar r) => SNat n -> AstNoSimplify s (TKS (sh ++ '[n]) r) -> AstNoSimplify s (TKS (sh ++ '[n]) r) -> AstNoSimplify s (TKS sh r) Source #

tsmatvecmul :: forall (m :: Nat) (n :: Nat) r. (KnownNat m, KnownNat n, GoodScalar r) => AstNoSimplify s (TKS '[m, n] r) -> AstNoSimplify s (TKS '[n] r) -> AstNoSimplify s (TKS '[m] r) Source #

tsmatmul2 :: forall (m :: Nat) (n :: Nat) (p :: Nat) r. (KnownNat m, KnownNat n, KnownNat p, GoodScalar r) => AstNoSimplify s (TKS '[m, n] r) -> AstNoSimplify s (TKS '[n, p] r) -> AstNoSimplify s (TKS '[m, p] r) Source #

tsreplicate :: forall (sh :: [Nat]) (k :: Nat) (x :: TK). KnownSTK x => SNat k -> ShS sh -> AstNoSimplify s ('TKS2 sh x) -> AstNoSimplify s ('TKS2 (k ': sh) x) Source #

tsreplicate0N :: forall (sh :: [Nat]) (x :: TK). KnownSTK x => ShS sh -> AstNoSimplify s ('TKS2 ('[] :: [Nat]) x) -> AstNoSimplify s ('TKS2 sh x) Source #

txsum :: forall (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat n, KnownShX sh, KnownSTK x) => AstNoSimplify s ('TKX2 ('Just n ': sh) x) -> AstNoSimplify s ('TKX2 sh x) Source #

txsum0 :: forall (sh :: [Maybe Nat]) (x :: TK). (KnownShX sh, KnownSTK x, ConvertTensor (AstNoSimplify s)) => AstNoSimplify s ('TKX2 sh x) -> AstNoSimplify s ('TKX2 ('[] :: [Maybe Nat]) x) Source #

txdot0 :: forall (sh :: [Maybe Nat]) r. (KnownShX sh, GoodScalar r, ConvertTensor (AstNoSimplify s)) => AstNoSimplify s (TKX sh r) -> AstNoSimplify s (TKX sh r) -> AstNoSimplify s (TKX ('[] :: [Maybe Nat]) r) Source #

txdot1In :: forall (sh :: [Maybe Nat]) r (n :: Nat). (KnownShX sh, GoodScalar r) => SNat n -> AstNoSimplify s (TKX (sh ++ '['Just n]) r) -> AstNoSimplify s (TKX (sh ++ '['Just n]) r) -> AstNoSimplify s (TKX sh r) Source #

txmatvecmul :: forall (mm :: Maybe Nat) (mn :: Maybe Nat) r. (GoodScalar r, ConvertTensor (AstNoSimplify s)) => SMayNat Int SNat mm -> SMayNat Int SNat mn -> AstNoSimplify s (TKX '[mm, mn] r) -> AstNoSimplify s (TKX '[mn] r) -> AstNoSimplify s (TKX '[mm] r) Source #

txmatmul2 :: forall (m :: Nat) (n :: Nat) (p :: Nat) r. (KnownNat m, KnownNat n, KnownNat p, GoodScalar r, ConvertTensor (AstNoSimplify s)) => AstNoSimplify s (TKX '['Just m, 'Just n] r) -> AstNoSimplify s (TKX '['Just n, 'Just p] r) -> AstNoSimplify s (TKX '['Just m, 'Just p] r) Source #

txreplicate :: forall (sh :: [Maybe Nat]) (k :: Nat) (x :: TK). KnownSTK x => SNat k -> StaticShX sh -> AstNoSimplify s ('TKX2 sh x) -> AstNoSimplify s ('TKX2 ('Just k ': sh) x) Source #

txreplicate0N :: forall (sh :: [Maybe Nat]) (x :: TK). (KnownShX sh, KnownSTK x) => IShX sh -> AstNoSimplify s ('TKX2 ('[] :: [Maybe Nat]) x) -> AstNoSimplify s ('TKX2 sh x) Source #

trindex :: forall (m :: Nat) (n :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownSTK x) => AstNoSimplify s ('TKR2 (m + n) x) -> IxROf (AstNoSimplify s) m -> AstNoSimplify s ('TKR2 n x) Source #

trindex0 :: forall (m :: Nat) (x :: TK). (KnownNat m, KnownSTK x) => AstNoSimplify s ('TKR2 m x) -> IxROf (AstNoSimplify s) m -> AstNoSimplify s ('TKR2 0 x) Source #

troneHot :: forall (m :: Nat) (n :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownSTK x, BoolOf (PrimalOf (AstNoSimplify s)) ~ BoolOf (AstNoSimplify s), EqH (PrimalOf (AstNoSimplify s)) ('TKScalar Int64)) => IShR m -> AstNoSimplify s ('TKR2 n x) -> IxROf (AstNoSimplify s) m -> AstNoSimplify s ('TKR2 (m + n) x) Source #

trscatter :: forall (m :: Nat) (n :: Nat) (p :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownNat p, KnownSTK x) => IShR (p + n) -> AstNoSimplify s ('TKR2 (m + n) x) -> (IxROf (AstNoSimplify s) m -> IxROf (AstNoSimplify s) p) -> AstNoSimplify s ('TKR2 (p + n) x) Source #

trscatter1 :: forall (n :: Nat) (p :: Nat) (x :: TK). (KnownNat n, KnownNat p, KnownSTK x) => IShR (p + n) -> AstNoSimplify s ('TKR2 (1 + n) x) -> (IntOf (AstNoSimplify s) -> IxROf (AstNoSimplify s) p) -> AstNoSimplify s ('TKR2 (p + n) x) Source #

trgather :: forall (m :: Nat) (n :: Nat) (p :: Nat) (x :: TK). (KnownNat m, KnownNat n, KnownNat p, KnownSTK x) => IShR (m + n) -> AstNoSimplify s ('TKR2 (p + n) x) -> (IxROf (AstNoSimplify s) m -> IxROf (AstNoSimplify s) p) -> AstNoSimplify s ('TKR2 (m + n) x) Source #

trgather1 :: forall (n :: Nat) (p :: Nat) (x :: TK). (KnownNat n, KnownNat p, KnownSTK x) => Int -> AstNoSimplify s ('TKR2 (p + n) x) -> (IntOf (AstNoSimplify s) -> IxROf (AstNoSimplify s) p) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

tsindex :: forall (shm :: [Nat]) (shn :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownSTK x) => AstNoSimplify s ('TKS2 (shm ++ shn) x) -> IxSOf (AstNoSimplify s) shm -> AstNoSimplify s ('TKS2 shn x) Source #

tsindex0 :: forall (sh1 :: [Nat]) (x :: TK). (KnownShS sh1, KnownSTK x) => AstNoSimplify s ('TKS2 sh1 x) -> IxSOf (AstNoSimplify s) sh1 -> AstNoSimplify s ('TKS2 ('[] :: [Nat]) x) Source #

tsoneHot :: forall (sh1 :: [Nat]) (sh2 :: [Nat]) (x :: TK). (KnownShS sh1, KnownShS sh2, KnownSTK x, BoolOf (PrimalOf (AstNoSimplify s)) ~ BoolOf (AstNoSimplify s), EqH (PrimalOf (AstNoSimplify s)) ('TKScalar Int64)) => AstNoSimplify s ('TKS2 sh2 x) -> IxSOf (AstNoSimplify s) sh1 -> AstNoSimplify s ('TKS2 (sh1 ++ sh2) x) Source #

tsscatter :: forall (shm :: [Nat]) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoSimplify s ('TKS2 (shm ++ shn) x) -> (IxSOf (AstNoSimplify s) shm -> IxSOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKS2 (shp ++ shn) x) Source #

tsscatter1 :: forall (n2 :: Nat) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownNat n2, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoSimplify s ('TKS2 (n2 ': shn) x) -> (IntOf (AstNoSimplify s) -> IxSOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKS2 (shp ++ shn) x) Source #

tsgather :: forall (shm :: [Nat]) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownShS shm, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoSimplify s ('TKS2 (shp ++ shn) x) -> (IxSOf (AstNoSimplify s) shm -> IxSOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKS2 (shm ++ shn) x) Source #

tsgather1 :: forall (n2 :: Nat) (shn :: [Nat]) (shp :: [Nat]) (x :: TK). (KnownNat n2, KnownShS shn, KnownShS shp, KnownSTK x) => AstNoSimplify s ('TKS2 (shp ++ shn) x) -> (IntOf (AstNoSimplify s) -> IxSOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKS2 (n2 ': shn) x) Source #

txindex :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x) => AstNoSimplify s ('TKX2 (sh1 ++ sh2) x) -> IxXOf (AstNoSimplify s) sh1 -> AstNoSimplify s ('TKX2 sh2 x) Source #

txindex0 :: forall (sh1 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownSTK x) => AstNoSimplify s ('TKX2 sh1 x) -> IxXOf (AstNoSimplify s) sh1 -> AstNoSimplify s ('TKX2 ('[] :: [Maybe Nat]) x) Source #

txoneHot :: forall (sh1 :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). (KnownShX sh1, KnownShX sh2, KnownSTK x, BoolOf (PrimalOf (AstNoSimplify s)) ~ BoolOf (AstNoSimplify s), EqH (PrimalOf (AstNoSimplify s)) ('TKScalar Int64), ConvertTensor (AstNoSimplify s)) => IShX sh1 -> AstNoSimplify s ('TKX2 sh2 x) -> IxXOf (AstNoSimplify s) sh1 -> AstNoSimplify s ('TKX2 (sh1 ++ sh2) x) Source #

txscatter :: forall (shm :: [Maybe Nat]) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownShX shm, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shp ++ shn) -> AstNoSimplify s ('TKX2 (shm ++ shn) x) -> (IxXOf (AstNoSimplify s) shm -> IxXOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKX2 (shp ++ shn) x) Source #

txscatter1 :: forall (n2 :: Nat) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownNat n2, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shp ++ shn) -> AstNoSimplify s ('TKX2 ('Just n2 ': shn) x) -> (IntOf (AstNoSimplify s) -> IxXOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKX2 (shp ++ shn) x) Source #

txgather :: forall (shm :: [Maybe Nat]) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownShX shm, KnownShX shn, KnownShX shp, KnownSTK x) => IShX (shm ++ shn) -> AstNoSimplify s ('TKX2 (shp ++ shn) x) -> (IxXOf (AstNoSimplify s) shm -> IxXOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKX2 (shm ++ shn) x) Source #

txgather1 :: forall (n2 :: Nat) (shn :: [Maybe Nat]) (shp :: [Maybe Nat]) (x :: TK). (KnownNat n2, KnownShX shn, KnownShX shp, KnownSTK x) => SNat n2 -> AstNoSimplify s ('TKX2 (shp ++ shn) x) -> (IntOf (AstNoSimplify s) -> IxXOf (AstNoSimplify s) shp) -> AstNoSimplify s ('TKX2 ('Just n2 ': shn) x) Source #

trfloor :: forall r r2 (n :: Nat). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoSimplify s (TKR n r) -> AstNoSimplify s (TKR n r2) Source #

trfromIntegral :: forall r1 r2 (n :: Nat). (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoSimplify s (TKR n r1) -> AstNoSimplify s (TKR n r2) Source #

trcast :: forall r1 r2 (n :: Nat). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoSimplify s (TKR n r1) -> AstNoSimplify s (TKR n r2) Source #

trminIndex :: forall (n :: Natural) r r2. (GoodScalar r, GoodScalar r2) => AstNoSimplify s (TKR (1 + n) r) -> AstNoSimplify s (TKR n r2) Source #

trmaxIndex :: forall (n :: Natural) r r2. (GoodScalar r, GoodScalar r2) => AstNoSimplify s (TKR (1 + n) r) -> AstNoSimplify s (TKR n r2) Source #

triota :: GoodScalar r => Int -> AstNoSimplify s (TKR 1 r) Source #

tsfloor :: forall r r2 (sh :: [Nat]). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoSimplify s (TKS sh r) -> AstNoSimplify s (TKS sh r2) Source #

tsfromIntegral :: forall r1 r2 (sh :: [Nat]). (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoSimplify s (TKS sh r1) -> AstNoSimplify s (TKS sh r2) Source #

tscast :: forall r1 r2 (sh :: [Nat]). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoSimplify s (TKS sh r1) -> AstNoSimplify s (TKS sh r2) Source #

tsminIndex :: forall (n :: Nat) (sh :: [Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoSimplify s (TKS (n ': sh) r) -> AstNoSimplify s (TKS (Init (n ': sh)) r2) Source #

tsmaxIndex :: forall (n :: Nat) (sh :: [Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoSimplify s (TKS (n ': sh) r) -> AstNoSimplify s (TKS (Init (n ': sh)) r2) Source #

tsiota :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoSimplify s (TKS '[n] r) Source #

txfloor :: forall r r2 (sh :: [Maybe Nat]). (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoSimplify s (TKX sh r) -> AstNoSimplify s (TKX sh r2) Source #

txfromIntegral :: forall r1 r2 (sh :: [Maybe Nat]). (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoSimplify s (TKX sh r1) -> AstNoSimplify s (TKX sh r2) Source #

txcast :: forall r1 r2 (sh :: [Maybe Nat]). (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoSimplify s (TKX sh r1) -> AstNoSimplify s (TKX sh r2) Source #

txminIndex :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoSimplify s (TKX (mn ': sh) r) -> AstNoSimplify s (TKX (Init (mn ': sh)) r2) Source #

txmaxIndex :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) r r2. (GoodScalar r, GoodScalar r2) => AstNoSimplify s (TKX (mn ': sh) r) -> AstNoSimplify s (TKX (Init (mn ': sh)) r2) Source #

txiota :: forall (n :: Nat) r. (KnownNat n, GoodScalar r) => AstNoSimplify s (TKX '['Just n] r) Source #

tkfloor :: (GoodScalar r, RealFrac r, GoodScalar r2, Integral r2) => AstNoSimplify s ('TKScalar r) -> AstNoSimplify s ('TKScalar r2) Source #

tkfromIntegral :: (GoodScalar r1, Integral r1, GoodScalar r2) => AstNoSimplify s ('TKScalar r1) -> AstNoSimplify s ('TKScalar r2) Source #

tkcast :: (RealFrac r1, GoodScalar r1, RealFrac r2, GoodScalar r2) => AstNoSimplify s ('TKScalar r1) -> AstNoSimplify s ('TKScalar r2) Source #

trappend :: forall (n :: Natural) (x :: TK). KnownSTK x => AstNoSimplify s ('TKR2 (1 + n) x) -> AstNoSimplify s ('TKR2 (1 + n) x) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

trslice :: forall (n :: Natural) (x :: TK). KnownSTK x => Int -> Int -> AstNoSimplify s ('TKR2 (1 + n) x) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

trreverse :: forall (n :: Natural) (x :: TK). KnownSTK x => AstNoSimplify s ('TKR2 (1 + n) x) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

trtranspose :: forall (n :: Nat) (x :: TK). KnownSTK x => PermR -> AstNoSimplify s ('TKR2 n x) -> AstNoSimplify s ('TKR2 n x) Source #

trreshape :: forall (n :: Nat) (m :: Nat) (x :: TK). KnownSTK x => IShR m -> AstNoSimplify s ('TKR2 n x) -> AstNoSimplify s ('TKR2 m x) Source #

tsappend :: forall (m :: Nat) (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKS2 (m ': sh) x) -> AstNoSimplify s ('TKS2 (n ': sh) x) -> AstNoSimplify s ('TKS2 ((m + n) ': sh) x) Source #

tsslice :: forall (i :: Nat) (n :: Nat) (k :: Nat) (sh :: [Natural]) (x :: TK). KnownSTK x => SNat i -> SNat n -> SNat k -> AstNoSimplify s ('TKS2 (((i + n) + k) ': sh) x) -> AstNoSimplify s ('TKS2 (n ': sh) x) Source #

tsreverse :: forall (n :: Nat) (sh :: [Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKS2 (n ': sh) x) -> AstNoSimplify s ('TKS2 (n ': sh) x) Source #

tstranspose :: forall (perm :: [Natural]) (sh :: [Nat]) (x :: TK). (IsPermutation perm, Rank perm <= Rank sh, KnownSTK x) => Perm perm -> AstNoSimplify s ('TKS2 sh x) -> AstNoSimplify s ('TKS2 (PermutePrefix perm sh) x) Source #

tsreshape :: forall (sh :: [Natural]) (sh2 :: [Natural]) (x :: TK). (Product sh ~ Product sh2, KnownSTK x) => ShS sh2 -> AstNoSimplify s ('TKS2 sh x) -> AstNoSimplify s ('TKS2 sh2 x) Source #

txappend :: forall (m :: Nat) (n :: Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 ('Just m ': sh) x) -> AstNoSimplify s ('TKX2 ('Just n ': sh) x) -> AstNoSimplify s ('TKX2 ('Just (m + n) ': sh) x) Source #

txslice :: forall (i :: Nat) (n :: Nat) (k :: Nat) (sh :: [Maybe Natural]) (x :: TK). KnownSTK x => SNat i -> SNat n -> SNat k -> AstNoSimplify s ('TKX2 ('Just ((i + n) + k) ': sh) x) -> AstNoSimplify s ('TKX2 ('Just n ': sh) x) Source #

txreverse :: forall (mn :: Maybe Nat) (sh :: [Maybe Nat]) (x :: TK). KnownSTK x => AstNoSimplify s ('TKX2 (mn ': sh) x) -> AstNoSimplify s ('TKX2 (mn ': sh) x) Source #

txtranspose :: forall (perm :: [Natural]) (sh :: [Maybe Nat]) (x :: TK). (IsPermutation perm, Rank perm <= Rank sh, KnownSTK x) => Perm perm -> AstNoSimplify s ('TKX2 sh x) -> AstNoSimplify s ('TKX2 (PermutePrefix perm sh) x) Source #

txreshape :: forall (sh :: [Maybe Nat]) (sh2 :: [Maybe Nat]) (x :: TK). KnownSTK x => IShX sh2 -> AstNoSimplify s ('TKX2 sh x) -> AstNoSimplify s ('TKX2 sh2 x) Source #

trbuild1 :: forall (n :: Nat) (x :: TK). (KnownNat n, KnownSTK x) => Int -> (IntOf (AstNoSimplify s) -> AstNoSimplify s ('TKR2 n x)) -> AstNoSimplify s ('TKR2 (1 + n) x) Source #

trmap0N :: forall (n :: Nat) (x :: TK) (x1 :: TK). (KnownNat n, KnownSTK x, KnownSTK x1) => (AstNoSimplify s ('TKR2 0 x1) -> AstNoSimplify s ('TKR2 0 x)) -> AstNoSimplify s ('TKR2 n x1) -> AstNoSimplify s ('TKR2 n x) Source #

trzipWith0N :: forall (n :: Nat) (x :: TK) (x1 :: TK) (x2 :: TK). (KnownNat n, KnownSTK x, KnownSTK x1, KnownSTK x2) => (AstNoSimplify s ('TKR2 0 x1) -> AstNoSimplify s ('TKR2 0 x2) -> AstNoSimplify s ('TKR2 0 x)) -> AstNoSimplify s ('TKR2 n x1) -> AstNoSimplify s ('TKR2 n x2) -> AstNoSimplify s ('TKR2 n x) Source #

tsbuild1 :: forall (k :: Nat) (sh :: [Nat]) (x :: TK). (KnownNat k, KnownShS sh, KnownSTK x) => (IntOf (AstNoSimplify s) -> AstNoSimplify s ('TKS2 sh x)) -> AstNoSimplify s ('TKS2 (k ': sh) x) Source #

tsmap0N :: forall (sh :: [Nat]) (x :: TK) (x1 :: TK). (KnownShS sh, KnownSTK x, KnownSTK x1) => (AstNoSimplify s ('TKS2 ('[] :: [Nat]) x1) -> AstNoSimplify s ('TKS2 ('[] :: [Nat]) x)) -> AstNoSimplify s ('TKS2 sh x1) -> AstNoSimplify s ('TKS2 sh x) Source #

tszipWith0N :: forall (sh :: [Nat]) (x :: TK) (x1 :: TK) (x2 :: TK). (KnownShS sh, KnownSTK x, KnownSTK x1, KnownSTK x2) => (AstNoSimplify s ('TKS2 ('[] :: [Nat]) x1) -> AstNoSimplify s ('TKS2 ('[] :: [Nat]) x2) -> AstNoSimplify s ('TKS2 ('[] :: [Nat]) x)) -> AstNoSimplify s ('TKS2 sh x1) -> AstNoSimplify s ('TKS2 sh x2) -> AstNoSimplify s ('TKS2 sh x) Source #

txbuild1 :: forall (k :: Nat) (sh :: [Maybe Nat]) (x :: TK). (KnownNat k, KnownShX sh, KnownSTK x) => (IntOf (AstNoSimplify s) -> AstNoSimplify s ('TKX2 sh x)) -> AstNoSimplify s ('TKX2 ('Just k ': sh) x) Source #

tbuild1 :: forall (y :: TK) (k :: Nat). ConvertTensor (AstNoSimplify s) => SNat k -> SingletonTK y -> (IntOf (AstNoSimplify s) -> AstNoSimplify s y) -> AstNoSimplify s (BuildTensorKind k y) Source #

tmapAccumRDer :: forall (accy :: TK) (by :: TK) (ey :: TK) (k :: Nat). Proxy (AstNoSimplify s) -> SNat k -> FullShapeTK accy -> FullShapeTK by -> FullShapeTK ey -> HFunOf (AstNoSimplify s) ('TKProduct accy ey) ('TKProduct accy by) -> HFunOf (AstNoSimplify s) ('TKProduct (ADTensorKind ('TKProduct accy ey)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy by)) -> HFunOf (AstNoSimplify s) ('TKProduct (ADTensorKind ('TKProduct accy by)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy ey)) -> AstNoSimplify s accy -> AstNoSimplify s (BuildTensorKind k ey) -> AstNoSimplify s ('TKProduct accy (BuildTensorKind k by)) Source #

tmapAccumLDer :: forall (accy :: TK) (by :: TK) (ey :: TK) (k :: Nat). Proxy (AstNoSimplify s) -> SNat k -> FullShapeTK accy -> FullShapeTK by -> FullShapeTK ey -> HFunOf (AstNoSimplify s) ('TKProduct accy ey) ('TKProduct accy by) -> HFunOf (AstNoSimplify s) ('TKProduct (ADTensorKind ('TKProduct accy ey)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy by)) -> HFunOf (AstNoSimplify s) ('TKProduct (ADTensorKind ('TKProduct accy by)) ('TKProduct accy ey)) (ADTensorKind ('TKProduct accy ey)) -> AstNoSimplify s accy -> AstNoSimplify s (BuildTensorKind k ey) -> AstNoSimplify s ('TKProduct accy (BuildTensorKind k by)) Source #

tApply :: forall (x :: TK) (z :: TK). HFunOf (AstNoSimplify s) x z -> AstNoSimplify s x -> AstNoSimplify s z Source #

tlambda :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstNoSimplify s) x z Source #

tgrad :: forall (x :: TK) r. FullShapeTK x -> HFun x ('TKScalar r) -> HFunOf (AstNoSimplify s) x (ADTensorKind x) Source #

tvjp :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstNoSimplify s) ('TKProduct (ADTensorKind z) x) (ADTensorKind x) Source #

tjvp :: forall (x :: TK) (z :: TK). FullShapeTK x -> HFun x z -> HFunOf (AstNoSimplify s) ('TKProduct (ADTensorKind x) x) (ADTensorKind z) Source #

tprimalPart :: forall (y :: TK). AstNoSimplify s y -> PrimalOf (AstNoSimplify s) y Source #

tdualPart :: forall (y :: TK). SingletonTK y -> AstNoSimplify s y -> DualOf (AstNoSimplify s) y Source #

tfromPrimal :: forall (y :: TK). SingletonTK y -> PrimalOf (AstNoSimplify s) y -> AstNoSimplify s y Source #

tfromDual :: forall (y :: TK). DualOf (AstNoSimplify s) y -> AstNoSimplify s y Source #

tScale :: forall (y :: TK). (Num (AstNoSimplify s y), Num (PrimalOf (AstNoSimplify s) y)) => SingletonTK y -> PrimalOf (AstNoSimplify s) y -> DualOf (AstNoSimplify s) y -> DualOf (AstNoSimplify s) y Source #

tsum :: forall (z :: TK) (k :: Nat). ConvertTensor (AstNoSimplify s) => SNat k -> SingletonTK z -> AstNoSimplify s (BuildTensorKind k z) -> AstNoSimplify s z Source #

treplicate :: forall (z :: TK) (k :: Nat). ConvertTensor (AstNoSimplify s) => SNat k -> SingletonTK z -> AstNoSimplify s z -> AstNoSimplify s (BuildTensorKind k z) Source #

tindexBuild :: forall (z :: TK) (k :: Nat). ConvertTensor (AstNoSimplify s) => SNat k -> SingletonTK z -> AstNoSimplify s (BuildTensorKind k z) -> IntOf (AstNoSimplify s) -> AstNoSimplify s z Source #

treplTarget :: forall (y :: TK). (forall r. GoodScalar r => r) -> FullShapeTK y -> AstNoSimplify s y Source #

tdefTarget :: forall (y :: TK). FullShapeTK y -> AstNoSimplify s y Source #

taddTarget :: forall (y :: TK). SingletonTK y -> AstNoSimplify s y -> AstNoSimplify s y -> AstNoSimplify s y Source #

tmultTarget :: forall (y :: TK). SingletonTK y -> AstNoSimplify s y -> AstNoSimplify s y -> AstNoSimplify s y Source #

tsum0Target :: forall (y :: TK). FullShapeTK y -> AstNoSimplify s y -> AstNoSimplify s ('TKScalar Double) Source #

tdot0Target :: forall (y :: TK). FullShapeTK y -> AstNoSimplify s y -> AstNoSimplify s y -> AstNoSimplify s ('TKScalar Double) Source #

xmcast :: forall (x :: TK) (sh :: [Maybe Nat]) (sh2 :: [Maybe Nat]). (KnownSTK x, KnownShX sh, Rank sh ~ Rank sh2, ConvertTensor (AstNoSimplify s)) => StaticShX sh2 -> AstNoSimplify s ('TKX2 sh x) -> AstNoSimplify s ('TKX2 sh2 x) Source #

AstSpan s => LetTensor (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.OpsAst

Methods

ttlet :: forall (x :: TK) (z :: TK). AstNoSimplify s x -> (AstNoSimplify s x -> AstNoSimplify s z) -> AstNoSimplify s z Source #

ttletPrimal :: forall (x :: TK) (z :: TK). PrimalOf (AstNoSimplify s) x -> (PrimalOf (AstNoSimplify s) x -> AstNoSimplify s z) -> AstNoSimplify s z Source #

toShare :: forall (y :: TK). AstNoSimplify s y -> ShareOf (AstNoSimplify s) y Source #

tunshare :: forall (y :: TK). ShareOf (AstNoSimplify s) y -> AstNoSimplify s y Source #

tappend :: forall (m :: Nat) (n :: Nat) (y :: TK). BaseTensor (AstNoSimplify s) => SNat m -> SNat n -> SingletonTK y -> AstNoSimplify s (BuildTensorKind m y) -> AstNoSimplify s (BuildTensorKind n y) -> AstNoSimplify s (BuildTensorKind (m + n) y) Source #

tD :: forall (y :: TK). BaseTensor (AstNoSimplify s) => SingletonTK y -> PrimalOf (AstNoSimplify s) y -> DualOf (AstNoSimplify s) y -> AstNoSimplify s y Source #

tfold :: forall (yn :: TK) (ym :: TK) (k :: Nat). BaseTensor (AstNoSimplify s) => SNat k -> SingletonTK yn -> SingletonTK ym -> (forall (f :: Target). ADReady f => f yn -> f ym -> f yn) -> AstNoSimplify s yn -> AstNoSimplify s (BuildTensorKind k ym) -> AstNoSimplify s yn Source #

tscan :: forall (yn :: TK) (ym :: TK) (k :: Nat). BaseTensor (AstNoSimplify s) => SNat k -> SingletonTK yn -> SingletonTK ym -> (forall (f :: Target). ADReady f => f yn -> f ym -> f yn) -> AstNoSimplify s yn -> AstNoSimplify s (BuildTensorKind k ym) -> AstNoSimplify s (BuildTensorKind (1 + k) yn) Source #

EqH (AstTensor 'AstMethodLet s) y => EqH (AstNoSimplify s) y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

OrdH (AstTensor 'AstMethodLet s) y => OrdH (AstNoSimplify s) y Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Floating (AstTensor 'AstMethodLet s y) => Floating (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Num (AstTensor 'AstMethodLet s y) => Num (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Fractional (AstTensor 'AstMethodLet s y) => Fractional (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Show (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Eq (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

Methods

(==) :: AstNoSimplify s y -> AstNoSimplify s y -> Bool #

(/=) :: AstNoSimplify s y -> AstNoSimplify s y -> Bool #

Ord (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

IntegralH (AstTensor 'AstMethodLet s y) => IntegralH (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

RealFloatH (AstTensor 'AstMethodLet s y) => RealFloatH (AstNoSimplify s y) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type BoolOf (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type DualOf (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type PrimalOf (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type ShareOf (AstNoSimplify s) Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type HFunOf (AstNoSimplify s) x z Source # 
Instance details

Defined in HordeAd.Core.CarriersAst

type HFunOf (AstNoSimplify s) x z = AstHFun s s x z

sunReplicateScal :: forall a (sh :: [Nat]). Elt a => Shaped sh a -> Maybe a Source #

sunReplicate1 :: forall a (n :: Nat) (sh :: [Nat]). Elt a => Shaped (n ': sh) a -> Maybe (Shaped sh a) Source #

sunReplicateN :: forall a (shm :: [Nat]) (shn :: [Nat]). Elt a => ShS shm -> Shaped (shm ++ shn) a -> Maybe (Shaped shn a) Source #

Orphan instances

Boolean (AstBool ms) Source # 
Instance details

Methods

true :: AstBool ms #

false :: AstBool ms #

notB :: AstBool ms -> AstBool ms #

(&&*) :: AstBool ms -> AstBool ms -> AstBool ms #

(||*) :: AstBool ms -> AstBool ms -> AstBool ms #

(AstSpan s, GoodScalar r) => EqH (AstTensor ms s) ('TKScalar r) Source # 
Instance details

Methods

(==.) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> BoolOf (AstTensor ms s) Source #

(/=.) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => OrdH (AstTensor ms s) ('TKScalar r) Source # 
Instance details

Methods

(<.) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> BoolOf (AstTensor ms s) Source #

(<=.) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> BoolOf (AstTensor ms s) Source #

(>.) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> BoolOf (AstTensor ms s) Source #

(>=.) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => EqH (AstTensor ms s) (TKR n r) Source # 
Instance details

Methods

(==.) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> BoolOf (AstTensor ms s) Source #

(/=.) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => EqH (AstTensor ms s) (TKS sh r) Source # 
Instance details

Methods

(==.) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> BoolOf (AstTensor ms s) Source #

(/=.) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => EqH (AstTensor ms s) (TKX sh r) Source # 
Instance details

Methods

(==.) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> BoolOf (AstTensor ms s) Source #

(/=.) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => OrdH (AstTensor ms s) (TKR n r) Source # 
Instance details

Methods

(<.) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> BoolOf (AstTensor ms s) Source #

(<=.) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> BoolOf (AstTensor ms s) Source #

(>.) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> BoolOf (AstTensor ms s) Source #

(>=.) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => OrdH (AstTensor ms s) (TKS sh r) Source # 
Instance details

Methods

(<.) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> BoolOf (AstTensor ms s) Source #

(<=.) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> BoolOf (AstTensor ms s) Source #

(>.) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> BoolOf (AstTensor ms s) Source #

(>=.) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> BoolOf (AstTensor ms s) Source #

(AstSpan s, GoodScalar r) => OrdH (AstTensor ms s) (TKX sh r) Source # 
Instance details

Methods

(<.) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> BoolOf (AstTensor ms s) Source #

(<=.) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> BoolOf (AstTensor ms s) Source #

(>.) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> BoolOf (AstTensor ms s) Source #

(>=.) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> BoolOf (AstTensor ms s) Source #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Floating (AstTensor ms s (TKR n r)) Source # 
Instance details

Methods

pi :: AstTensor ms s (TKR n r) #

exp :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

log :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

sqrt :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

(**) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

logBase :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

sin :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

cos :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

tan :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

asin :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

acos :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

atan :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

sinh :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

cosh :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

tanh :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

asinh :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

acosh :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

atanh :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

log1p :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

expm1 :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

log1pexp :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

log1mexp :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Floating (AstTensor ms s (TKS sh r)) Source # 
Instance details

Methods

pi :: AstTensor ms s (TKS sh r) #

exp :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

log :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

sqrt :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

(**) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

logBase :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

sin :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

cos :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

tan :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

asin :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

acos :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

atan :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

sinh :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

cosh :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

tanh :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

asinh :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

acosh :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

atanh :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

log1p :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

expm1 :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

log1pexp :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

log1mexp :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Floating (AstTensor ms s ('TKScalar r)) Source # 
Instance details

Methods

pi :: AstTensor ms s ('TKScalar r) #

exp :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

log :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

sqrt :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

(**) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

logBase :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

sin :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

cos :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

tan :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

asin :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

acos :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

atan :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

sinh :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

cosh :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

tanh :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

asinh :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

acosh :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

atanh :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

log1p :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

expm1 :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

log1pexp :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

log1mexp :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Floating (AstTensor ms s (TKX sh r)) Source # 
Instance details

Methods

pi :: AstTensor ms s (TKX sh r) #

exp :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

log :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

sqrt :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

(**) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

logBase :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

sin :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

cos :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

tan :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

asin :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

acos :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

atan :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

sinh :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

cosh :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

tanh :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

asinh :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

acosh :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

atanh :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

log1p :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

expm1 :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

log1pexp :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

log1mexp :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

(GoodScalar r, AstSpan s) => Num (AstTensor ms s (TKR n r)) Source # 
Instance details

Methods

(+) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

(-) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

(*) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

negate :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

abs :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

signum :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

fromInteger :: Integer -> AstTensor ms s (TKR n r) #

(GoodScalar r, AstSpan s) => Num (AstTensor ms s (TKS sh r)) Source # 
Instance details

Methods

(+) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

(-) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

(*) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

negate :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

abs :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

signum :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

fromInteger :: Integer -> AstTensor ms s (TKS sh r) #

(GoodScalar r, AstSpan s) => Num (AstTensor ms s ('TKScalar r)) Source #

Integer terms need to be simplified, because large ones are sometimes created due to vectorization, e.g., via astTransposeAsGather or astReshapeAsGather and can be a deciding factor in whether the other tensor terms can be simplified in turn.

The normal form has AstConcreteK, if any, as the first argument of the constructor. No flattening is performed beyond that.

Instance details

Methods

(+) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

(-) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

(*) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

negate :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

abs :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

signum :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

fromInteger :: Integer -> AstTensor ms s ('TKScalar r) #

(GoodScalar r, AstSpan s) => Num (AstTensor ms s (TKX sh r)) Source # 
Instance details

Methods

(+) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

(-) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

(*) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

negate :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

abs :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

signum :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

fromInteger :: Integer -> AstTensor ms s (TKX sh r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Fractional (AstTensor ms s (TKR n r)) Source # 
Instance details

Methods

(/) :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

recip :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) #

fromRational :: Rational -> AstTensor ms s (TKR n r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Fractional (AstTensor ms s (TKS sh r)) Source # 
Instance details

Methods

(/) :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

recip :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) #

fromRational :: Rational -> AstTensor ms s (TKS sh r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Fractional (AstTensor ms s ('TKScalar r)) Source # 
Instance details

Methods

(/) :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

recip :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) #

fromRational :: Rational -> AstTensor ms s ('TKScalar r) #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => Fractional (AstTensor ms s (TKX sh r)) Source # 
Instance details

Methods

(/) :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

recip :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) #

fromRational :: Rational -> AstTensor ms s (TKX sh r) #

Eq (AstTensor ms s y) Source # 
Instance details

Methods

(==) :: AstTensor ms s y -> AstTensor ms s y -> Bool #

(/=) :: AstTensor ms s y -> AstTensor ms s y -> Bool #

Ord (AstTensor ms s y) Source # 
Instance details

Methods

compare :: AstTensor ms s y -> AstTensor ms s y -> Ordering #

(<) :: AstTensor ms s y -> AstTensor ms s y -> Bool #

(<=) :: AstTensor ms s y -> AstTensor ms s y -> Bool #

(>) :: AstTensor ms s y -> AstTensor ms s y -> Bool #

(>=) :: AstTensor ms s y -> AstTensor ms s y -> Bool #

max :: AstTensor ms s y -> AstTensor ms s y -> AstTensor ms s y #

min :: AstTensor ms s y -> AstTensor ms s y -> AstTensor ms s y #

(GoodScalar r, IntegralH r, IntElt r, AstSpan s) => IntegralH (AstTensor ms s (TKR n r)) Source # 
Instance details

Methods

quotH :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) Source #

remH :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) Source #

(GoodScalar r, IntegralH r, IntElt r, AstSpan s) => IntegralH (AstTensor ms s (TKS sh r)) Source # 
Instance details

Methods

quotH :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) Source #

remH :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) Source #

(GoodScalar r, IntegralH r, IntElt r, AstSpan s) => IntegralH (AstTensor ms s ('TKScalar r)) Source # 
Instance details

Methods

quotH :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) Source #

remH :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) Source #

(GoodScalar r, IntegralH r, IntElt r, AstSpan s) => IntegralH (AstTensor ms s (TKX sh r)) Source # 
Instance details

Methods

quotH :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) Source #

remH :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) Source #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => RealFloatH (AstTensor ms s (TKR n r)) Source # 
Instance details

Methods

atan2H :: AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) -> AstTensor ms s (TKR n r) Source #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => RealFloatH (AstTensor ms s (TKS sh r)) Source # 
Instance details

Methods

atan2H :: AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) -> AstTensor ms s (TKS sh r) Source #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => RealFloatH (AstTensor ms s ('TKScalar r)) Source # 
Instance details

Methods

atan2H :: AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) -> AstTensor ms s ('TKScalar r) Source #

(GoodScalar r, RealFloatH r, FloatElt r, AstSpan s) => RealFloatH (AstTensor ms s (TKX sh r)) Source # 
Instance details

Methods

atan2H :: AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) -> AstTensor ms s (TKX sh r) Source #