Domains¶
-
Domain
¶ alias of
builtins.type
-
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
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
Dependent
(fn)[source]¶ Bases:
object
Type hint for dependently type-decorated functions.
Examples:
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]]
Parameters: 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.