import uarray as ua
import unumpy as np
import udiff
from unumpy import numpy_backend
with ua.set_backend(udiff.DiffArrayBackend(numpy_backend), coerce=True):
x1 = np.reshape(np.arange(1, 26), (5, 5))
x2 = np.reshape(np.arange(1, 26), (5, 5))
y = np.log(x1) + x1 * x2 - np.sin(x2)
print(y)
print(y.to(x1))
print(y.to(x2))
See CONTRIBUTING.md
for more information on how to contribute to udiff
.