pub enum TensorIterOrder {
C,
F,
A,
K,
G,
B,
}
Expand description
The policy of the tensor iterator.
Variants§
C
Row-major order.
- absolute safe for array iteration
F
Column-major order.
- absolute safe for array iteration
A
Automatically choose row/col-major order.
-
try c/f-contig first (also see
TensorIterOrder::B
), -
try c/f-prefer second (also see
TensorIterOrder::C
,TensorIterOrder::F
), -
otherwise
FlagOrder::default()
, which is defined by crate featuref_prefer
. -
safe for multi-array iteration like
get_iter(a, b)
-
not safe for cases like
a.iter().zip(b.iter())
K
Greedy when possible (reorder layouts during iteration).
- safe for multi-array iteration like
get_iter(a, b)
- not safe for cases like
a.iter().zip(b.iter())
- if it is used to create a new array, the stride of new array will be in K order
G
Greedy when possible (reset dimension to 1 if axis is broadcasted).
- not safe for multi-array iteration like
get_iter(a, b)
- this is useful for inplace-assign broadcasted array.
B
Sequential buffer.
- not safe for multi-array iteration like
get_iter(a, b)
- this is useful for reshaping or all-contiguous cases.
Trait Implementations§
Source§impl ChangeableDefault for TensorIterOrder
impl ChangeableDefault for TensorIterOrder
Source§unsafe fn change_default(val: TensorIterOrder)
unsafe fn change_default(val: TensorIterOrder)
Safety Read more
fn get_default() -> TensorIterOrder
Source§impl Clone for TensorIterOrder
impl Clone for TensorIterOrder
Source§fn clone(&self) -> TensorIterOrder
fn clone(&self) -> TensorIterOrder
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 TensorIterOrder
impl Debug for TensorIterOrder
Source§impl Default for TensorIterOrderwhere
TensorIterOrder: ChangeableDefault,
impl Default for TensorIterOrderwhere
TensorIterOrder: ChangeableDefault,
Source§fn default() -> TensorIterOrder
fn default() -> TensorIterOrder
Returns the “default value” for a type. Read more
Source§impl PartialEq for TensorIterOrder
impl PartialEq for TensorIterOrder
impl Copy for TensorIterOrder
impl Eq for TensorIterOrder
impl StructuralPartialEq for TensorIterOrder
Auto Trait Implementations§
impl Freeze for TensorIterOrder
impl RefUnwindSafe for TensorIterOrder
impl Send for TensorIterOrder
impl Sync for TensorIterOrder
impl Unpin for TensorIterOrder
impl UnwindSafe for TensorIterOrder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more