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

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

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

Required methods

fn data(&self) -> &Vec<Dtype>

Returns the underlying data.

fn shape(&self) -> &TensorShape

Returns the shape associated with the data.

fn shape_mut(&mut self) -> &mut TensorShape

Returns a mutable shape associated with the data.

Loading content...

Provided methods

fn t(&self) -> EphemeralView<Dtype>

Reverses the axes.

fn transpose(&self, axes: Vec<usize>) -> EphemeralView<Dtype>

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...