Move narrowToIntArray to new file

This commit is contained in:
Commander Tvis 2020-06-11 14:17:46 +07:00
parent 3df9892de5
commit 9a4dd31507
No known key found for this signature in database
GPG Key ID: 70D5F4DCB0972F1B
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1,3 @@
package scientifik.kmath.nd4j
internal fun narrowToIntArray(la: LongArray): IntArray = IntArray(la.size) { la[it].toInt() }

View File

@ -3,8 +3,6 @@ package scientifik.kmath.nd4j
import org.nd4j.linalg.api.ndarray.INDArray
import scientifik.kmath.structures.NDStructure
internal fun narrowToIntArray(la: LongArray): IntArray = IntArray(la.size) { la[it].toInt() }
data class ND4JStructure<T>(val ndArray: INDArray) : NDStructure<INDArray> {
override val shape: IntArray
get() = narrowToIntArray(ndArray.shape())