Skip to content

Commit

Permalink
Try fixing issues with diaglength
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Nov 30, 2023
1 parent d085d99 commit ba43de9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions NDTensors/src/dims.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using .DiagonalArrays: DiagonalArrays

export dense, dims, dim, mindim, diaglength

# dim and dims are used in the Tensor interface, overload
Expand Down Expand Up @@ -26,7 +28,7 @@ mindim(inds::Tuple) = minimum(dims(inds))

mindim(::Tuple{}) = 1

diaglength(inds::Tuple) = mindim(inds)
DiagonalArrays.diaglength(inds::Tuple) = mindim(inds)

"""
dim_to_strides(ds)
Expand Down Expand Up @@ -94,4 +96,3 @@ dim(T::Tensor) = dim(inds(T))
dim(T::Tensor, i::Int) = dim(inds(T), i)
maxdim(T::Tensor) = maxdim(inds(T))
mindim(T::Tensor) = mindim(inds(T))
diaglength(T::Tensor) = mindim(T)
2 changes: 1 addition & 1 deletion NDTensors/test/arraytensor/diagonalarray.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@eval module $(gensym())
using NDTensors: contract
using NDTensors: contract, tensor
using NDTensors.SparseArrayInterface: densearray
using NDTensors.DiagonalArrays: DiagonalArray
using Test: @test, @testset
Expand Down

0 comments on commit ba43de9

Please sign in to comment.