@@ -167,8 +167,8 @@ function _pullback_via_pushforward(
167167 dy,
168168 contexts:: Vararg{Context,C} ,
169169) where {F,C}
170- t1 = pushforward (f, pushforward_prep, backend, x, (one (x),), contexts... )
171- dx = dot (dy, only (t1 ))
170+ t = pushforward (f, pushforward_prep, backend, x, (one (x),), contexts... )
171+ dx = dot (dy, only (t ))
172172 return dx
173173end
174174
@@ -180,9 +180,10 @@ function _pullback_via_pushforward(
180180 dy,
181181 contexts:: Vararg{Context,C} ,
182182) where {F,C}
183- dx = map (CartesianIndices (x)) do j
184- t1 = pushforward (f, pushforward_prep, backend, x, (basis (backend, x, j),), contexts... )
185- dot (dy, only (t1))
183+ dx = map (x, CartesianIndices (x)) do xj, j
184+ bj = basis (backend, x, j)
185+ tj = pushforward (f, pushforward_prep, backend, x, (bj,), contexts... )
186+ dot (dy, only (tj))
186187 end
187188 return dx
188189end
@@ -252,8 +253,8 @@ function _pullback_via_pushforward(
252253 dy,
253254 contexts:: Vararg{Context,C} ,
254255) where {F,C}
255- t1 = pushforward (f!, y, pushforward_prep, backend, x, (one (x),), contexts... )
256- dx = dot (dy, only (t1 ))
256+ t = pushforward (f!, y, pushforward_prep, backend, x, (one (x),), contexts... )
257+ dx = dot (dy, only (t ))
257258 return dx
258259end
259260
@@ -266,11 +267,10 @@ function _pullback_via_pushforward(
266267 dy,
267268 contexts:: Vararg{Context,C} ,
268269) where {F,C}
269- dx = map (CartesianIndices (x)) do j # preserve shape
270- t1 = pushforward (
271- f!, y, pushforward_prep, backend, x, (basis (backend, x, j),), contexts...
272- )
273- dot (dy, only (t1))
270+ dx = map (x, CartesianIndices (x)) do xj, j # preserve shape
271+ bj = basis (backend, x, j)
272+ tj = pushforward (f!, y, pushforward_prep, backend, x, (bj,), contexts... )
273+ dot (dy, only (tj))
274274 end
275275 return dx
276276end
0 commit comments