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

Object Safety§

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