Learn R Programming

ggmlR (version 0.8.4)

ggml_graph_get_grad: Get the Gradient Tensor of a Node

Description

Returns the tensor holding d(output)/d(node) after ggml_build_backward_expand has added the backward pass and the graph has been computed.

Usage

ggml_graph_get_grad(graph, node)

ggml_graph_get_grad_acc(graph, node)

Value

The gradient tensor, or NULL

For ggml_graph_get_grad_acc(), the gradient accumulator tensor, or NULL

Arguments

graph

Graph carrying a backward pass

node

Tensor whose gradient is wanted

Details

Returns NULL when the node has no gradient in this graph -- because it was never marked with ggml_set_param, or because nothing differentiable connects it to the output.

See Also

ggml_build_backward_expand