@@ -54,30 +54,38 @@ function Distributions.rand!(
54
54
) where {N}
55
55
return Distributions. rand! (rng, d. dist, x)
56
56
end
57
- Distributions. logpdf (:: NoDist{<:Univariate} , x:: Real ) = zero (eltype (x))
58
- Distributions. logpdf (:: NoDist{<:Multivariate} , x:: AbstractVector{<:Real} ) = zero (eltype (x))
57
+ function Distributions. logpdf (:: NoDist{<:Univariate} , x:: Real )
58
+ return zero (float_type_with_fallback (eltype (x)))
59
+ end
60
+ function Distributions. logpdf (:: NoDist{<:Multivariate} , x:: AbstractVector{<:Real} )
61
+ return zero (float_type_with_fallback (eltype (x)))
62
+ end
59
63
function Distributions. logpdf (:: NoDist{<:Multivariate} , x:: AbstractMatrix{<:Real} )
60
- return zeros (eltype (x), size (x, 2 ))
64
+ return zeros (float_type_with_fallback (eltype (x)), size (x, 2 ))
65
+ end
66
+ function Distributions. logpdf (:: NoDist{<:Matrixvariate} , x:: AbstractMatrix{<:Real} )
67
+ return zero (float_type_with_fallback (eltype (x)))
61
68
end
62
- Distributions. logpdf (:: NoDist{<:Matrixvariate} , x:: AbstractMatrix{<:Real} ) = zero (eltype (x))
63
69
Distributions. minimum (d:: NoDist ) = minimum (d. dist)
64
70
Distributions. maximum (d:: NoDist ) = maximum (d. dist)
65
71
66
- Bijectors. logpdf_with_trans (:: NoDist{<:Univariate} , x:: Real , :: Bool ) = zero (eltype (x))
72
+ function Bijectors. logpdf_with_trans (:: NoDist{<:Univariate} , x:: Real , :: Bool )
73
+ return zero (float_type_with_fallback (eltype (x)))
74
+ end
67
75
function Bijectors. logpdf_with_trans (
68
76
:: NoDist{<:Multivariate} , x:: AbstractVector{<:Real} , :: Bool
69
77
)
70
- return zero (eltype (x))
78
+ return zero (float_type_with_fallback ( eltype (x) ))
71
79
end
72
80
function Bijectors. logpdf_with_trans (
73
81
:: NoDist{<:Multivariate} , x:: AbstractMatrix{<:Real} , :: Bool
74
82
)
75
- return zeros (eltype (x), size (x, 2 ))
83
+ return zeros (float_type_with_fallback ( eltype (x) ), size (x, 2 ))
76
84
end
77
85
function Bijectors. logpdf_with_trans (
78
86
:: NoDist{<:Matrixvariate} , x:: AbstractMatrix{<:Real} , :: Bool
79
87
)
80
- return zero (eltype (x))
88
+ return zero (float_type_with_fallback ( eltype (x) ))
81
89
end
82
90
83
91
Bijectors. bijector (d:: NoDist ) = Bijectors. bijector (d. dist)
0 commit comments