oa::GradNode

GradNode class in the OA Core public surface.

Public Methods

void oa::GradNode::backward(const Matrix & inUpstream, oa::Vector<Matrix> & outInputGrads)
void oa::GradNode::clearTensors()
oa::Span<const Matrix> oa::GradNode::graphInputs()
oa::Vector<Matrix> & oa::GradNode::mutGraphInputs()
void oa::GradNode::saveForBackward(Matrices &&... inMatrices)
void oa::GradNode::saveForBackward(oa::Vector<Matrix> inMatrices)
void oa::GradNode::setGraphInputs(oa::Vector<Matrix> inInputs)

Public Data Members

forwardSemanticGeneration_oa::U64field
forwardSemanticOp_oa::U32field
forwardSemanticOutput_oa::U32field
outputShape_MatrixShapefield
sequenceNr_oa::U64field

Constructor & Destructor Documentation

void oa::GradNode::~GradNode()
No public source comment is attached to this declaration.

Public Method Documentation

void oa::GradNode::backward( const Matrix & inUpstream, oa::Vector<Matrix> & outInputGrads )
Records this operation's backward kernels into the active graph. The tape owns traversal and execution cadence; nodes only describe their adjoints.

Parameters

inUpstream
const Matrix &

outInputGrads
oa::Vector<Matrix> &

Returns

void

The declared return value.

void oa::GradNode::clearTensors()
No public source comment is attached to this declaration.

Returns

void

The declared return value.

oa::Span<const Matrix> oa::GradNode::graphInputs()
No public source comment is attached to this declaration.

Returns

oa::Span<const Matrix>

The declared return value.

oa::Vector<Matrix> & oa::GradNode::mutGraphInputs()
No public source comment is attached to this declaration.

Returns

oa::Vector<Matrix> &

The declared return value.

void oa::GradNode::saveForBackward( Matrices &&... inMatrices )
No public source comment is attached to this declaration.

Parameters

inMatrices
Matrices &&...

Returns

void

The declared return value.

void oa::GradNode::saveForBackward( oa::Vector<Matrix> inMatrices )
Retains matrices required by backward and snapshots their storage mutation versions. Backward fails before recording any kernels if a retained matrix was modified in place.

Parameters

inMatrices
oa::Vector<Matrix>

Returns

void

The declared return value.

void oa::GradNode::setGraphInputs( oa::Vector<Matrix> inInputs )
No public source comment is attached to this declaration.

Parameters

inInputs
oa::Vector<Matrix>

Returns

void

The declared return value.