Exemplo n.º 1
0
        static internal TensorShape ApplyStridedSlice(this TensorShape shape, int[] starts, int[] ends, int[] stride)
        {
            unsafe
            {
                int *starts8Dbuffer = stackalloc int[TensorShape.MaxRank];
                int *ends8Dbuffer   = stackalloc int[TensorShape.MaxRank];
                int *stride8Dbuffer = stackalloc int[TensorShape.MaxRank];
                Get8DParametersNoAlloc(shape, starts, starts8Dbuffer, 0);
                Get8DParametersNoAlloc(shape, ends, ends8Dbuffer, 1);
                Get8DParametersNoAlloc(shape, stride, stride8Dbuffer, 1);

                return(shape.ApplyStridedSlice8DUnsafeNoAlloc(starts8Dbuffer, ends8Dbuffer, stride8Dbuffer));
            }
        }