You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is particular useful in U-Net and related networks.
function cat3d(arrs...)
H = size(first(arrs), 1)
W = size(first(arrs), 2)
C = sum(size(a, 3) for a in arrs)
T = size(first(arrs), 4)
@assert all(H == size(a, 1) for a in arrs)
@assert all(W == size(a, 2) for a in arrs)
@assert all(T == size(a, 4) for a in arrs)
out = Array{Float64}(undef, H, W, C, T)
curr = 1
for (i, A) in enumerate(arrs)
c = size(A, 3)
r = curr:(curr+c-1)
out[:, :, r, :] .= A
curr += c
end
out
end
Below function is working, but I think it is probably slow.
functioncat3d2(arrs...)
parrs =map(x->permutedims(x,(1,2,4,3)), arrs)
H,W,_,B =size(first(arrs))
C =sum(size(a, 3) for a in arrs)
permutedims(reshape(cat1d(parrs...),(H,W,B,C)),(1,2,4,3))
end
This is particular useful in U-Net and related networks.
The text was updated successfully, but these errors were encountered: