pub struct VarDecl {
pub name: String,
pub ref_name: Option<String>,
pub pattern: Option<String>,
pub table_indices: Vec<String>,
pub table: bool,
pub auto_dim: Vec<String>,
pub fixed: Vec<(String, usize)>,
pub dtype: DType,
pub dims: Vec<String>,
pub kind: MemoryKind,
pub init: Option<ScalarValue>,
}Expand description
Variable declaration within a graph.
Fields§
§name: String§ref_name: Option<String>§pattern: Option<String>§table_indices: Vec<String>§table: bool§auto_dim: Vec<String>§fixed: Vec<(String, usize)>§dtype: DType§dims: Vec<String>§kind: MemoryKind§init: Option<ScalarValue>Implementations§
Source§impl VarDecl
impl VarDecl
Sourcepub fn model_name(&self) -> &str
pub fn model_name(&self) -> &str
Return the model-facing name (alias or own name).
Sourcepub fn is_prefix_table(&self) -> bool
pub fn is_prefix_table(&self) -> bool
True if this variable is a prefix table.
Sourcepub fn is_cache_table(&self) -> bool
pub fn is_cache_table(&self) -> bool
True if this variable represents a cache table.
Sourcepub fn has_auto_dim(&self) -> bool
pub fn has_auto_dim(&self) -> bool
True if this variable has auto-dimension entries.
Sourcepub fn cache_table_indices(&self) -> Vec<String>
pub fn cache_table_indices(&self) -> Vec<String>
Cache table indices excluding auto-dimension indices.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VarDecl
impl<'de> Deserialize<'de> for VarDecl
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
Auto Trait Implementations§
impl Freeze for VarDecl
impl RefUnwindSafe for VarDecl
impl Send for VarDecl
impl Sync for VarDecl
impl Unpin for VarDecl
impl UnwindSafe for VarDecl
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