pub trait TensorShape: Sized {
// Required method
fn shape(&self) -> Shape;
// Provided methods
fn check_shape(&self, shape: impl Into<Shape>) -> Result<(), TensorError> { ... }
fn check_shape_any<S>(&self, shapes: &[S]) -> Result<(), TensorError>
where S: Into<Shape> + ToOwned<Owned = S> { ... }
}Required Methods§
Provided Methods§
Sourcefn check_shape(&self, shape: impl Into<Shape>) -> Result<(), TensorError>
fn check_shape(&self, shape: impl Into<Shape>) -> Result<(), TensorError>
Check if the tensor’s shape is the same as what expected.
Sourcefn check_shape_any<S>(&self, shapes: &[S]) -> Result<(), TensorError>
fn check_shape_any<S>(&self, shapes: &[S]) -> Result<(), TensorError>
Check if the tensor’s shape matches any of the expected ones.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.