pub struct NoGradientBinaryRule;Expand description
Backward rule for non-differentiable two-input ops (the comparison
family: Equal, Ne, Lt, Le, Gt, Ge). Returns None for
both input slots so the autograd traversal terminates without
extending the gradient graph through the op. Comparison-on-loss-
path is a user error; the missing gradient downstream surfaces it
rather than panicking.
Trait Implementations§
Source§impl GradientRule for NoGradientBinaryRule
impl GradientRule for NoGradientBinaryRule
Source§fn backward(
&self,
_graph: &SharedGraph,
_op: &Op,
_inputs: &[NodeId],
_output: NodeId,
_upstream: NodeId,
) -> GradientList
fn backward( &self, _graph: &SharedGraph, _op: &Op, _inputs: &[NodeId], _output: NodeId, _upstream: NodeId, ) -> GradientList
Build gradient nodes for this op. Read more
Auto Trait Implementations§
impl Freeze for NoGradientBinaryRule
impl RefUnwindSafe for NoGradientBinaryRule
impl Send for NoGradientBinaryRule
impl Sync for NoGradientBinaryRule
impl Unpin for NoGradientBinaryRule
impl UnsafeUnpin for NoGradientBinaryRule
impl UnwindSafe for NoGradientBinaryRule
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