Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-212] [R] Fix Random Samplers from Uniform and Gaussian distribution in R bindings #10450

Merged
merged 3 commits into from
Apr 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R-package/R/random.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mx.runif <- function(shape, min=0, max=1, ctx=NULL) {
if (!is.numeric(min)) stop("mx.rnorm only accept numeric min")
if (!is.numeric(max)) stop("mx.rnorm only accept numeric max")
ret <- mx.nd.internal.empty(shape, ctx)
return (mx.nd.internal.sample.uniform(min, max, shape=shape, out=ret))
return (mx.nd.internal.random.uniform(min, max, shape=shape, out=ret))
}

#' Generate nomal distribution with mean and sd.
Expand All @@ -73,5 +73,5 @@ mx.rnorm <- function(shape, mean=0, sd=1, ctx=NULL) {
if (!is.numeric(mean)) stop("mx.rnorm only accept numeric mean")
if (!is.numeric(sd)) stop("mx.rnorm only accept numeric sd")
ret <- mx.nd.internal.empty(shape, ctx)
return (mx.nd.internal.sample.normal(mean, sd, shape=shape, out=ret))
return (mx.nd.internal.random.normal(mean, sd, shape=shape, out=ret))
}