Skip to content

Commit

Permalink
cool
Browse files Browse the repository at this point in the history
  • Loading branch information
willow-ahrens committed Nov 22, 2024
1 parent 0baf056 commit 7cda878
Show file tree
Hide file tree
Showing 23 changed files with 474 additions and 283 deletions.
50 changes: 0 additions & 50 deletions test/reference32/interface/asmd.txt

This file was deleted.

76 changes: 0 additions & 76 deletions test/reference32/interface/getindex.txt

This file was deleted.

102 changes: 0 additions & 102 deletions test/reference32/interface/permutedims.txt

This file was deleted.

35 changes: 0 additions & 35 deletions test/reference32/interface/reduce.txt

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
+,-, *, / tests
julia> A = Tensor(Dense(SparseList(Element(0.0))), [0.0 0.0 4.4; 1.1 0.0 0.0; 2.2 0.0 5.5; 3.3 0.0 0.0])
4×3 Tensor{DenseLevel{Int64, SparseListLevel{Int64, Vector{Int64}, Vector{Int64}, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 4.4
1.1 0.0 0.0
2.2 0.0 5.5
3.3 0.0 0.0
julia> A + 1
4×3 Tensor{DenseLevel{Int64, DenseLevel{Int64, ElementLevel{1.0, Float64, Int64, Vector{Float64}}}}}:
1.0 1.0 5.4
2.1 1.0 1.0
3.2 1.0 6.5
4.3 1.0 1.0
julia> 1 + A
4×3 Tensor{DenseLevel{Int64, DenseLevel{Int64, ElementLevel{1.0, Float64, Int64, Vector{Float64}}}}}:
1.0 1.0 5.4
2.1 1.0 1.0
3.2 1.0 6.5
4.3 1.0 1.0
julia> A + A
4×3 Tensor{DenseLevel{Int64, SparseDictLevel{Int64, Vector{Int64}, Vector{Int64}, Vector{Int64}, Dict{Tuple{Int64, Int64}, Int64}, Vector{Int64}, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 8.8
2.2 0.0 0.0
4.4 0.0 11.0
6.6 0.0 0.0
julia> 2A
4×3 Tensor{DenseLevel{Int64, SparseDictLevel{Int64, Vector{Int64}, Vector{Int64}, Vector{Int64}, Dict{Tuple{Int64, Int64}, Int64}, Vector{Int64}, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 8.8
2.2 0.0 0.0
4.4 0.0 11.0
6.6 0.0 0.0
julia> A * 3
4×3 Tensor{DenseLevel{Int64, SparseDictLevel{Int64, Vector{Int64}, Vector{Int64}, Vector{Int64}, Dict{Tuple{Int64, Int64}, Int64}, Vector{Int64}, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 13.2
3.3 0.0 0.0
6.6 0.0 16.5
9.9 0.0 0.0
julia> A / 3
4×3 Tensor{DenseLevel{Int64, SparseDictLevel{Int64, Vector{Int64}, Vector{Int64}, Vector{Int64}, Dict{Tuple{Int64, Int64}, Int64}, Vector{Int64}, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 1.46667
0.366667 0.0 0.0
0.733333 0.0 1.83333
1.1 0.0 0.0
julia> 3 / A
4×3 Tensor{DenseLevel{Int64, DenseLevel{Int64, ElementLevel{Inf, Float64, Int64, Vector{Float64}}}}}:
Inf Inf 0.681818
2.72727 Inf Inf
1.36364 Inf 0.545455
0.909091 Inf Inf

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
+,-, *, / tests
julia> A = Tensor(Dense(SparseList(Element(0.0))), [0.0 0.0 4.4; 1.1 0.0 0.0; 2.2 0.0 5.5; 3.3 0.0 0.0])
4×3 Tensor{DenseLevel{Int64, SparseListLevel{Int64, Vector{Int64}, Vector{Int64}, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 4.4
1.1 0.0 0.0
2.2 0.0 5.5
3.3 0.0 0.0
julia> A + 1
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{1.0, Float64, Int64, Vector{Float64}}}}}:
1.0 1.0 5.4
2.1 1.0 1.0
3.2 1.0 6.5
4.3 1.0 1.0
julia> 1 + A
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{1.0, Float64, Int64, Vector{Float64}}}}}:
1.0 1.0 5.4
2.1 1.0 1.0
3.2 1.0 6.5
4.3 1.0 1.0
julia> A + A
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 8.8
2.2 0.0 0.0
4.4 0.0 11.0
6.6 0.0 0.0
julia> 2A
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 8.8
2.2 0.0 0.0
4.4 0.0 11.0
6.6 0.0 0.0
julia> A * 3
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 13.2
3.3 0.0 0.0
6.6 0.0 16.5
9.9 0.0 0.0
julia> A / 3
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{0.0, Float64, Int64, Vector{Float64}}}}}:
0.0 0.0 1.46667
0.366667 0.0 0.0
0.733333 0.0 1.83333
1.1 0.0 0.0
julia> 3 / A
4×3 Tensor{DenseLevel{Int32, DenseLevel{Int32, ElementLevel{Inf, Float64, Int64, Vector{Float64}}}}}:
Inf Inf 0.681818
2.72727 Inf Inf
1.36364 Inf 0.545455
0.909091 Inf Inf

File renamed without changes.
Loading

0 comments on commit 7cda878

Please sign in to comment.