We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfba2d2 commit d58ebabCopy full SHA for d58ebab
1 file changed
src/forward.jl
@@ -15,7 +15,11 @@ function diff(arg::Tensor, wrt::Tensor)
15
return evaluate(D) # evaluate to get rid of the constant factor
16
end
17
18
- indices = union(arg.indices, [flip(i) for i ∈ wrt.indices])
+ # TODO: What is the canonical way?
19
+ indices = copy(arg.indices)
20
+ foreach(i -> push!(indices, flip(i)), wrt.indices)
21
+
22
+ indices = eliminate_indices(indices)
23
24
return Zero(unique(indices)...)
25
0 commit comments