Пример #1
0
        public static void AddScale(AlignedArray src, AlignedArray dst,
                                    AlignedArray accGrads, AlignedArray accUpdates, float decay, float cond)
        {
            Contracts.Assert(Compat(src));
            Contracts.Assert(Compat(dst));
            Contracts.Assert(Compat(accGrads));
            Contracts.Assert(Compat(accUpdates));
            Contracts.Assert(src.Size == dst.Size);
            Contracts.Assert(src.Size == accGrads.Size);
            Contracts.Assert(src.Size == accUpdates.Size);

            unsafe
            {
                fixed(float *psrc = &src.Items[0])
                fixed(float *pdst = &dst.Items[0])
                fixed(float *pag  = &accGrads.Items[0])
                fixed(float *pau  = &accUpdates.Items[0])
                Thunk.AddScaleGradX(Ptr(src, psrc), Ptr(dst, pdst), Ptr(accGrads, pag), Ptr(accUpdates, pau), decay, cond, dst.Size);
            }
        }