Skip to main content

Wire

Struct Wire 

Source
pub struct Wire { /* private fields */ }
Expand description

A half-declared graph.

Implementations§

Source§

impl Wire

Source

pub fn on(self, device: Device) -> Wire

This whole piece on one device. The innermost one wins: (a.on(Cuda(0)) >> b).on(Cuda(1)) leaves a on 0 and b on 1.

Source

pub fn at(self, host: impl Into<Host>) -> Wire

This whole piece on one host, likewise, and independent of the device: the two can be written in any order.

Source

pub fn frozen(self) -> Wire

This whole piece settled: its state does not change while the graph runs, innermost first. Only the half the core can hold — whoever knows what a gradient is says it again with the digest. See Memory::freeze.

Source

pub fn cached(self) -> Wire

This whole piece worth keeping: what each node produces is looked up before being computed and kept after. Whether it can honestly be kept is cacheable’s question, asked before running.

Source

pub fn mapped(self) -> Wire

This whole piece maps over the items of its input: a list in, a list as long out. What gives a cache the grain of an item.

Source

pub fn somatize(self) -> Result<(Graph, Catalog, Placement, Memory), GraphError>

Materializes what was declared: the structure, the store, the placement and what is remembered, none containing the others. Fails on a repeated id, above all.

Trait Implementations§

Source§

impl BitOr for Wire

Source§

fn bitor(self, other: Wire) -> Wire

a | b: two branches that do not touch. Whatever comes in reaches both, and whatever leaves either one leaves here.

Source§

type Output = Wire

The resulting type after applying the | operator.
Source§

impl Shr for Wire

Source§

fn shr(self, next: Wire) -> Wire

a >> b: everything leaving a enters everything starting b.

Source§

type Output = Wire

The resulting type after applying the >> operator.

Auto Trait Implementations§

§

impl Freeze for Wire

§

impl !RefUnwindSafe for Wire

§

impl Send for Wire

§

impl Sync for Wire

§

impl Unpin for Wire

§

impl UnsafeUnpin for Wire

§

impl !UnwindSafe for Wire

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.