MCPcopy Create free account
hub / github.com/PythonOT/POT / set_gradients

Method set_gradients

ot/backend.py:2934–2942  ·  view source on GitHub ↗
(self, val, inputs, grads)

Source from the content-addressed store, hash-verified

2932 return tf.cast(a, dtype=type_as.dtype)
2933
2934 def set_gradients(self, val, inputs, grads):
2935 @tf.custom_gradient
2936 def tmp(input):
2937 def grad(upstream):
2938 return grads
2939
2940 return val, grad
2941
2942 return tmp(inputs)
2943
2944 def _detach(self, a):
2945 return tf.stop_gradient(a)

Callers 1

test_gradients_backendsFunction · 0.95

Calls

no outgoing calls

Tested by 1

test_gradients_backendsFunction · 0.76