Trait rten_tensor::Alloc

source ·
pub trait Alloc {
    // Required method
    fn alloc<T>(&self, capacity: usize) -> Vec<T>;
}
Expand description

Storage allocation trait.

This is used by various methods on TensorBase with an _in suffix, which allow the caller to control the allocation of the data buffer for the returned owned tensor.

Required Methods§

source

fn alloc<T>(&self, capacity: usize) -> Vec<T>

Allocate storage for an owned tensor.

The returned Vec should be empty but have the given capacity.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A: Alloc> Alloc for &A

source§

fn alloc<T>(&self, capacity: usize) -> Vec<T>

Implementors§