Some changes

This commit is contained in:
Dynamitos
2025-04-10 16:42:37 +02:00
parent 40debf8580
commit d14c1217de
10 changed files with 44 additions and 27 deletions
+8
View File
@@ -16,3 +16,11 @@ print(positions)
print(indices)
# Create a tensor with attached grads from a numpy array
# Note: We pass zero=True to initialize the grads to zero on allocation
x = spy.Tensor.numpy(device, np.array([1, 2, 3, 4], dtype=np.float32)).with_grads(zero=True)
# Evaluate the polynomial and ask for a tensor back
# Expecting result = 2x^2 + 8x - 1
result: spy.Tensor = module.polynomial(a=2, b=8, c=-1, x=x, _result='tensor')
print(result.to_numpy())