Comments (6)
Simply from looking at the stack trace (I have not tested it myself), it seems as if the pullback function of tensortrace!
gets a Tuple{Float64}
as adjoint input ΔC
, instead of an Array{Float64,0}
. This is strange, as the pullback rule of tensorscalar
does transform a scalar back into a Array{Float64,0}
value. Is Zygote trying to be smart here, by replacing this zero-dimensional array with a Tuple in between these two steps? Or is it somehow simply sidestepping the pullback rule of tensorscalar
?
from tensoroperations.jl.
I just quickly checked: The pullback rule of tensorscalar
is being called and it does indeed output an Array{Float64,0}
. Then ΔC
somehow gets converted to a Tuple{Float64}
in tensortrace!
. Is this perhaps also related to the @thunk
and unthunk
of ChainRulesCore?
What's also weird is that pC
is just an empty tuple ((), ())
such that numind(pC)
in tensortrace!
errors as well, when I force ΔC
to be of the correct type. So I don't quite understand what is happening under the hood of Zygote here.
from tensoroperations.jl.
So apparently it's not Zygote's fault, but ours.
julia> scale(fill(0.5), 0.3)
(0.15,)
scale
is the culprit here that changes the Array{Float64,0}
into a Tuple{Float64}
. Will investigate further, this should very clearly not happen!
Addendum:
The reason seems to be with broadcasting; broadcasting is used to implement scale(::AbstractArray, ::Number)
, but it treats zero-dimensional arrays specially and does not preserve them.
from tensoroperations.jl.
Ok, so this fixes it on my side: Jutho/VectorInterface.jl@d4d1129
As soon as the tests turn green, I will tag a new release.
from tensoroperations.jl.
Great, thanks for the fast fix!
from tensoroperations.jl.
Fixed and tagged in v4.1
from tensoroperations.jl.
Related Issues (20)
- Manual allocation strategy HOT 2
- Floating Point Accuracy of @tensor results with CUDA HOT 3
- Enable multithreads when doing the permutedims in the TTGT algorithms HOT 2
- Unexpected `DimensionMismatch` (v4.0.2 -> v4.0.3) HOT 3
- Wrong result with subnetworks with equal labels HOT 2
- Bug in CUDA backend HOT 6
- Unintuitive `ncon` result when scalar HOT 3
- np.einsum_path vs TensorOperations HOT 3
- `ncon` fails with AD HOT 2
- `tensortrace` not working on Arrays of Symbolic Expressions from Symbolics.jl. HOT 2
- Combining LinearAlgebra.Diagonal with a CuArray inside @tensor HOT 2
- Compability with CUDA 5.2 HOT 4
- Confusion when using cuTENSOR HOT 5
- cuTENSOR not working with automatic differentiation HOT 5
- Freed reference problem when combining cuTENSOR and Zygote HOT 8
- TensorOperationscuTENSORExt fails to compile HOT 4
- Costchecks are not using `GlobalRef` HOT 2
- Optdata cannot use `Int` as labeltype HOT 1
- install newest version? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensoroperations.jl.