Skip to content

Commit a4f261e

Browse files
authored
Zero out allocated data to help Mooncake tests (#149)
1 parent 6e96f5f commit a4f261e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "TensorAlgebra"
22
uuid = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
3-
version = "0.7.17"
3+
version = "0.7.18"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[workspace]

src/contract/allocate_output.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Base.PermutedDimsArrays: genperm
2+
using FunctionImplementations: zero!
23

34
function check_biperm(a, perm_codomain, perm_domain)
45
ndims(a) == length(perm_codomain) + length(perm_domain) ||
@@ -80,5 +81,6 @@ function allocate_output(
8081
a1, perm1_codomain, perm1_domain,
8182
a2, perm2_codomain, perm2_domain
8283
)
83-
return similar(a1, promote_type(eltype(a1), eltype(a2)), axes_dest)
84+
T = promote_type(eltype(a1), eltype(a2))
85+
return zero!(similar(a1, T, axes_dest))
8486
end

0 commit comments

Comments
 (0)