@@ -2,9 +2,9 @@ package sk.ai.net.io
22
33import junit.framework.TestCase.assertTrue
44import kotlinx.coroutines.runBlocking
5- import okio.buffer
6- import okio.source
7- import org.junit.Test
5+ import kotlinx.io.asSource
6+ import kotlinx.io.buffered
7+
88import sk.ai.net.Shape
99import sk.ai.net.dsl.network
1010import sk.ai.net.impl.DoublesTensor
@@ -16,9 +16,11 @@ import sk.ai.net.nn.reflection.flattenParams
1616import sk.ai.net.nn.reflection.summary
1717import sk.ai.net.nn.reflection.toVisualString
1818import java.io.InputStream
19+ import kotlin.io.path.Path
1920import kotlin.math.PI
2021import kotlin.math.abs
2122import kotlin.math.sin
23+ import kotlin.test.Test
2224import kotlin.test.assertEquals
2325
2426class CsvParametersLoaderTest {
@@ -47,7 +49,12 @@ class CsvParametersLoaderTest {
4749 print (sineModule.toVisualString())
4850
4951 javaClass.getResourceAsStream(" /sinus-approximator.json" )?.use { inputStream: InputStream ->
50- val parametersLoader = CsvParametersLoader { inputStream.source().buffer() }
52+
53+ // Convert it to a RawSource and then buffer it to get a Source:
54+ val source = inputStream.asSource().buffered()
55+
56+ // Convert the InputStream to a kotlinx-io Input:
57+ val parametersLoader = CsvParametersLoader { source }
5158
5259 val mapper = NamesBasedValuesModelMapper ()
5360
0 commit comments