Add test for get

This commit is contained in:
Iaroslav 2020-06-27 21:21:16 +07:00
parent b6bf741dbe
commit e466f4bdf2
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7

View File

@ -3,6 +3,7 @@ package scientifik.kmath.nd4j
import org.nd4j.linalg.factory.Nd4j import org.nd4j.linalg.factory.Nd4j
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals
import scientifik.kmath.structures.get
internal class INDArrayStructureTest { internal class INDArrayStructureTest {
@Test @Test
@ -35,4 +36,11 @@ internal class INDArrayStructureTest {
val struct = INDArrayIntStructure(nd) val struct = INDArrayIntStructure(nd)
assertEquals(5, struct.dimension) assertEquals(5, struct.dimension)
} }
@Test
fun testGet() {
val nd = Nd4j.rand(10, 2, 3, 6)!!
val struct = INDArrayIntStructure(nd)
assertEquals(nd.getInt(0, 0, 0, 0), struct[0, 0, 0, 0])
}
} }