pub struct MirModule { /* private fields */ }Expand description
Mid-level module — optimizer input.
Implementations§
Source§impl MirModule
impl MirModule
Sourcepub fn inspect(&self) -> String
pub fn inspect(&self) -> String
Text dump for inspection. Alias for inspect_mir.
Source§impl MirModule
impl MirModule
pub fn new(name: impl Into<String>) -> MirModule
pub fn from_graph(graph: Graph) -> MirModule
pub fn into_graph(self) -> Graph
pub fn as_graph(&self) -> &Graph
pub fn as_graph_mut(&mut self) -> &mut Graph
pub fn name(&self) -> &str
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn outputs(&self) -> &[NodeId]
pub fn set_outputs(&mut self, outputs: Vec<NodeId>)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MirModule
impl<'de> Deserialize<'de> for MirModule
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MirModule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MirModule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<MirModule> for GraphModule
impl From<MirModule> for GraphModule
Source§fn from(mir: MirModule) -> GraphModule
fn from(mir: MirModule) -> GraphModule
Converts to this type from the input type.
Source§impl MirAutodiffExt for MirModule
impl MirAutodiffExt for MirModule
Source§fn prepare_for_autodiff(self) -> MirModule
fn prepare_for_autodiff(self) -> MirModule
Run
prepare_graph_for_ad and return primitive MIR.Source§fn grad_with_loss(&self, wrt: &[NodeId]) -> Graph
fn grad_with_loss(&self, wrt: &[NodeId]) -> Graph
crate::autodiff::grad_with_loss on this module’s graph.Source§impl Serialize for MirModule
impl Serialize for MirModule
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for MirModule
Auto Trait Implementations§
impl Freeze for MirModule
impl RefUnwindSafe for MirModule
impl Send for MirModule
impl Sync for MirModule
impl Unpin for MirModule
impl UnsafeUnpin for MirModule
impl UnwindSafe for MirModule
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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