Example #1
0
        static void Bench(int batchSize, int loops)
        {
            NumDN.DebugNumPy = false;

            var sw = Stopwatch.StartNew();

            for (int k = 0; k < loops; ++k)
            {
                var x    = NumDN.UniformInt(0, 16, batchSize, 1, 8, 8).Cast <float>();
                var cols = Conv2d <float> .img2col(x, new int[] { 3, 3 }, 1);

                var x0 = Conv2d <float> .col2img(cols, x.Shape, new int[] { 3, 3 }, 1);
            }

            Console.WriteLine($"{0.001 * sw.ElapsedMilliseconds} s");
        }