[][src]Trait math::tensor::ShapableData

pub trait ShapableData<Dtype> {
    pub fn data(&self) -> &Vec<Dtype>;
pub fn shape(&self) -> &TensorShape;
pub fn shape_mut(&mut self) -> &mut TensorShape; pub fn t(&self) -> EphemeralView<'_, Dtype> { ... }
pub fn transpose(&self, axes: Vec<AxisIndex>) -> EphemeralView<'_, Dtype> { ... } }

The implementer provides an interface for the underlying data and shape.

Required methods

pub fn data(&self) -> &Vec<Dtype>[src]

Returns the underlying data.

pub fn shape(&self) -> &TensorShape[src]

Returns the shape associated with the data.

pub fn shape_mut(&mut self) -> &mut TensorShape[src]

Returns a mutable shape associated with the data.

Loading content...

Provided methods

pub fn t(&self) -> EphemeralView<'_, Dtype>[src]

Reverses the axes.

pub fn transpose(&self, axes: Vec<AxisIndex>) -> EphemeralView<'_, Dtype>[src]

Arguments

  • axes - Must be the same length as self.shape().ndim(). For each i, axes[i] = j means that the original j-th axis will be at the i-th axis in the new shape.
Loading content...

Implementors

impl<'a, Dtype> ShapableData<Dtype> for EphemeralView<'a, Dtype>[src]

An EphemeralView provides an interface for the underlying data and shape.

impl<Dtype> ShapableData<Dtype> for Tensor<Dtype>[src]

A Tensor provides an interface for the underlying data and shape.

Loading content...