MCPcopy Index your code
hub / github.com/apache/tvm / derivative

Function derivative

python/tvm/testing/utils.py:177–181  ·  view source on GitHub ↗
(x_name, j, a_delta)

Source from the content-addressed store, hash-verified

175
176 # numerically compute a partial derivative with respect to j-th element of the var `name`
177 def derivative(x_name, j, a_delta):
178 modified_values = {
179 n: modify(val, j, a_delta) if n == x_name else val for n, val in input_values.items()
180 }
181 return (function(**modified_values) - function_value) / a_delta
182
183 def compare_derivative(j, n_der, grad):
184 der = grad.reshape(-1)[j]

Callers 1

check_numerical_gradsFunction · 0.85

Calls 3

modifyFunction · 0.85
functionFunction · 0.50
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…