I want to implement a tensorflows function tf.gradients in C or C++ API? Tensorflow C++ has the worst documentation in the world and C API aren't documented at all. Can you suggest if there is an implementation or which API parts should I use to develop this myself.
The C functions that the python function tf.gradients
calls on can be found in the following header file:
#include "tensorflow/core/gradients/grad_ops.h"
You can use tensorflow::GradientTape
to initialize a tape which the can call on the gradient
function to compute the gradient of a tensor y
in respect to x
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.