pub struct Emit<'a> {
pub module: &'a mut GraphModule,
pub params: &'a mut HashMap<String, Vec<f32>>,
pub weights: &'a mut dyn WeightSource,
pub state: &'a mut FlowState,
pub profile: &'a CompileProfile,
}Expand description
Mutable emission context for custom stages (tier 2).
Fields§
§module: &'a mut GraphModule§params: &'a mut HashMap<String, Vec<f32>>§weights: &'a mut dyn WeightSource§state: &'a mut FlowState§profile: &'a CompileProfileImplementations§
Source§impl<'a> Emit<'a>
impl<'a> Emit<'a>
pub fn hir(&mut self) -> &mut HirModule
pub fn load_param(&mut self, key: &str, transpose: bool) -> Result<HirNodeId>
pub fn synth_param( &mut self, name: &str, data: Vec<f32>, shape: Shape, ) -> HirNodeId
pub fn synth_zeros(&mut self, name: &str, len: usize) -> HirNodeId
pub fn hir_and_params( &mut self, ) -> (&mut HirModule, &mut HashMap<String, Vec<f32>>)
pub fn wrap(&self, id: HirNodeId, shape: Shape) -> FlowValue
Sourcepub fn flow_input(&self, name: &str) -> Result<FlowValue>
pub fn flow_input(&self, name: &str) -> Result<FlowValue>
Look up a declared graph input (see FlowState::inputs).
pub fn set_named(&mut self, key: impl Into<String>, id: HirNodeId)
pub fn named(&self, key: &str) -> Result<HirNodeId>
Auto Trait Implementations§
impl<'a> Freeze for Emit<'a>
impl<'a> !RefUnwindSafe for Emit<'a>
impl<'a> !Send for Emit<'a>
impl<'a> !Sync for Emit<'a>
impl<'a> Unpin for Emit<'a>
impl<'a> UnsafeUnpin for Emit<'a>
impl<'a> !UnwindSafe for Emit<'a>
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