taco-0.3.0.0: Tensor Algebra COmpiler

Safe HaskellNone
LanguageHaskell2010

Data.Tensor.Compiler

Contents

Synopsis

Syntax

data Phoas a Source #

Parametric higher-order abstract syntax (PHOAS), after B. Oliveira, A. Loeh, `Abstract Syntax Graphs for Domain Specific Languages`

eval :: Phoas a -> a Source #

Semantic function for evaluation

var :: a -> Phoas a Source #

Inject a constant into the abstract syntax

let_ :: Phoas a -> (a -> Phoas b) -> Phoas b Source #

Bind a variable into a closure

let2_ :: Phoas a -> Phoas b -> (a -> b -> Phoas c) -> Phoas c Source #

Bind two variables into a closure

Exceptions

data CException Source #

Tensor contraction

Inject two Tensor constant into Vars, while ensuring that all the contraction indices are compatible with those of the tensors.

Throws a CException if any index is nonnegative or too large for the shape of the given tensor.

Exceptions