You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# return staticdim_argminmax_quote(OP, I, static_dims, N)
426
426
# end
427
427
428
-
# @generated function _vargminmax!(f::F, op::OP, init::I, C::AbstractArray{Tₗ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₗ, T, N, M, D<:Tuple{Vararg{Integer, M}}}
428
+
# @generated function _vargminmax!(f::F, op::OP, init::I, C::AbstractArray{Tₗ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₗ, T, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
429
429
# branches_argminmax_quote(OP, I, N, M, D)
430
430
# end
431
431
# @generated function _vargminmax!(f::F, op::OP, init::I, C::AbstractArray{Tₗ, N}, A::AbstractArray{T, N}, dims::Tuple{}) where {F, OP, I, Tₗ, T, N}
Copy file name to clipboardExpand all lines: src/vlogsoftmax.jl
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ function branches_logsoftmax_quote(N::Int, M::Int, D)
160
160
returnstaticdim_logsoftmax_quote(static_dims, N)
161
161
end
162
162
163
-
@generatedfunction_vlogsoftmax!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::D) where {Tₒ, T, Tₘ, N, M, D<:Tuple{Vararg{Integer, M}}}
163
+
@generatedfunction_vlogsoftmax!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::D) where {Tₒ, T, Tₘ, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
@@ -323,7 +323,7 @@ function branches_tlogsoftmax_quote(N::Int, M::Int, D)
323
323
returnstaticdim_tlogsoftmax_quote(static_dims, N)
324
324
end
325
325
326
-
@generatedfunction_vtlogsoftmax!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::D) where {Tₒ, T, Tₘ, N, M, D<:Tuple{Vararg{Integer, M}}}
326
+
@generatedfunction_vtlogsoftmax!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::D) where {Tₒ, T, Tₘ, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
# @generated function _vlogsumexp2!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::D) where {Tₒ, T, Tₘ, N, M, D<:Tuple{Vararg{Integer, M}}}
335
+
# @generated function _vlogsumexp2!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::D) where {Tₒ, T, Tₘ, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
336
336
# branches_logsumexp2_quote(N, M, D)
337
337
# end
338
338
# @generated function _vlogsumexp2!(C::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, B::AbstractArray{Tₘ, N}, dims::Tuple{}) where {Tₒ, T, Tₘ, N}
@@ -522,7 +522,7 @@ function branches_tlogsumexp_quote(N::Int, M::Int, D)
522
522
returnstaticdim_tlogsumexp_quote(static_dims, N)
523
523
end
524
524
525
-
@generatedfunction_vtlogsumexp!(B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {Tₒ, T, N, M, D<:Tuple{Vararg{Integer, M}}}
525
+
@generatedfunction_vtlogsumexp!(B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {Tₒ, T, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
526
526
branches_tlogsumexp_quote(N, M, D)
527
527
end
528
528
@generatedfunction_vtlogsumexp!(B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::Tuple{}) where {Tₒ, T, N}
Copy file name to clipboardExpand all lines: src/vmapreduce.jl
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
# - Using compile-time branch resolution rather than dispatch system (well,
9
9
# less on the dispatch system)
10
10
_dim(::Type{StaticInt{N}}) where {N} = N::Int
11
+
const IntOrStaticInt = Union{Integer, StaticInt}
11
12
# Stable return type version, otherwise it's just a suggestion
12
13
# _dim(::Type{StaticInt{N}})::Int where {N} = N
13
14
@@ -363,7 +364,7 @@ function branches_mapreduce_quote(OP, I, N::Int, M::Int, D)
363
364
returnstaticdim_mapreduce_quote(OP, I, static_dims, N)
364
365
end
365
366
366
-
@generatedfunction_vvmapreduce!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{Integer, M}}}
367
+
@generatedfunction_vvmapreduce!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
367
368
branches_mapreduce_quote(OP, I, N, M, D)
368
369
end
369
370
@@ -537,7 +538,7 @@ function branches_mapreduce_init_quote(OP, N::Int, M::Int, D)
@generatedfunction_vvmapreduce_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{Integer, M}}}
541
+
@generatedfunction_vvmapreduce_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
541
542
branches_mapreduce_init_quote(OP, N, M, D)
542
543
end
543
544
@generatedfunction_vvmapreduce_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::Tuple{}) where {F, OP, I, Tₒ, T, N}
@@ -873,7 +874,7 @@ function branches_tmapreduce_quote(OP, I, N::Int, M::Int, D)
873
874
returnstaticdim_tmapreduce_quote(OP, I, static_dims, N)
874
875
end
875
876
876
-
@generatedfunction_vtmapreduce!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{Integer, M}}}
877
+
@generatedfunction_vtmapreduce!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
877
878
branches_tmapreduce_quote(OP, I, N, M, D)
878
879
end
879
880
@@ -1041,7 +1042,7 @@ function branches_tmapreduce_init_quote(OP, N::Int, M::Int, D)
@generatedfunction_vtmapreduce_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{Integer, M}}}
1045
+
@generatedfunction_vtmapreduce_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::D) where {F, OP, I, Tₒ, T, N, M, D<:Tuple{Vararg{IntOrStaticInt, M}}}
1045
1046
branches_tmapreduce_init_quote(OP, N, M, D)
1046
1047
end
1047
1048
@generatedfunction_vtmapreduce_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, A::AbstractArray{T, N}, dims::Tuple{}) where {F, OP, I, Tₒ, T, N}
Copy file name to clipboardExpand all lines: src/vmapreduce_vararg.jl
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,7 @@ function map_vararg_quote(P::Int)
249
249
end
250
250
end
251
251
252
-
# @generated function _vvmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{Integer, M}}}
252
+
# @generated function _vvmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
253
253
# branches_mapreduce_vararg_quote(OP, I, N, M, P, D)
254
254
# end
255
255
@@ -259,7 +259,7 @@ end
259
259
# end
260
260
261
261
# Versions which cover arrays with different element types
262
-
@generatedfunction_vvmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{Integer, M}}}
262
+
@generatedfunction_vvmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
263
263
branches_mapreduce_vararg_quote(OP, I, N, M, P, D)
264
264
end
265
265
@@ -465,15 +465,15 @@ function branches_mapreduce_vararg_init_quote(OP, N::Int, M::Int, P::Int, D)
465
465
returnstaticdim_mapreduce_vararg_init_quote(OP, static_dims, N, P)
466
466
end
467
467
468
-
# @generated function _vvmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{Integer, M}}}
468
+
# @generated function _vvmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
469
469
# branches_mapreduce_vararg_init_quote(OP, N, M, P, D)
470
470
# end
471
471
# @generated function _vvmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::Tuple{}) where {F, OP, I, Tₒ, T, N, S<:AbstractArray{T, N}, P}
472
472
# map_vararg_quote(P)
473
473
# end
474
474
475
475
# Versions which cover arrays with different element types
476
-
@generatedfunction_vvmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{Integer, M}}}
476
+
@generatedfunction_vvmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
477
477
branches_mapreduce_vararg_init_quote(OP, N, M, P, D)
478
478
end
479
479
@@ -747,7 +747,7 @@ function tmap_vararg_quote(P::Int)
747
747
end
748
748
end
749
749
750
-
# @generated function _vtmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{Integer, M}}}
750
+
# @generated function _vtmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
751
751
# branches_tmapreduce_vararg_quote(OP, I, N, M, P, D)
752
752
# end
753
753
@@ -757,7 +757,7 @@ end
757
757
# end
758
758
759
759
# Versions which cover arrays with different element types
760
-
@generatedfunction_vtmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{Integer, M}}}
760
+
@generatedfunction_vtmapreduce_vararg!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
761
761
branches_tmapreduce_vararg_quote(OP, I, N, M, P, D)
762
762
end
763
763
@@ -958,15 +958,15 @@ function branches_tmapreduce_vararg_init_quote(OP, N::Int, M::Int, P::Int, D)
958
958
returnstaticdim_tmapreduce_vararg_init_quote(OP, static_dims, N, P)
959
959
end
960
960
961
-
# @generated function _vtmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{Integer, M}}}
961
+
# @generated function _vtmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::D) where {F, OP, I, Tₒ, T, N, M, S<:AbstractArray{T, N}, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
962
962
# branches_tmapreduce_vararg_init_quote(OP, N, M, P, D)
963
963
# end
964
964
# @generated function _vtmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{S, P}}, dims::Tuple{}) where {F, OP, I, Tₒ, T, N, S<:AbstractArray{T, N}, P}
965
965
# tmap_vararg_quote(P)
966
966
# end
967
967
968
968
# Versions which cover arrays with different element types
969
-
@generatedfunction_vtmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{Integer, M}}}
969
+
@generatedfunction_vtmapreduce_vararg_init!(f::F, op::OP, init::I, B::AbstractArray{Tₒ, N}, As::Tuple{Vararg{AbstractArray, P}}, dims::D) where {F, OP, I, Tₒ, N, M, P, D<:Tuple{Vararg{IntOrStaticInt, M}}}
970
970
branches_tmapreduce_vararg_init_quote(OP, N, M, P, D)
0 commit comments