lanking520 commented on issue #12489: [WIP][MXNET-918] Random api
URL: https://github.com/apache/incubator-mxnet/pull/12489#issuecomment-422109321
 
 
   @mdespriee Firstly I think we have a collide operators. `_sample` and 
`_random` looks like the same with `random` and `sample`. So it looks like we 
shouldn't need to generate a new set of API in order to get this work. Instead, 
we should try to use Macros to do something similar to 
[python](https://github.com/apache/incubator-mxnet/blob/225f71f744ac5e7bd29868b6d3ba0e4fe2527c43/python/mxnet/symbol/random.py).
 Create a helper function that can choose between `sample` and `random`. Change 
the implementation a little bit more for Random Module:
   
   1. Set the args type as `Any` for Random API in order to take in 
`NDArray/Float` or `Symbol/Float`
   2. Do a instance check such as `asInstanceOf[NDArray]` to see if it is an 
object or numeric value
   3. Do `random_` or `sample_` in the function 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to