mnn::tensor

Trait TensorType

Source
pub trait TensorType: Sealed {
    type H;

    // Required methods
    fn owned() -> bool;
    fn host() -> bool;

    // Provided methods
    fn borrowed() -> bool { ... }
    fn device() -> bool { ... }
}
Expand description

A trait to represent the type of a tensor

Required Associated Types§

Source

type H

The halide type of the tensor

Required Methods§

Source

fn owned() -> bool

Check if the tensor is owned

Source

fn host() -> bool

Check if the tensor is allocated in the host

Provided Methods§

Source

fn borrowed() -> bool

Check if the tensor is borrowed

Source

fn device() -> bool

Check if the tensor is allocated in the device

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<H: HalideType> TensorType for Device<H>

Source§

type H = H

Source§

impl<H: HalideType> TensorType for Host<H>

Source§

type H = H

Source§

impl<T: TensorType> TensorType for Ref<'_, T>

Source§

type H = <T as TensorType>::H

Source§

impl<T: TensorType> TensorType for RefMut<'_, T>

Source§

type H = <T as TensorType>::H