pub enum TensorFormat {
NCHW,
NHWC,
NC1HWC2,
Undefined,
}Expand description
Memory layout of a tensor.
Describes how tensor data is arranged in memory.
- NCHW - channels first. Common in PyTorch. Shape:
[batch, channels, height, width]. - NHWC - channels last. Used for RKNN inputs. Shape:
[batch, height, width, channels]. - NC1HWC2 - RKNN NPU packed format. Channels are split into blocks.
Shape:
[batch, c1, height, width, c2]. Usenc1hwc2_to_flatto convert.
Variants§
NCHW
Channels first: [N, C, H, W].
NHWC
Channels last: [N, H, W, C]. Standard for RKNN inputs.
NC1HWC2
NPU packed format: [N, c1, H, W, c2]. Common for RKNN outputs on RV1106.
Undefined
Unknown or unsupported format.
Trait Implementations§
Source§impl Clone for TensorFormat
impl Clone for TensorFormat
Source§fn clone(&self) -> TensorFormat
fn clone(&self) -> TensorFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorFormat
impl Debug for TensorFormat
Source§impl From<u32> for TensorFormat
Just an alias for TensorFormat
impl From<u32> for TensorFormat
Just an alias for TensorFormat
Source§impl PartialEq for TensorFormat
impl PartialEq for TensorFormat
impl Copy for TensorFormat
impl Eq for TensorFormat
impl StructuralPartialEq for TensorFormat
Auto Trait Implementations§
impl Freeze for TensorFormat
impl RefUnwindSafe for TensorFormat
impl Send for TensorFormat
impl Sync for TensorFormat
impl Unpin for TensorFormat
impl UnwindSafe for TensorFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more