pub enum ConstantValue {
Scalar(f64),
Tensor(SparseTensor),
Matrix(Matrix),
}
Variants§
Implementations§
Source§impl ConstantValue
impl ConstantValue
pub fn sizes(&self) -> Vec<usize>
pub fn elems(&self) -> Vec<f64>
pub fn elems_mut(&mut self) -> Vec<&mut f64>
pub fn into_scalar(&self) -> f64
pub fn into_tensor(self) -> SparseTensor
pub fn into_tensor_ref(&self) -> &SparseTensor
pub fn into_matrix(self) -> Matrix
pub fn into_matrix_ref(&self) -> &Matrix
Source§impl ConstantValue
impl ConstantValue
pub fn add(&self, rhs: ConstantValue) -> ConstantValue
pub fn sub(&self, rhs: ConstantValue) -> ConstantValue
pub fn mul(&self, rhs: ConstantValue) -> ConstantValue
pub fn div(self, rhs: &ConstantValue) -> ConstantValue
Trait Implementations§
Source§impl Clone for ConstantValue
impl Clone for ConstantValue
Source§fn clone(&self) -> ConstantValue
fn clone(&self) -> ConstantValue
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConstantValue
impl Debug for ConstantValue
Source§impl<'de> Deserialize<'de> for ConstantValue
impl<'de> Deserialize<'de> for ConstantValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ConstantValue> for Expression
impl From<ConstantValue> for Expression
Source§fn from(v: ConstantValue) -> Self
fn from(v: ConstantValue) -> Self
Converts to this type from the input type.
Source§impl From<Expression> for ConstantValue
impl From<Expression> for ConstantValue
Source§fn from(v: Expression) -> Self
fn from(v: Expression) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ConstantValue
impl PartialEq for ConstantValue
Source§impl Serialize for ConstantValue
impl Serialize for ConstantValue
impl StructuralPartialEq for ConstantValue
Auto Trait Implementations§
impl Freeze for ConstantValue
impl RefUnwindSafe for ConstantValue
impl Send for ConstantValue
impl Sync for ConstantValue
impl Unpin for ConstantValue
impl UnwindSafe for ConstantValue
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