Skip to content

Commit

Permalink
Don't call parent before similar (#159)
Browse files Browse the repository at this point in the history
* rm parent hack

* mark two NamedDims tests broken

* test on 1.8

* v0.3.5

* mark gpu test broken

* skip not broken
  • Loading branch information
mcabbott committed Sep 22, 2022
1 parent bdf572c commit 4ce1053
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 1 addition & 2 deletions src/macro.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ))
Expand Down
2 changes: 1 addition & 1 deletion test/gradients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
4 changes: 2 additions & 2 deletions test/parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

2 comments on commit 4ce1053

@mcabbott
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/68789

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.5 -m "<description of version>" 4ce1053b533b22e3c9a12c8f97bb8cd314fc0877
git push origin v0.3.5

Please sign in to comment.