class Bint[source]

Bases: object

Factory for bounded integer types:

Bint[5]           # integers ranging in {0,1,2,3,4}
Bint[2, 3, 3]     # 3x3 matrices with entries in {0,1}
dtype = None
shape = None
class BintType[source]

Bases: ArrayType

property size
class Dependent(fn)[source]

Bases: object

Type hint for dependently type-decorated functions.


Dependent[Real]  # a constant known domain
Dependent[lambda x: Array[x.dtype, x.shape[1:]]  # args are Domains
Dependent[lambda x, y: Bint[x.size + y.size]]

fn (callable) – A lambda taking named arguments (in any order) which will be filled in with the domain of the similarly named funsor argument to the decorated function. This lambda should compute a desired resulting domain given domains of arguments.


alias of type

class Real

Bases: object

shape = ()
class Reals[source]

Bases: object

Type of a real-valued array with known shape:

Reals[()] = Real  # scalar
Reals[8]          # vector of length 8
Reals[3, 3]       # 3x3 matrix
shape = None
class RealsType[source]

Bases: ArrayType

dtype = 'real'
find_domain(op, *domains)[source]
find_domain(op: UnaryOp, domain)
find_domain(op: AstypeOp, domain)
find_domain(op: ExpOp, domain)
find_domain(op: LogOp, domain)
find_domain(op: ReductionOp, domain)
find_domain(op: ReshapeOp, domain)
find_domain(op: GetitemOp, lhs_domain, rhs_domain)
find_domain(op: GetsliceOp, domain)
find_domain(op: BinaryOp, lhs, rhs)
find_domain(op: ComparisonOp, lhs, rhs)
find_domain(op: FloordivOp, lhs, rhs)
find_domain(op: ModOp, lhs, rhs)
find_domain(op: MatmulOp, lhs, rhs)
find_domain(op: AssociativeOp, *domains)
find_domain(op: WrappedTransformOp, domain)
find_domain(op: LogAbsDetJacobianOp, domain, codomain)
find_domain(op: StackOp, parts)
find_domain(op: CatOp, parts)
find_domain(op: EinsumOp, operands)

Finds the Domain resulting when applying op to domains. :param callable op: An operation. :param Domain *domains: One or more input domains.