Skip to content

Commit

Permalink
Merge pull request #288 from iblis17/upstream-random
Browse files Browse the repository at this point in the history
random: upstream api change
  • Loading branch information
vchuravy committed Oct 4, 2017
2 parents 6d1ba53 + 251a8b3 commit ebb03d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/random.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function rand!(low::Real, high::Real, out::NDArray)
# XXX: note we reverse shape because julia and libmx has different dim order
_sample_uniform(NDArray, low=low, high=high, shape=reverse(size(out)), out=out)
_random_uniform(NDArray, low=low, high=high, shape=reverse(size(out)), out=out)
end
function rand{N}(low::Real, high::Real, shape::NTuple{N, Int})
rand(low, high, shape, cpu())
Expand All @@ -12,7 +12,7 @@ end

function randn!(mean::Real, stdvar::Real, out::NDArray)
# XXX: note we reverse shape because julia and libmx has different dim order
_sample_normal(NDArray, loc=mean, scale=stdvar, shape=reverse(size(out)), out=out)
_random_normal(NDArray, loc=mean, scale=stdvar, shape=reverse(size(out)), out=out)
end
function randn{N}(mean::Real, stdvar::Real, shape::NTuple{N,Int})
randn(mean, stdvar, shape, cpu())
Expand Down

0 comments on commit ebb03d0

Please sign in to comment.