|
44 | 44 | @test grad ≈ Zygote.gradient(m -> sum(sin, mapcols(fun, m)), mat)[1]
|
45 | 45 | @test grad ≈ Zygote.gradient(m -> sum(sin, MapCols{3}(fun, m)), mat)[1]
|
46 | 46 |
|
47 |
| - tcm3(mat) = @cast out[_,j] := fun(mat[:,j]) # changed here too |
48 |
| - @test res ≈ tcm3(mat) |
49 |
| - @test grad ≈ Zygote.gradient(m -> sum(sin, tcm3(m)), mat)[1] |
| 47 | + # tcm3(mat) = @cast out[_,j] := fun(mat[:,j]) # changed here too |
| 48 | + # @test res ≈ tcm3(mat) |
| 49 | + # @test grad ≈ Zygote.gradient(m -> sum(sin, tcm3(m)), mat)[1] |
50 | 50 |
|
51 | 51 | end
|
52 | 52 | @testset "columns, matrix" begin
|
|
66 | 66 | @test grad ≈ Zygote.gradient(m -> sum(sin, mapcols(fun, m)), mat)[1]
|
67 | 67 | @test grad ≈ Zygote.gradient(m -> sum(sin, MapCols{3}(fun, m)), mat)[1]
|
68 | 68 |
|
69 |
| - tcm4(mat) = @cast out[i⊗i′,j] := fun(mat[:,j])[i,i′] i:3, i′:3 # changed here too |
70 |
| - @test res ≈ tcm4(mat) |
71 |
| - @test grad ≈ Zygote.gradient(m -> sum(sin, tcm4(m)), mat)[1] |
| 69 | + # tcm4(mat) = @cast out[i⊗i′,j] := fun(mat[:,j])[i,i′] i:3, i′:3 # changed here too |
| 70 | + # @test res ≈ tcm4(mat) |
| 71 | + # @test grad ≈ Zygote.gradient(m -> sum(sin, tcm4(m)), mat)[1] |
72 | 72 |
|
73 | 73 | end
|
74 | 74 | @testset "rows" begin
|
|
83 | 83 | @test grad ≈ Tracker.gradient(m -> sum(sin, maprows(fun, m)), mat)[1]
|
84 | 84 | @test grad ≈ Zygote.gradient(m -> sum(sin, maprows(fun, m)), mat)[1]
|
85 | 85 |
|
86 |
| - tcm2(mat) = @cast out[i,j] := fun(mat[i,:])[j] |
87 |
| - @test res ≈ tcm2(mat) |
88 |
| - @test grad ≈ Zygote.gradient(m -> sum(sin, tcm2(m)), mat)[1] |
| 86 | + # tcm2(mat) = @cast out[i,j] := fun(mat[i,:])[j] |
| 87 | + # @test res ≈ tcm2(mat) |
| 88 | + # @test grad ≈ Zygote.gradient(m -> sum(sin, tcm2(m)), mat)[1] |
89 | 89 |
|
90 | 90 | end
|
91 | 91 | @testset "slices" begin
|
|
0 commit comments