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: boolWhether this output should be tracked by the downstream frontend.
output_slot: usizeOutput slot within the recorded primitive.
Auto Trait Implementations§
impl<Op> Freeze for EagerOutput<Op>
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>
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> 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