Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Oct 23, 2023
1 parent 8d00ea4 commit 1d579fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NDTensors/ext/NDTensorsCUDAExt/linearalgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ function NDTensors.truncate!(P::CuArray; kwargs...)
cpuP = NDTensors.cpu(P)
value = NDTensors.truncate!(cpuP; kwargs...)
P = adapt(typeof(P), cpuP)
return value;
end
return value
end
4 changes: 2 additions & 2 deletions NDTensors/src/dense/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ setdata(storagetype::Type{<:Dense}, data) = Dense(data)
## There is an GPU arrays which are ReshapedArray can
## fail when trying to copy (fail meaning they call get_index which is slow) so this forces a fix.
## TODO make a better implementation
function copy(D::Dense)
function copy(D::Dense)
d = data(D)
if d isa Base.ReshapedArray
return Dense(copy(parent(d)))
end
Dense(copy(data(D)))
return Dense(copy(data(D)))
end

function Base.real(T::Type{<:Dense})
Expand Down

0 comments on commit 1d579fe

Please sign in to comment.