Skip to content
Snippets Groups Projects
Verified Commit 4e921135 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Fix ConcreteGradient creation

parent 04f31304
No related branches found
No related tags found
No related merge requests found
......@@ -31,13 +31,23 @@ struct ConcreteGradient
end
function ConcreteGradient(arr::Vector)
@assert all(length.(arr) .== 4)
ConcreteGradient(
[a[1] for a in arr],
[a[2] for a in arr],
[a[3] for a in arr],
[a[4] for a in arr],
)
if length(arr[1]) == 4
@assert all(length.(arr) .== 4)
ConcreteGradient(
[a[1] for a in arr],
[a[2] for a in arr],
[a[3] for a in arr],
[a[4] for a in arr],
)
elseif length(arr[1]) == 2
@assert all(length.(arr) .== 2)
ConcreteGradient(
[a[1] for a in arr],
[a[2] for a in arr],
)
else
error()
end
end
function ConcreteGradient(times, gradients)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment