예제 #1
0
 public static unsafe void TransposeAandMatrixMultiply(float *a, long ad1, long ad2, float *b, long bd1, long bd2, float *c)
 {
     MKL.cblas_sgemm(MKL.ORDER.RowMajor, MKL.TRANSPOSE.Trans, MKL.TRANSPOSE.NoTrans, ad2, bd2, bd1, 1.0f, a, ad2, b, bd2, 0.0f, c, bd2);
 }
예제 #2
0
 public static unsafe void Exponential(float *inp, float *outp, long length)
 {
     MKL.vmsExp(length, inp, outp, Mode);
 }
예제 #3
0
 public static unsafe void Sigmoid(float *inp, float *outp, long length)
 {
     VectorizationFloat.ElementWiseMultiplyAVX(inp, -1, outp, length);
     MKL.vmsExp(length, outp, outp, Mode);
     VectorizationFloat.ElementWise_A_DividedBy_B_Plus_Vector(1, 1, outp, outp, length);
 }
예제 #4
0
 public static unsafe void MatrixMultiply(Tensor a, Tensor b, Tensor c)
 {
     MKL.cblas_sgemm(MKL.ORDER.RowMajor, MKL.TRANSPOSE.NoTrans, MKL.TRANSPOSE.NoTrans, a.Shape[0], b.Shape[1], b.Shape[0], 1.0f, (float *)a.Base.Array, b.Shape[0], (float *)b.Base.Array, b.Shape[1], 0.0f, (float *)c.Base.Array, b.Shape[1]);
 }