Skip to content

Commit

Permalink
relax bernoulli rand type
Browse files Browse the repository at this point in the history
  • Loading branch information
xukai92 committed Apr 23, 2019
1 parent 5bfb9c4 commit f9d7a23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/distributions/bernoulli.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function logpdf(bb::BatchBernoulli, x)
return lp
end

function rand(bb::BatchBernoulli)
function rand(bb::BatchBernoulli{T}) where {T}
FT = eltype(bb.p)

u = rand(FT, size(bb.p)...)
x = AT((Array(bb.p) .> u) * one(FT))
x = T((Array(bb.p) .> u) * one(FT))
return x
end

Expand Down

0 comments on commit f9d7a23

Please sign in to comment.