Skip to content

Commit

Permalink
Fix Tensor constructor rrule on Thunks
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Sep 12, 2023
1 parent 78ec48c commit 89dfb77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/TenetChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ChainRulesCore.frule((_, Δ, _), T::Type{<:Tensor}, data, inds; meta...) = T(dat

function ChainRulesCore.rrule(T::Type{<:Tensor}, data, inds; meta...)
Tensor_pullback(Δ) = (NoTangent(), Δ.data, NoTangent())
Tensor_pullback::Thunk) = (NoTangent(), unthunk(Δ).data, NoTangent())
return T(data, inds; meta...), Tensor_pullback
end

Expand Down

0 comments on commit 89dfb77

Please sign in to comment.