tf.keras.backend.gradients

Returns the gradients of loss w.r.t. variables.

loss Scalar tensor to minimize.
variables List of variables.

A gradients tensor.