Skip to content

Commit

Permalink
Merge pull request #282 from iblis17/srand
Browse files Browse the repository at this point in the history
random: rename srand! to srand
  • Loading branch information
vchuravy committed Oct 5, 2017
2 parents ebb03d0 + 5b3c507 commit 0a53778
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
10 changes: 8 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# v0.3.0 (TBD)

## New API

* `deepcopy` for NDArray (#273)

## API Changes

* `reshape` of NDArray share the same interface with Base (#272).
* `reshape(NDArray, dim; reverse=false)`
* `reshape(NDArray, dim...; reverse=false)`
* `Reshape` deprecated.

* `reshape` of SymbolicNode share the same interface with Base
and additional keyword argument (#279).
* `reshape` of SymbolicNode share the same interface with Base
and additional keyword argument (#279).

* `reshape(SymbolicNode, dim; reverse=false, name)`
* `reshape(SymbolicNode, dim...; reverse=false, name)`
* `Reshape` deprecated.

* `srand!` deprecated, please use `srand` (#282)

# v0.2.2 (2017.05.14)
* Updated supported version of MXNet to 0.9.4.
* Improved build-system with support for auto-detecting GPU support.
Expand Down
3 changes: 3 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
# SymbolicNode reshape (#279)
@deprecate reshape(sym::SymbolicNode; shape=()) reshape(sym, shape)
@deprecate Reshape(sym::SymbolicNode; shape=()) reshape(sym, shape)

# srand (#282)
@deprecate srand!(seed_state::Int) srand(seed_state)
2 changes: 1 addition & 1 deletion src/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ function randn{N}(mean::Real, stdvar::Real, shape::NTuple{N,Int}, ctx::Context)
randn!(mean, stdvar, out)
end

function srand!(seed_state::Int)
function srand(seed_state::Int)
@mxcall(:MXRandomSeed, (Cint,), seed_state)
end
8 changes: 4 additions & 4 deletions test/unittest/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ function test_uniform()

low = -10; high = 10
seed = 123
mx.srand!(seed)
mx.srand(seed)
ret1 = mx.rand(low, high, dims)

mx.srand!(seed)
mx.srand(seed)
ret2 = mx.empty(dims)
mx.rand!(low, high, ret2)

Expand All @@ -25,10 +25,10 @@ function test_gaussian()

μ = 10; σ = 2
seed = 456
mx.srand!(seed)
mx.srand(seed)
ret1 = mx.randn(μ, σ, dims)

mx.srand!(seed)
mx.srand(seed)
ret2 = mx.empty(dims)
mx.randn!(μ, σ, ret2)

Expand Down

0 comments on commit 0a53778

Please sign in to comment.