cjolivier01 commented on issue #9366: Refactor dropout operator to use 
ParallelRandom generator and also react deterministically when seeding
URL: https://github.com/apache/incubator-mxnet/pull/9366#issuecomment-357253246
 
 
   you can?t pass a CPU pointer as an argument to a GPU function because it?ll
   crash.
   
   even if it were just cpu, there?s also 2 other reasons you either don?t
   need to or shouldn?t pass it by reference here.
   
   On Fri, Jan 12, 2018 at 2:11 AM Pedro Larroy <[email protected]>
   wrote:
   
   > *@larroy* commented on this pull request.
   > ------------------------------
   >
   > In src/operator/nn/dropout-inl.h
   > <https://github.com/apache/incubator-mxnet/pull/9366#discussion_r161183446>
   > :
   >
   > > +   * \brief Dropout kernel, compute dropout tensor
   > +   */
   > +  struct DropoutKernel {
   > +    /*!
   > +     * \brief Dropout kernel function
   > +     * \param id Thread number (0-based representing count)
   > +     * \param gen Random number generator
   > +     * \param N Total number of items in the output
   > +     * \param step Step between items, related to parallelism
   > +     * \param dropout_out Output dropout values
   > +     * \param mask_out  Output mask (is multiplied to create dropout 
output, may be 0)
   > +     * \param input_data Input data to perform the dropout on
   > +     * \param pkeep Dropout rate (keep when the generated random number 
is less than this value)
   > +     */
   > +    MSHADOW_XINLINE static void Map(int id,
   > +                                    RandGenerator<xpu, DType> gen,
   >
   > @yzhliu <https://github.com/yzhliu> thanks for the answer. I see that
   > RNG_KERNEL_LOOP uses it by reference. I don't fully get the reason yet. The
   > *device* function you mean is RandGenerator<xpu,GType>::Impl? Just trying
   > to understand.
   >
   > ?
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/incubator-mxnet/pull/9366#discussion_r161183446>,
   > or mute the thread
   > 
<https://github.com/notifications/unsubscribe-auth/AKts_XIUtzW-3jrOSUvzRYZwwDYkmQjbks5tJy_BgaJpZM4RYofS>
   > .
   >
   

----------------------------------------------------------------
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