Skip to content

Commit

Permalink
Replace norm function
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmul1114 committed Jan 18, 2024
1 parent ab40583 commit f4696c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/CUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 42 in ext/CUDAExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/CUDAExt.jl#L35-L42

Added lines #L35 - L42 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion src/gcp-opt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4696c0

Please sign in to comment.