Skip to main content

EagerOutput

Struct EagerOutput 

Source
pub struct EagerOutput<Op: GraphOp> {
    pub key: GlobalValKey<Op>,
    pub node: Option<Arc<GradNode<Op>>>,
    pub requires_grad: bool,
    pub output_slot: usize,
}
Expand description

Per-output trace metadata returned by record_eager_op.

The downstream eager value type should embed these fields next to its own concrete output data and gradient slot.

§Examples

let traces = tidu::record_eager_op(&mut keys, op, &inputs, &outputs);
let result = MyEagerValue::new(outputs[0].clone(), traces[0].key.clone(), traces[0].node.clone());

Fields§

§key: GlobalValKey<Op>

User-visible eager output key.

§node: Option<Arc<GradNode<Op>>>

Shared grad node for all outputs when any input requires gradients.

§requires_grad: bool

Whether this output should be tracked by the downstream frontend.

§output_slot: usize

Output slot within the recorded primitive.

Auto Trait Implementations§

§

impl<Op> Freeze for EagerOutput<Op>
where <Op as GraphOp>::InputKey: Freeze, Op: Freeze,

§

impl<Op> RefUnwindSafe for EagerOutput<Op>
where <Op as GraphOp>::InputKey: RefUnwindSafe, Op: RefUnwindSafe, <Op as GraphOp>::Operand: RefUnwindSafe,

§

impl<Op> Send for EagerOutput<Op>

§

impl<Op> Sync for EagerOutput<Op>

§

impl<Op> Unpin for EagerOutput<Op>
where <Op as GraphOp>::InputKey: Unpin, Op: Unpin,

§

impl<Op> UnsafeUnpin for EagerOutput<Op>
where <Op as GraphOp>::InputKey: UnsafeUnpin, Op: UnsafeUnpin,

§

impl<Op> UnwindSafe for EagerOutput<Op>
where <Op as GraphOp>::InputKey: UnwindSafe + RefUnwindSafe, Op: UnwindSafe + RefUnwindSafe, <Op as GraphOp>::Operand: RefUnwindSafe,

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.