Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrevalles committed May 3, 2024
1 parent 8129c7e commit 31bf9fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ext/TenetDaggerExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ selectdims(a, proj::Pair...) =

function Dagger.stage(ctx::Context, op::Contract{T,N}) where {T,N}
domain = isempty(size(op)) ? Dagger.ArrayDomain((1:1, 1:1)) : Dagger.ArrayDomain([1:l for l in size(op)])
partitioning = isempty(size(op)) ? Dagger.Blocks(1,1) : Dagger.Blocks(op)
partitioning = isempty(size(op)) ? Dagger.Blocks(1, 1) : Dagger.Blocks(op)

subdoms_start = tuple([1 for _ in 1:length(partitioning.blocksize)]...)
subdoms_cumlength = tuple([collect(partitioning.blocksize[i]:domain.indexes[i].stop) for i in 1:length(partitioning.blocksize)]...)
subdoms_cumlength =
tuple([collect(partitioning.blocksize[i]:domain.indexes[i].stop) for i in 1:length(partitioning.blocksize)]...)
subdomains = Dagger.DomainBlocks{length(partitioning.blocksize)}(subdoms_start, subdoms_cumlength)

contractor =
Expand All @@ -66,7 +67,7 @@ function Dagger.stage(ctx::Context, op::Contract{T,N}) where {T,N}
chunks_a = reduce(zip(outer_perm_a, outer_indices_a); init = Dagger.chunks(op.a)) do acc, (d, i)
selectdim(acc, d, i:i)
end
else
else
chunks_a = Dagger.chunks(op.a)
end
chunks_a = permutedims(chunks_a, vcat(outer_perm_a, inner_perm_a))
Expand Down

0 comments on commit 31bf9fe

Please sign in to comment.