Skip to content

Commit be48fca

Browse files
committed
some more fixes
1 parent 733c761 commit be48fca

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/algorithms/derivatives/mpo_derivatives.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,15 @@ function (H::PrecomputedDerivative)(x::AbstractTensorMap)
169169
R_fused = fuse_legs(H.rightenv, 0, numin(x))
170170
x_fused = fuse_legs(x, numout(x), numin(x))
171171

172-
173172
TC = TensorOperations.promote_contract(scalartype(x_fused), scalartype(R_fused))
174173
xR = TensorOperations.tensoralloc_contract(
175-
TC, x_fused, ((1,), (2,)), false, R_fused, ((1,), (2, 3)), false, ((1, 2), (3,)), Val(true), H.allocator
174+
TC, x_fused, ((1,), (2,)), false, R_fused, ((1,), (2, 3)), false, ((1, 2), (3,)), Val(true), allocator
176175
)
177176

178-
mul_front!(xR, x_fused, R_fused, One(), Zero(), H.backend, H.allocator)
177+
mul_front!(xR, x_fused, R_fused, One(), Zero(), H.backend, allocator)
179178

180179
LxR = H.leftenv * xR
181-
TensorOperations.tensorfree!(xR, H.allocator)
180+
TensorOperations.tensorfree!(xR, allocator)
182181

183182
reset!(allocator, cp)
184183
return TensorMap{scalartype(LxR)}(LxR.data, codomain(H.leftenv) domain(H.rightenv))

src/utility/utility.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ function mul_front!(
275275
α, β, backend, allocator
276276
)
277277
end
278+
reset!(allocator, cp)
278279

279-
return reset!(allocator, cp)
280+
return C
280281
end
281282

282283
function mul_tail(
@@ -324,7 +325,8 @@ function mul_tail!(
324325
)
325326
end
326327

327-
return reset!(allocator, cp)
328+
reset!(allocator, cp)
329+
return C
328330
end
329331

330332
@inline fuse_legs(x::TensorMap, N₁::Int, N₂::Int) = fuse_legs(x, Val(N₁), Val(N₂))

0 commit comments

Comments
 (0)