Implement kmath-nd4j: module that implements NDStructure for INDArray of ND4J #116
@ -0,0 +1,3 @@
|
||||
package scientifik.kmath.nd4j
|
||||
|
||||
internal fun narrowToIntArray(la: LongArray): IntArray = IntArray(la.size) { la[it].toInt() }
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user