Skip to main content

Graph

Struct Graph 

Source
pub struct Graph<'g> { /* private fields */ }

Implementations§

Source§

impl<'g> Graph<'g>

Source

pub fn new() -> Self

Source

pub fn input(&self, shape: Shape) -> Value<'g>

Source

pub fn resident(&self, shape: Shape) -> Value<'g>

Source

pub fn parameter(&self, shape: Shape, init: Init) -> Value<'g>

Source

pub fn fill(&self, shape: Shape, value: f32) -> Value<'g>

Source

pub fn matmul(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn conv2d( &self, input: Value<'g>, filter: Value<'g>, window: Window, ) -> Value<'g>

Source

pub fn add(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn mul(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn sub(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn div(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn max(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn min(&self, left: Value<'g>, right: Value<'g>) -> Value<'g>

Source

pub fn relu(&self, value: Value<'g>) -> Value<'g>

Source

pub fn sqrt(&self, value: Value<'g>) -> Value<'g>

Source

pub fn recip(&self, value: Value<'g>) -> Value<'g>

Source

pub fn exp(&self, value: Value<'g>) -> Value<'g>

Source

pub fn log(&self, value: Value<'g>) -> Value<'g>

Source

pub fn tanh(&self, value: Value<'g>) -> Value<'g>

Source

pub fn sigmoid(&self, value: Value<'g>) -> Value<'g>

Source

pub fn neg(&self, value: Value<'g>) -> Value<'g>

Source

pub fn abs(&self, value: Value<'g>) -> Value<'g>

Source

pub fn identity(&self, value: Value<'g>) -> Value<'g>

Source

pub fn softmax(&self, value: Value<'g>) -> Value<'g>

Source

pub fn log_softmax(&self, value: Value<'g>) -> Value<'g>

Source

pub fn argmax(&self, value: Value<'g>) -> Value<'g>

Source

pub fn categorical(&self, logits: Value<'g>, seed: Value<'g>) -> Value<'g>

Source

pub fn one_hot(&self, indices: Value<'g>, classes: u32) -> Value<'g>

Source

pub fn gather(&self, table: Value<'g>, indices: Value<'g>) -> Value<'g>

Source

pub fn scatter_into( &self, target: Value<'g>, indices: Value<'g>, updates: Value<'g>, )

Source

pub fn sum(&self, value: Value<'g>) -> Value<'g>

Source

pub fn transpose(&self, value: Value<'g>) -> Value<'g>

Source

pub fn add_into(&self, target: Value<'g>, addend: Value<'g>)

Source

pub fn mul_into(&self, target: Value<'g>, factor: Value<'g>)

Source

pub fn copy_into(&self, target: Value<'g>, source: Value<'g>)

Source

pub fn shape(&self, value: Value<'g>) -> Shape

Source

pub fn value_count(&self) -> usize

Source

pub fn task_count(&self) -> usize

Source

pub fn layout(&self, alignment: u64, precision: Precision) -> Layout

Source

pub fn updates_weights(&self) -> bool

Source

pub fn encode( &self, alignment: u64, profile: Profile, precision: Precision, ) -> Encoding

Source

pub fn backward(&self, loss: Value<'g>) -> Gradients<'g>

Source

pub fn retain(&self, value: Value<'g>)

Source

pub fn sum_rows(&self, value: Value<'g>) -> Value<'g>

Trait Implementations§

Source§

impl<'g> Default for Graph<'g>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'g> !Freeze for Graph<'g>

§

impl<'g> !RefUnwindSafe for Graph<'g>

§

impl<'g> !Sync for Graph<'g>

§

impl<'g> Send for Graph<'g>

§

impl<'g> Unpin for Graph<'g>

§

impl<'g> UnsafeUnpin for Graph<'g>

§

impl<'g> UnwindSafe for Graph<'g>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.