Trait hotg_rune_core::TensorList
source · [−]pub trait TensorList<'a> {
type ShapeBuffer: AsRef<[Shape<'a>]>;
type ConstElementPtrBuffer: AsRef<[*const u8]>;
fn shape_list(&self) -> Self::ShapeBuffer;
fn element_ptr(&self) -> Self::ConstElementPtrBuffer;
}
Expand description
A helper trait which lets us get the shape from a tuple of different tensors.
Note that this is implemented for references (i.e. &Tensor<i16>
and
&(Tensor<f32>, Tensor<u8>)
) so we can carry the lifetime around. Having
access to the lifetime means we can borrow from the Shape
’s dimension
array instead of cloning them.
Associated Types
Required methods
fn shape_list(&self) -> Self::ShapeBuffer
fn shape_list(&self) -> Self::ShapeBuffer
fn element_ptr(&self) -> Self::ConstElementPtrBuffer
fn element_ptr(&self) -> Self::ConstElementPtrBuffer
Get an array containing pointers to the elements of each Tensor
in
this tuple.