-
```julia-repl
julia> function f(::AbstractArray{Int,N}) where {N}
N::Int
N
end
f (generic function with 1 method)
julia> Core.Compiler.return_type(f, Tuple{Any})
…
-
```julia-repl
julia> f(t::Tuple, n::Bool) = t[10 + n]
f (generic function with 1 method)
julia> Core.Compiler.return_type(f, Tuple{Tuple{Bool,String,Vararg{Int}},Bool})
Union{Bool, Int64, String…
-
According to @aviatesk in https://github.com/JuliaLang/julia/issues/55147, the following code:
```julia
g() = [i for i in 1:0]
@generated function foo()
if g() isa Vector{Int}
retur…
-
Enzyme fails when using a custom type that is based on `SMatrix` and `abstract type` labels. The error is discussed [here](https://discourse.julialang.org/t/replacing-static-arrays-for-use-with-enzyme…
-
```julia
julia> gradient(x -> evalpoly(x, (1,2,3.5)), 2.0)
(16.0,)
julia> gradient(x -> evalpoly(x, [1,2,3.5]), 2.0)
(16.0,)
julia> gradient(x -> sum(evalpoly.(x, Ref((1,2,3.5)))), [2.0])
([…
-
I've run into an issue where I want to compute the gradient of an implicit function that itself depends on another implicit function. I can do the operation successfully with `FowardDiff`, however I …
-
```julia
sites = siteinds("Qubit", 3)
function f(x)
ψ = productMPS(sites, "0")
return x * inner(ψ,ψ)
end
f'(2.0)
```
Error:
```julia
ERROR: TypeError: in Type, in parameter, expect…
-
An effort to create a very simple Decapode, to help simplify diagnosing autodiff through decapode issues.
This is a 1-D harmonic oscillator Decapode:
```
using Catlab
using Catlab.Graphics
using…
-
I created a small Julia package, [`CompilerExplorer.jl`](https://github.com/giordano/CompilerExplorer.jl), which simply replicates what the [Julia wrapper in Compiler Explorer](https://github.com/comp…
-
Consider this silly little function:
```julia
f() = "foo" * "bar"
```
which concatenates two string constants, `"foo"` and `"bar"`, into one bigger constant `"foobar"`. The compiler agrees, an…