pub struct ParamDict { /* private fields */ }Expand description
Owns a native parameter dictionary for standalone layers.
Implementations§
Source§impl ParamDict
impl ParamDict
Sourcepub fn set_int(&mut self, id: i32, value: i32) -> Result<()>
pub fn set_int(&mut self, id: i32, value: i32) -> Result<()>
Stores an integer parameter at the given id.
Sourcepub fn set_float(&mut self, id: i32, value: f32) -> Result<()>
pub fn set_float(&mut self, id: i32, value: f32) -> Result<()>
Stores a float parameter at the given id.
Sourcepub fn kind(&self, id: i32) -> Result<Option<ParamKind>>
pub fn kind(&self, id: i32) -> Result<Option<ParamKind>>
Reports how a parameter is stored, or None when the identifier is unset.
A custom layer reads parameters by identifier, so this decides which getter applies.
Sourcepub fn get_int(&self, id: i32, default: i32) -> Result<i32>
pub fn get_int(&self, id: i32, default: i32) -> Result<i32>
Reads an integer parameter, falling back to the default.
Sourcepub fn get_float(&self, id: i32, default: f32) -> Result<f32>
pub fn get_float(&self, id: i32, default: f32) -> Result<f32>
Reads a float parameter, falling back to the default.
Sourcepub fn set_array(&mut self, id: i32, value: &Mat) -> Result<()>
pub fn set_array(&mut self, id: i32, value: &Mat) -> Result<()>
Stores an owned copy of a tensor parameter.
Trait Implementations§
Auto Trait Implementations§
impl !Send for ParamDict
impl !Sync for ParamDict
impl Freeze for ParamDict
impl RefUnwindSafe for ParamDict
impl Unpin for ParamDict
impl UnsafeUnpin for ParamDict
impl UnwindSafe for ParamDict
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