Skip to main content

DLTensorExt

Trait DLTensorExt 

Source
pub trait DLTensorExt {
    // Required method
    unsafe fn numel(&self) -> usize;
}
Expand description

Size queries on a DLTensor.

Required Methods§

Source

unsafe fn numel(&self) -> usize

The number of elements: the product of the shape, 1 for a scalar.

§Safety

shape points to ndim extents, or ndim is 0.

§Panics

If an extent is negative or the product overflows usize.

Implementations on Foreign Types§

Source§

impl DLTensorExt for DLTensor

Source§

unsafe fn numel(&self) -> usize

Implementors§