Tokyo Institute of Technology, Department of Computer Science, B3
For more information about me, please visit abap34.com
[wip] Lightweight Automatic Differentiation & DeepLearning Framework implemented in pure Julia.
License: MIT License
Tokyo Institute of Technology, Department of Computer Science, B3
For more information about me, please visit abap34.com
Currently, the function which contain in _func_to_jt_struct
in src/arr/broadcast.jl
are supported broadcast.
_func_to_jt_struct = Dict(
(+) => Add,
(-) => Sub,
(*) => Mul,
(/) => Div,
(^) => Pow,
(sin) => Sin,
(cos) => Cos,
(tan) => Tan,
(log) => Log,
)
so, Variable(arr) .^ 2
is thought to work, but it will be an error.
julia> x = [1, 2, 3]
3-element Vector{Int64}:
1
2
3
julia> x .^ 2
3-element Vector{Int64}:
1
4
9
julia> using JITrench
[ Info: Precompiling JITrench [573e55e6-eb53-4bcf-a884-6670806246ed]
julia> Variable([1, 2, 3]) .^ 2
ERROR: MethodError: no method matching length(::Variable)
Closest candidates are:
length(::Union{Base.KeySet, Base.ValueIterator}) at abstractdict.jl:58
length(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}} where {T, S}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/adjtrans.jl:195
length(::Union{DataStructures.OrderedRobinDict, DataStructures.RobinDict}) at /Users/yuchi_ymgc/.julia/packages/DataStructures/ixwFs/src/ordered_robin_dict.jl:86
...
Stacktrace:
[1] _similar_for(c::UnitRange{Int64}, #unused#::Type{Any}, itr::Variable, #unused#::Base.HasLength)
@ Base ./array.jl:575
[2] _collect(cont::UnitRange{Int64}, itr::Variable, #unused#::Base.HasEltype, isz::Base.HasLength)
@ Base ./array.jl:608
[3] collect(itr::Variable)
@ Base ./array.jl:602
[4] broadcastable(x::Variable)
@ Base.Broadcast ./broadcast.jl:682
[5] broadcasted(f::Function, arg1::Function, arg2::Variable, args::Val{2})
@ Base.Broadcast ./broadcast.jl:1313
[6] top-level scope
@ REPL[5]:1
The cause of the error seems that the specifications of Julia, the replace of pow when exp is literal.
julia> f() = Variable([1, 2, 3]) .^ 2
f (generic function with 1 method)
julia> @code_lowered f()
CodeInfo(
1 ─ %1 = Base.vect(1, 2, 3)
│ %2 = Main.Variable(%1)
│ %3 = Core.apply_type(Base.Val, 2)
│ %4 = (%3)()
│ %5 = Base.broadcasted(Base.literal_pow, Main.:^, %2, %4)
│ %6 = Base.materialize(%5)
└── return %6
)
It should be fixed as soon as possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.