This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function betterind(tree,indices,usedind=0) | |
if isa(tree,Int) | |
return tree,indices,usedind,Dict() | |
else | |
(lt,indices,usedind,ltm)=betterind(tree[1],indices,usedind) | |
(rt,indices,usedind,rtm)=betterind(tree[2],indices,usedind) | |
tocont=intersect(indices[lt],indices[rt]) | |
nind=Dict(zip(tocont,usedind+1:usedind+length(tocont))) | |
usedind+=length(tocont) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Base.Threads; | |
struct SimpleType{T} | |
a::Vector{Matrix{T}} | |
end | |
Base.length(t::SimpleType) = length(t.a) | |
Base.getindex(t::SimpleType,i) = t.a[i]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Strided | |
function fun1() | |
A = randn(40,40,40,40); | |
B = randn(40,40,40,40); | |
function fun2() | |
as=StridedView(A); | |
bs=StridedView(B); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filterdimstrides(dims,strides) | |
i = findfirst(isequal(1), dims) | |
if !(i isa Nothing) | |
newdims = TupleTools.deleteat(dims, i) | |
newstrides = broadcast(TupleTools.deleteat, strides, (i,)) | |
return filterdimstrides(newdims,newstrides) | |
else | |
return dims,strides | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on julia 1.1 | |
julia/base/compiler/abstractinterpretation.jl | |
803d802 | |
< print("abstract call gf by type ",argtypes,"\n\n") #why isn't revise picking up these changes? | |
806d804 | |
< print("abstract calling ",f," with args \n",fargs,"\n\n") | |
1217a1216 | |
> |