From 8adc56b6cfb788c090394c2bd64249169c4789a5 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Tue, 21 Sep 2021 17:18:59 +0300 Subject: [PATCH] Remove usages of windows separators (#234) --- .../org/jetbrains/kotlinx/dl/dataset/handler/Cifar10Util.kt | 2 +- .../kotlinx/dl/dataset/preprocessor/image/ImageSaver.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/handler/Cifar10Util.kt b/api/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/handler/Cifar10Util.kt index 39df465fe..75c6fa615 100644 --- a/api/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/handler/Cifar10Util.kt +++ b/api/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/handler/Cifar10Util.kt @@ -27,7 +27,7 @@ private fun loadImagesFromDirectory( archiveName: String ): Array { val images = Array(subDatasetSize) { - ImageConverter.toNormalizedFloatArray(File("$archiveName\\${it + 1}.png")) + ImageConverter.toNormalizedFloatArray(File(archiveName, "${it + 1}.png")) } return images diff --git a/dataset/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/preprocessor/image/ImageSaver.kt b/dataset/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/preprocessor/image/ImageSaver.kt index bfff6e5b3..dd1dfe6b8 100644 --- a/dataset/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/preprocessor/image/ImageSaver.kt +++ b/dataset/src/main/kotlin/org/jetbrains/kotlinx/dl/dataset/preprocessor/image/ImageSaver.kt @@ -29,7 +29,7 @@ public class Save( @Throws(IOException::class) override fun save(filename: String, image: BufferedImage) { val outputFile: File = if (dirLocation!!.isDirectory) { - File("$dirLocation\\${filename}") + File(dirLocation, filename) } else { dirLocation!! }