Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Oct 10, 2023
1 parent e2f83e8 commit 3c6f073
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NDTensors/ext/NDTensorsCUDAExt/permutedims.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function NDTensors.permutedims!!(::Type{<:CuArray}, M, perm)
return permutedims(M, perm)
end
end
2 changes: 1 addition & 1 deletion NDTensors/src/abstractarray/permutedims.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function permutedims!!(::Type{<:AbstractArray}, M, perm)
return @strided Mdest = permutedims(M, perm)
end
end
2 changes: 1 addition & 1 deletion NDTensors/src/arraytensor/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ end
function permutedims!(
output_array::MatrixOrArrayStorage, array::MatrixOrArrayStorage, perm, f::Function
)
output_array .= f.(output_array, permutedims!!(leaf_parenttype(array),array, perm))
output_array .= f.(output_array, permutedims!!(leaf_parenttype(array), array, perm))
return output_array
end
5 changes: 4 additions & 1 deletion NDTensors/src/dense/tensoralgebra/contract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ function _contract!(
# we need to make sure C is permuted to the same
# ordering as A B which is the inverse of props.PC
if β 0
CM = reshape(permutedims!!(leaf_parenttype(CT), CT, invperm(props.PC)), (props.dleft, props.dright))
CM = reshape(
permutedims!!(leaf_parenttype(CT), CT, invperm(props.PC)),
(props.dleft, props.dright),
)
else
# Need to copy here since we will be permuting
# into C later
Expand Down

0 comments on commit 3c6f073

Please sign in to comment.