Skip to content

Commit 37d1570

Browse files
authored
[ITensors] Fix Zygote failures (#1613)
1 parent d8e3658 commit 37d1570

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ITensors"
22
uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5"
33
authors = ["Matthew Fishman <[email protected]>", "Miles Stoudenmire <[email protected]>"]
4-
version = "0.7.11"
4+
version = "0.7.12"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

ext/ITensorsChainRulesCoreExt/itensor.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function rrule(::Type{ITensor}, x1::AllowAlias, x2::TensorStorage, x3)
2727
y = ITensor(x1, x2, x3)
2828
function ITensor_pullback(ȳ)
2929
x̄1 = NoTangent()
30-
x̄2 = .tensor.storage
30+
x̄2 = unthunk(ȳ).tensor.storage
3131
x̄3 = NoTangent()
3232
return (NoTangent(), x̄1, x̄2, x̄3)
3333
end
@@ -84,7 +84,7 @@ end
8484
function rrule(::typeof(tensor), x1::ITensor)
8585
y = tensor(x1)
8686
function tensor_pullback(ȳ)
87-
x̄1 = ITensor(typeof(storage(x1))(.storage.data), inds(x1))
87+
x̄1 = ITensor(typeof(storage(x1))(unthunk(ȳ).storage.data), inds(x1))
8888
return (NoTangent(), x̄1)
8989
end
9090
return y, tensor_pullback

0 commit comments

Comments
 (0)