A combination of pre provided indexes and a tensor. The provided indexes reduce the
dimensionality of the TensorRef exposed to less than the dimensionality of the TensorRef
this is created from.
use easy_ml::tensors::Tensor;
use easy_ml::tensors::views::{TensorView, TensorIndex};
let vector = Tensor::from([("a", 2)], vec![ 16, 8 ]);
let scalar = vector.select([("a", 0)]);
let also_scalar = TensorView::from(TensorIndex::from(&vector, [("a", 0)]));
assert_eq!(scalar.index_by([]).get([]), also_scalar.index_by([]).get([]));
assert_eq!(scalar.index_by([]).get([]), 16);
Note: due to limitations in Rust’s const generics support, TensorIndex only implements TensorRef
for D from 1 to 6.
Creates a TensorIndex from a source and a list of provided dimension name/index pairs.
The corresponding dimensions in the source will be masked to always return the provided
index. Henece, a matrix can be viewed as a vector if you provide one of the row/column
index to use. More generally, the tensor the TensorIndex exposes will have a dimensionality
of D - I, where D is the dimensionality of the source, and I is the dimensionality of the
provided indexes.
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more
The shape this tensor has. See dimensions for an overview.
The product of the lengths in the pairs define how many elements are in the tensor
(or the portion of it that is visible).
The way the data in this tensor is laid out in memory. In particular,
Linear has several requirements on what is returned that must be upheld
by implementations of this trait. Read more