MCPcopy Create free account
hub / github.com/apache/tvm / compare_derivative

Function compare_derivative

python/tvm/testing/utils.py:183–185  ·  view source on GitHub ↗
(j, n_der, grad)

Source from the content-addressed store, hash-verified

181 return (function(**modified_values) - function_value) / a_delta
182
183 def compare_derivative(j, n_der, grad):
184 der = grad.reshape(-1)[j]
185 return np.abs(n_der - der) < atol + rtol * np.abs(n_der)
186
187 for x_name, grad in grad_values.items():
188 if grad.shape != input_values[x_name].shape:

Callers 1

check_numerical_gradsFunction · 0.85

Calls 1

reshapeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…