Expand description
tensor
dialect.
The tensor
dialect is intended to hold core tensor creation and
manipulation ops, which are not strongly associated with any particular
other dialect or domain abstraction. The primary smoke test of this is ops
that make sense for any tensor element type.
We leave it to other dialects to hold the vast swath of possible computations one might want to do on a tensor.
The tensor
type is (for better or for worse) used to represent all kinds
of things, and supports an open-ended set of element types. Examples:
- representing large, dense aggregations of primitive types, suitable for high-performance numerical computing.
- representing shapes in the
shape
dialect, which consist of small 1D tensors ofindex
data type. - representing aggregations of strings or “variant” types.
- representing large, sparse aggregations of primitive types, suitable for high-performance numerical computing.
Thus, for the tensor
dialect, we prefer for now to constrain the
scope as much as possible. The expectation is that at some point
in the future, the tensor
dialect’s scope may be broadened through a
careful discussion of the tradeoffs.
The tensor
type is actually a builtin type (it lives in the builtin
dialect), and does not live in this dialect.
Structs
- A
bitcast
operation. Tensor bitcast operation. - A builder for a
bitcast
operation. - A
cast
operation. Tensor cast operation. - A builder for a
cast
operation. - A
collapse_shape
operation. Operation to produce a tensor with a smaller rank. - A builder for a
collapse_shape
operation. - A
dim
operation. Dimension index operation. - A builder for a
dim
operation. - An
empty
operation. Empty tensor operation. - A builder for an
empty
operation. - An
expand_shape
operation. Operation to produce a tensor with a higher rank. - A builder for an
expand_shape
operation. - An
extract
operation. Element extraction operation. - A builder for an
extract
operation. - An
extract_slice
operation. Extract slice operation. - A builder for an
extract_slice
operation. - A
from_elements
operation. Tensor from elements operation.. - A builder for a
from_elements
operation. - A
gather
operation. Gather a subset of a tensor at specified indices. - A builder for a
gather
operation. - A
generate
operation. Creates a dynamically sized tensor from elements. - A builder for a
generate
operation. - An
insert
operation. Element insertion operation. - A builder for an
insert
operation. - An
insert_slice
operation. Insert_slice operation. - A builder for an
insert_slice
operation. - A
pack
operation. Tensor pack operation. - A builder for a
pack
operation. - A
pad
operation. Tensor pad operation. - A builder for a
pad
operation. - A
parallel_insert_slice
operation. Specify the tensor slice update of a single thread of a parent ParallelCombiningOpInterface op. . - A builder for a
parallel_insert_slice
operation. - A
rank
operation. Rank operation. - A builder for a
rank
operation. - A
reshape
operation. Tensor reshape operation. - A builder for a
reshape
operation. - A
scatter
operation. Scatter a tensor into a destination tensor at specified indices. - A builder for a
scatter
operation. - A
splat
operation. Tensor splat or broadcast operation. - A builder for a
splat
operation. - An
unpack
operation. Tensor unpack operation. - A builder for an
unpack
operation. - A
yield
operation. Yield a value from a region. - A builder for a
yield
operation.
Functions
- Creates a
bitcast
operation. - Creates a
cast
operation. - Creates a
collapse_shape
operation. - Creates a
dim
operation. - Creates an
empty
operation. - Creates an
expand_shape
operation. - Creates an
extract
operation. - Creates an
extract_slice
operation. - Creates a
from_elements
operation. - Creates a
gather
operation. - Creates a
generate
operation. - Creates an
insert
operation. - Creates an
insert_slice
operation. - Creates a
pack
operation. - Creates a
pad
operation. - Creates a
parallel_insert_slice
operation. - Creates a
rank
operation. - Creates a
reshape
operation. - Creates a
scatter
operation. - Creates a
splat
operation. - Creates an
unpack
operation. - Creates a
yield
operation.