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 copy 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 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 PartialEq<ConstantValue> for ConstantValue
impl PartialEq<ConstantValue> for ConstantValue
source§fn eq(&self, other: &ConstantValue) -> bool
fn eq(&self, other: &ConstantValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.