Michael Abbott

Results 1143 comments of Michael Abbott

Julia 1.9 will have this. And ideally https://github.com/JuliaLang/Compat.jl/pull/663 would make this "official" version available before then.

I think it's not meant to work, but should have a friendlier error. A simpler example which does: ```julia julia> using TensorCast julia> slices = eachcol(rand(12, 12)); julia> size(@cast _[a,b,c]...

Here's what it's doing: ```julia julia> @pretty @cast P[i,j,k] := [R[:,:,k] X₁[:,k]][i,j] begin @boundscheck ndims(R) == 3 || throw(ArgumentError("expected a 3-tensor R[:, :, k]")) @boundscheck axes(R, 3) == axes(X₁, 2)...

That's a bug of some sort. In an expression like `@reduce a[i] := sum(j) b[i,j]`, and in one like `@cast c[i] := d[i] (i in 1:3)`, the macro gets two...

The problem is that `inv` doesn't accept sufficiently exotic `AbstractMatrix` types: ```julia julia> HH = view(P,:,[1,2,4],:) 3×3×100 view(lazystack(::Vector{Matrix{Float64}}), :, [1, 2, 4], :) ... julia> inv(HH[:,:,1]) # inv(::Matrix) 3×3 Matrix{Float64}:...

Yes complicated types alone aren't a problem. But complicated array types are, partly because accessing their elements involves more steps (like translating indices for views, and following different pointers for...

What's going on is that there is special handling for the diagonal elements of a matrix, but nothing is written for repeated indices in higher dimensional arrays. There's no built-in...

In this case `lazy=false` is a bit faster: ```julia julia> @btime M2 = reduce(hcat, reduce.(vcat, eachcol($B))); min 470.454 ns, mean 522.226 ns (4 allocations, 512 bytes) julia> @btime @cast M3[i⊗k,j⊗l]...

I'm not certain I know what this is doing, but in general everything in TensorCast needs to know `ndims` in advance. Have not explored how hard it would be to...

I do think applying this to the final user output would be enough. Maybe it's helpful to classify how some `fixup(x, dx)` function could behave: 1. Simplest is that is...