diff --git a/ext/CUDAExt.jl b/ext/CUDAExt.jl index 0dc143b..2e7e99d 100644 --- a/ext/CUDAExt.jl +++ b/ext/CUDAExt.jl @@ -36,7 +36,7 @@ function _gcp( for n in 1:N V = reduce(.*, U[i]'U[i] for i in setdiff(1:N, n)) U[n] = GCPDecompositions.mttkrp(X, U, n) / V - λ = CuArray(CUDA.norm.(eachcol(U[n]))) + λ = vec(sqrt.(sum(abs2, U[n]; dims=1))) U[n] = U[n] ./ permutedims(λ) end end diff --git a/src/gcp-opt.jl b/src/gcp-opt.jl index 1e9ad20..5ac5933 100644 --- a/src/gcp-opt.jl +++ b/src/gcp-opt.jl @@ -166,7 +166,7 @@ function _gcp( for n in 1:N V = reduce(.*, U[i]'U[i] for i in setdiff(1:N, n)) U[n] = mttkrp(X, U, n) / V - λ = norm.(eachcol(U[n])) + λ = vec(sqrt.(sum(abs2, U[n]; dims=1))) U[n] = U[n] ./ permutedims(λ) end end