/*** Reduce Functions ***/

        public FloatTensor Reduce(
            Func <float, float, long, float[], float> reducer,
            Func <float, long, float> mapper
            )
        {
            int[]   outDims = { 1 };
            float[] output  = new float[1];
            output[0] = mapper(MultiThread.Reduce <float>(data, reducer), Size);

            return(new FloatTensor(ctrl, outDims, output));
        }
Beispiel #2
0
/*** Reduce Functions ***/

        public FloatTensor Reduce(
            Func <float, float, int, float[], float> reducer,
            Func <float, int, float> mapper
            )
        {
            int[] outDims = { 1 };
            var   output  = new float[1];

            output[0] = mapper(MultiThread.Reduce(data, reducer), Size);

            return(new FloatTensor(controller, outDims, output));
        }
Beispiel #3
0
/*** Reduce Functions ***/

        public FloatTensor Reduce(
            Func <float, float, int, float[], float> reducer,
            Func <float, int, float> mapper
            )
        {
            int[] outDims = { 1 };
            var   output  = new float[1];

            output[0] = mapper(MultiThread.Reduce(data, reducer), Size);

            return(factory.Create(_shape: outDims, _data: output));
        }