NDArray¶
Lazily evaluated array. An array is a stateful (partial) closure consisting of three basic components:
a formal argument list
an expression
an environment
1) and 3) are stored in a single capture list, where the value None represents items in the argument list. Arguments can be instantiated and moved into its environment. This process is monotonic, that is, the environment cannot be modified by operations other than instantiation of the arguments.
-
lappy.ndarray.
ndim
¶ number of dimensions specified as an
Unsigned
. At the moment, only concrete ndim is supported, i.e., ndim.value must be known.
-
lappy.ndarray.
shape
¶ overall shape of array expression. Tuple of
str
with length equal tondim
. Each component of the tuple is the name of a lazy object in the namespace.
-
lappy.ndarray.
inames
¶ index names for iterating over the array. Tuple of
pymbolic.Variable
’s.
-
lappy.ndarray.
domain_expr
¶ set expression for constructing the loop domain. A set expression has leafs of
lappy.core.primitives.PwAff
variables and integers. The domain expression is trivial if it equals to the set of indices of the array elements (no “hidden” axes).
-
lappy.ndarray.
dtype
¶ data type, either None or convertible to loopy type. Lappy does not allow implicit type casting.
-
lappy.ndarray.
is_integral
¶ a
bool
indicating whether array elements are integers
-
lappy.ndarray.
integer_domain
¶ an ISL set if is_integral is True, otherwise None. The set represents the domain for the full array. It is used to express conditions like non-negative integers, multiples of two, etc.