public override List <IOPair> GetOutAndDiff(double[,,] input) { #region Копирование результатов в наибольший массив double[,,] newInput = doubleArrayExtensions.CreateArray(layers[0].input_size); int depth = input.GetLength(0); int height = input.GetLength(1); int width = input.GetLength(2); for (int z = 0; z < depth; z++) { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { newInput[z, y, x] = input[z, y, x]; } } } int offset = z_offset; depth = cached_output.GetLength(0); height = cached_output.GetLength(1); width = cached_output.GetLength(2); for (int z = 0; z < depth; z++) { int z2 = z + offset; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { newInput[z2, y, x] = cached_output[z, y, x]; } } } #endregion var result = base.GetOutAndDiff(newInput); #region Кеширование cached_last_layer = result[result.Count - 2].Key; cached_output = memory_layer.GetOutput(cached_last_layer); #endregion return(result); }