Skip to content

Commit

Permalink
Fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Oct 24, 2023
1 parent d9a5520 commit 42bd16c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NDTensors/src/diag/diagtensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ function dense(::Type{<:AbstractArray}, T::DiagTensor)
return adapt(leaf_parenttype(T), D_cpu)
end

# UniformDiag version
# TODO: Delete once new DiagonalArray is designed.
# TODO: This creates a tensor on CPU by default so may cause
# problems for GPU.
function dense(::Type{<:Number}, T::DiagTensor)
return dense(Tensor(Diag(fill(getdiagindex(T, 1), diaglength(T))), inds(T)))
end

denseblocks(T::DiagTensor) = dense(T)

function permutedims!(
Expand Down

0 comments on commit 42bd16c

Please sign in to comment.