pub struct Graph<T: DType> { /* private fields */ }
Implementations§
Source§impl<T: DType> Graph<T>
impl<T: DType> Graph<T>
Sourcepub fn get_ops(&self) -> RwLockReadGuard<'_, Vec<GraphNode<T>>>
pub fn get_ops(&self) -> RwLockReadGuard<'_, Vec<GraphNode<T>>>
Read-only access to the list of operations
pub fn to_petgraph(&self) -> PetGraph<String, String>
Sourcepub fn visualize<P: AsRef<Path>>(&self, filename: P) -> Result<()>
pub fn visualize<P: AsRef<Path>>(&self, filename: P) -> Result<()>
Visualize the graph by saving it to this file.
Install graphvis:
- brew install graphviz
- apt install graphviz
Sourcepub fn optimize(&mut self)
pub fn optimize(&mut self)
Optimize this graph.
Apply the following optimizations:
- Constant folding of elementwise fills
- Fuse mul-add into FMA
- Inplace binary operations when safe
- Inplace fused multiply-add when safe
- Inplace matrix-multiplication when safe
- Dead code removal
Sourcepub fn compile<S: Shape, D: Dev>(self) -> Result<CompiledGraph<S, T, D>>
pub fn compile<S: Shape, D: Dev>(self) -> Result<CompiledGraph<S, T, D>>
Compile this graph and insert device-specific optimizations such as CUDA streams.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Graph<T>
impl<T> RefUnwindSafe for Graph<T>
impl<T> !Send for Graph<T>
impl<T> !Sync for Graph<T>
impl<T> Unpin for Graph<T>
impl<T> UnwindSafe for Graph<T>
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