Michael Abbott
Michael Abbott
But when you say "same value, just different types", what does "same" mean? If we are talking about physical quantities, with units, then it does not mean infinite precision, surely....
I was going to say that these points all apply to angles, where radians are also pure numbers. But it turns out they have in fact been blessed by SI....
I think the obvious way to make this AD-able would be just rely on the gradient for getindex, which will store the indices for the backwards pass. Maybe it's as...
What I hoped might work, re-using what CUDA.jl already has, doesn't seem to -- can this easily be fixed? ```julia julia> sort(tuple.(cu(rand(10)), 1:10), by=first) ERROR: InvalidIRError: compiling kernel qsort_kernel(CuDeviceVector{Tuple{Float32, Int64},...
OK, this seems to work: ```julia function topkperm(x::CuArray, k::Integer; dims::Integer=1, rev=true, lt=isless, by=identity) tups = tuple.(x, reshape(axes(x,dims), fill(1, dims-1)..., :)) CUDA.quicksort!(tups; lt=(rev ? !lt : lt), by=by∘first, dims=dims, partial_k=1:k) tv...
Yes I don't like the redundancy of returning CartesianIndices, but I do like the simplicity of getindex. Maybe returning an array of linear indices instead would be nicer?
> really competitive with DelimitedFiles.jl and then I don't think there's really any reason to use it Unless you want a matrix not a dataframe, right? There is a place...
The first question is what rules it should obey. `batched_mul` is always matrix-matrix multiplication, and does this: ```julia julia> rand(3,4,7) ⊠ rand(4,5,7) |> size (3, 5, 7) julia> rand(3,4,1) ⊠...
The rule you suggest is, I think, this: ```julia rand(3,4,7,9) ⊠ rand(4,5,7,9) |> size # (3, 5, 7, 9) # trivial reshape rand(3,4,7,1) ⊠ rand(4,5,7,9) |> size # (3, 5,...
There are a few rules which have their own rules, as for `sum` here: https://github.com/JuliaDiff/ChainRules.jl/blob/main/src/rulesets/Base/mapreduce.jl#L36 Those ones look likely to work, to me. Although perhaps you could find ways to...