Shape#
A Shape
is used in expressing the shape of a certain entity in Legate. The
reason Legate introduces this indirection to the shape metadata is that stores
in Legate can have unknown shapes at creation time; the shape of an unbound
store is determined only when the producer task finishes. The shape object can
help the runtime query the store’s metadata or construct another store
isomorphic to the store without getting blocked.
Shape objects should behave just like an array of integers, but operations that introspect the values implicitly block on completion of the producer task.
|
Constructs a new shape object |
Properties#
Returns the extents of the shape in a tuple |
|
Indicates whether the shape's extents are already computed |
|
Dimension of the shape. |
|
Returns the shape's volume |
|
Returns a sum of the extents |
|
Computes strides of the shape. |
Manipulation Methods#
|
Removes a dimension from the shape |
|
Replaces the extent of a dimension with a new extent |
|
Replaces a dimension with multiple dimensions |
|
Inserts a new dimension |
|
Applies a mapping to each extent in the shape |
Arithmetic and comparison#
|
Checks whether the shape is identical to a given shape |
|
Returns the result of element-wise |
|
Returns the result of element-wise |
|
Returns the result of element-wise |
|
Returns the result of element-wise |
|
Returns an element-wise addition of the shapes |
|
Returns an element-wise subtraction between the shapes |
|
Returns an element-wise multiplication of the shapes |
|
Returns the result of element-wise modulo operation |
|
Returns the result of element-wise integer division |