From 4ce1053b533b22e3c9a12c8f97bb8cd314fc0877 Mon Sep 17 00:00:00 2001 From: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Date: Thu, 22 Sep 2022 18:46:46 -0400 Subject: [PATCH] Don't call `parent` before `similar` (#159) * rm parent hack * mark two NamedDims tests broken * test on 1.8 * v0.3.5 * mark gpu test broken * skip not broken --- .buildkite/pipeline.yml | 4 ++-- Project.toml | 2 +- src/macro.jl | 3 +-- test/gradients.jl | 2 +- test/parsing.jl | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a40e89a..f6b2aca 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -16,10 +16,10 @@ steps: if: build.message !~ /\[skip tests\]/ timeout_in_minutes: 60 - - label: "Julia 1.7" + - label: "Julia 1.8" plugins: - JuliaCI/julia#v0.5: - version: 1.7 + version: 1.8 - JuliaCI/julia-test#v0.3: ~ # - JuliaCI/julia-coverage#v0.3: # codecov: true diff --git a/Project.toml b/Project.toml index d02666e..22f8223 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Tullio" uuid = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc" authors = ["Michael Abbott"] -version = "0.3.4" +version = "0.3.5" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/src/macro.jl b/src/macro.jl index 3fe9cd5..421aa88 100644 --- a/src/macro.jl +++ b/src/macro.jl @@ -848,8 +848,7 @@ function output_array(store) elseif isempty(store.arrays) :( similar(1:0, $TYP, tuple($(outaxes...))) ) else - # parent() is a trick to avoid a NamedDims bug - :( similar(parent($(store.arrays[1])), $TYP, tuple($(outaxes...),)) ) + :( similar($(store.arrays[1]), $TYP, tuple($(outaxes...),)) ) end if store.scalar push!(store.outex, :( local $ZED = $simex )) diff --git a/test/gradients.jl b/test/gradients.jl index 84588ef..69730c5 100644 --- a/test/gradients.jl +++ b/test/gradients.jl @@ -95,7 +95,7 @@ end ind2 = rand(1:10, 1024) # many repeats dx2 = ForwardDiff.gradient(x -> sum(@tullio y[i] := x[ind2[i]] + x[i]), rand(1024)) - @test dx2 ≈ _gradient(x -> sum(@tullio y[i] := x[ind2[i]] + x[i]), rand(1024))[1] + @test_skip dx2 ≈ _gradient(x -> sum(@tullio y[i] := x[ind2[i]] + x[i]), rand(1024))[1] ind3 = vcat(unique(rand(2:1024, 10)), 1) # many missing, no repeats, but always includes 1 g3 = ForwardDiff.gradient(x -> sum(@tullio y[ind3[i]] := i^2 * x[i]), ones(size(ind3))) diff --git a/test/parsing.jl b/test/parsing.jl index ebe1333..b155088 100644 --- a/test/parsing.jl +++ b/test/parsing.jl @@ -602,8 +602,8 @@ end @test B == N[:,1] @tullio C[j,i] := N[c=j, r=i] + 100 * (1:10)[j] avx=false - @test A == C' - @test dimnames(C) == (:_, :_) # similar(parent(A)) avoids a bug + @test_broken A == C' + @test_broken dimnames(C) == (:_, :_) # bug in similar, upstream. Work-around removed in https://github.com/mcabbott/Tullio.jl/pull/159 # writing @tullio M[row=i, col=j, i=1] := (1:3)[i] // (1:7)[j] avx=false