pub struct ShapeErrorUtils;Expand description
Utilities for common shape error scenarios
Implementations§
Source§impl ShapeErrorUtils
impl ShapeErrorUtils
Sourcepub fn elementwise_mismatch(
operation: &str,
shape1: &Shape,
shape2: &Shape,
) -> TensorError
pub fn elementwise_mismatch( operation: &str, shape1: &Shape, shape2: &Shape, ) -> TensorError
Create error for elementwise operation shape mismatch
Sourcepub fn broadcast_incompatible(
operation: &str,
shape1: &Shape,
shape2: &Shape,
) -> TensorError
pub fn broadcast_incompatible( operation: &str, shape1: &Shape, shape2: &Shape, ) -> TensorError
Create error for broadcasting incompatibility
Sourcepub fn matmul_incompatible(
operation: &str,
shape_a: &Shape,
shape_b: &Shape,
transpose_a: bool,
transpose_b: bool,
) -> TensorError
pub fn matmul_incompatible( operation: &str, shape_a: &Shape, shape_b: &Shape, transpose_a: bool, transpose_b: bool, ) -> TensorError
Create error for matrix multiplication dimension mismatch
Sourcepub fn invalid_reduction_axis(
operation: &str,
axis: isize,
shape: &Shape,
) -> TensorError
pub fn invalid_reduction_axis( operation: &str, axis: isize, shape: &Shape, ) -> TensorError
Create error for invalid reduction axis
Sourcepub fn invalid_reshape(
operation: &str,
original_shape: &Shape,
new_shape: &[usize],
) -> TensorError
pub fn invalid_reshape( operation: &str, original_shape: &Shape, new_shape: &[usize], ) -> TensorError
Create error for invalid reshape
Sourcepub fn concatenation_mismatch(
operation: &str,
shapes: &[Shape],
axis: usize,
) -> TensorError
pub fn concatenation_mismatch( operation: &str, shapes: &[Shape], axis: usize, ) -> TensorError
Create error for concatenation shape mismatch
Sourcepub fn dimension_constraint(
operation: &str,
constraint_description: &str,
shape: &Shape,
) -> TensorError
pub fn dimension_constraint( operation: &str, constraint_description: &str, shape: &Shape, ) -> TensorError
Create error for dimension constraint violation
Sourcepub fn invalid_transpose(
operation: &str,
shape: &Shape,
axes: &[usize],
) -> TensorError
pub fn invalid_transpose( operation: &str, shape: &Shape, axes: &[usize], ) -> TensorError
Create error for invalid transpose/permutation
Sourcepub fn convolution_invalid(
operation: &str,
input_shape: &Shape,
kernel_shape: &Shape,
details: &str,
) -> TensorError
pub fn convolution_invalid( operation: &str, input_shape: &Shape, kernel_shape: &Shape, details: &str, ) -> TensorError
Create error for convolution parameter mismatch
Sourcepub fn rank_mismatch(
operation: &str,
expected_rank: usize,
actual_shape: &Shape,
) -> TensorError
pub fn rank_mismatch( operation: &str, expected_rank: usize, actual_shape: &Shape, ) -> TensorError
Create error for rank mismatch
Sourcepub fn rank_range_mismatch(
operation: &str,
min_rank: usize,
max_rank: Option<usize>,
actual_shape: &Shape,
) -> TensorError
pub fn rank_range_mismatch( operation: &str, min_rank: usize, max_rank: Option<usize>, actual_shape: &Shape, ) -> TensorError
Create error for rank range mismatch
Auto Trait Implementations§
impl Freeze for ShapeErrorUtils
impl RefUnwindSafe for ShapeErrorUtils
impl Send for ShapeErrorUtils
impl Sync for ShapeErrorUtils
impl Unpin for ShapeErrorUtils
impl UnsafeUnpin for ShapeErrorUtils
impl UnwindSafe for ShapeErrorUtils
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> 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