Example #1
0
        private void EventLayer_OnBackward(object sender, BackwardArgs <T> e)
        {
            int  nCount       = e.BottomVec[0].count();
            long hTopDiff0    = e.TopVec[0].mutable_gpu_diff;
            long hBottomData1 = e.BottomVec[1].gpu_data;
            long hBottomDiff1 = e.BottomVec[1].mutable_gpu_diff;
            long hBottomDiff  = e.BottomVec[0].mutable_gpu_diff;

            m_cuda.sign(nCount, hBottomData1, hBottomDiff1);
            m_cuda.abs(nCount, hBottomDiff1, hBottomDiff1);
            m_cuda.mul(nCount, hBottomDiff1, hTopDiff0, hBottomDiff);
        }