Skip to main content

Dims64

Struct Dims64 

Source
#[repr(C)]
pub struct Dims64 { pub nbDims: i32, pub d: [i64; 8], }
Expand description

Dims Structure to define the dimensions of a tensor.

TensorRT can also return an “invalid dims” structure. This structure is represented by nbDims == -1 and d[i] == 0 for all i.

TensorRT can also return an “unknown rank” dims structure. This structure is represented by nbDims == -1 and d[i] == -1 for all i.

Fields§

§nbDims: i32

The rank (number of dimensions).

§d: [i64; 8]

The extent of each dimension.

Implementations§

Source§

impl Dims64

Source

pub fn new() -> impl New<Output = Self>

Synthesized default constructor.

Source§

impl Dims64

Helper methods for Dims construction (avoiding name collision with generated constructor)

Source

pub fn from_slice(dims: &[i64]) -> Self

Create a Dims from a slice of dimensions

Source

pub fn new_2d(d0: i64, d1: i64) -> Self

Create a 2D Dims

Source

pub fn new_3d(d0: i64, d1: i64, d2: i64) -> Self

Create a 3D Dims

Source

pub fn new_4d(d0: i64, d1: i64, d2: i64, d3: i64) -> Self

Create a 4D Dims

Trait Implementations§

Source§

impl CopyNew for Dims64

Source§

unsafe fn copy_new(other: &Dims64, this: Pin<&mut MaybeUninit<Dims64>>)

Synthesized copy constructor.

Source§

impl Drop for Dims64

Source§

fn drop(self: &mut Dims64)

Synthesized destructor.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ExternType for Dims64

Source§

type Id = (n, v, i, n, f, e, r, _1, (), D, i, m, s, _6, _4)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Trivial

Source§

impl MakeCppStorage for Dims64

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut Dims64

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut Dims64)

Frees a C++ allocation which has not yet had a constructor called. Read more
Source§

impl MoveNew for Dims64

Source§

unsafe fn move_new( other: Pin<MoveRef<'_, Dims64>>, this: Pin<&mut MaybeUninit<Dims64>>, )

Synthesized move constructor.

Source§

impl SharedPtrTarget for Dims64

Source§

impl UniquePtrTarget for Dims64

Source§

impl VectorElement for Dims64

Source§

impl WeakPtrTarget for Dims64

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithinBoxTrivial for T
where T: ExternType<Kind = Trivial> + Unpin,

Source§

fn within_box(self) -> Pin<Box<T>>

Source§

impl<T> WithinUniquePtrTrivial for T
where T: UniquePtrTarget + ExternType<Kind = Trivial> + Unpin,