Mentions légales du service

Skip to content
Snippets Groups Projects
Commit fe2f0d75 authored by hhakim's avatar hhakim
Browse files

Fix pyfaust.lazylinop.diag case k == 0.

parent fb0181ff
Branches
Tags
No related merge requests found
...@@ -1167,6 +1167,8 @@ def diag(v, k=0): ...@@ -1167,6 +1167,8 @@ def diag(v, k=0):
elif k < 0: elif k < 0:
y = v * x[:v.size] y = v * x[:v.size]
y = np.vstack((np.zeros((abs(k), x.shape[1])), y)) y = np.vstack((np.zeros((abs(k), x.shape[1])), y))
else: # k == 0
y = v * x[:v.size]
if x_is_1d: if x_is_1d:
y = y.ravel() y = y.ravel()
return y return y
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment