示例#1
0
        private static void SamplePermute()
        {
            IComputationHandler handler = new CudaFloat32Handler();

            INDArray array = handler.NDArray(ArrayUtils.Range(1, 30), 5L, 3L, 2L);

            Console.WriteLine(ArrayUtils.ToString(array, (ADNDArray <float> .ToStringElement)null, 0, true));

            array.PermuteSelf(1, 0, 2);

            Console.WriteLine(ArrayUtils.ToString(array, (ADNDArray <float> .ToStringElement)null, 0, true));
        }
示例#2
0
        /// <summary>
        /// Process a certain ndarray with a certain computation handler.
        /// </summary>
        /// <param name="array">The ndarray to process.</param>
        /// <param name="handler">The computation handler to do the processing with.</param>
        /// <returns>An ndarray with the processed contents of the given array (can be the same or a new one).</returns>
        internal override INDArray ProcessDirect(INDArray array, IComputationHandler handler)
        {
            array.PermuteSelf(_rearrangedDimensions);

            return(array);
        }