Refactor for build tools 0.13.0
This commit is contained in:
parent
0c1d0aa64e
commit
ad97751327
@ -1,3 +1,6 @@
|
|||||||
|
import space.kscience.gradle.useApache2Licence
|
||||||
|
import space.kscience.gradle.useSPCTeam
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.project")
|
id("space.kscience.gradle.project")
|
||||||
id("org.jetbrains.kotlinx.kover") version "0.5.0"
|
id("org.jetbrains.kotlinx.kover") version "0.5.0"
|
||||||
@ -68,8 +71,12 @@ subprojects {
|
|||||||
readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md")
|
readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md")
|
||||||
|
|
||||||
ksciencePublish {
|
ksciencePublish {
|
||||||
github("kmath", addToRelease = false)
|
pom("https://github.com/SciProgCentre/kmath") {
|
||||||
space()
|
useApache2Licence()
|
||||||
|
useSPCTeam()
|
||||||
|
}
|
||||||
|
github("kmath", "SciProgCentre", addToRelease = false)
|
||||||
|
space("https://maven.pkg.jetbrains.space/mipt-npm/p/sci/dev")
|
||||||
sonatype()
|
sonatype()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package space.kscience.kmath.structures
|
package space.kscience.kmath.structures
|
||||||
|
|
||||||
|
import space.kscience.kmath.misc.PerformancePitfall
|
||||||
import space.kscience.kmath.nd.*
|
import space.kscience.kmath.nd.*
|
||||||
import space.kscience.kmath.operations.DoubleField
|
import space.kscience.kmath.operations.DoubleField
|
||||||
import space.kscience.kmath.operations.ExtendedField
|
import space.kscience.kmath.operations.ExtendedField
|
||||||
@ -49,6 +50,7 @@ class StreamDoubleFieldND(override val shape: IntArray) : FieldND<Double, Double
|
|||||||
return BufferND(strides, array.asBuffer())
|
return BufferND(strides, array.asBuffer())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun StructureND<Double>.map(
|
override fun StructureND<Double>.map(
|
||||||
transform: DoubleField.(Double) -> Double,
|
transform: DoubleField.(Double) -> Double,
|
||||||
): BufferND<Double> {
|
): BufferND<Double> {
|
||||||
@ -56,6 +58,7 @@ class StreamDoubleFieldND(override val shape: IntArray) : FieldND<Double, Double
|
|||||||
return BufferND(strides, array.asBuffer())
|
return BufferND(strides, array.asBuffer())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun StructureND<Double>.mapIndexed(
|
override fun StructureND<Double>.mapIndexed(
|
||||||
transform: DoubleField.(index: IntArray, Double) -> Double,
|
transform: DoubleField.(index: IntArray, Double) -> Double,
|
||||||
): BufferND<Double> {
|
): BufferND<Double> {
|
||||||
@ -69,6 +72,7 @@ class StreamDoubleFieldND(override val shape: IntArray) : FieldND<Double, Double
|
|||||||
return BufferND(strides, array.asBuffer())
|
return BufferND(strides, array.asBuffer())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun zip(
|
override fun zip(
|
||||||
left: StructureND<Double>,
|
left: StructureND<Double>,
|
||||||
right: StructureND<Double>,
|
right: StructureND<Double>,
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package space.kscience.kmath.tensors
|
package space.kscience.kmath.tensors
|
||||||
|
|
||||||
|
import space.kscience.kmath.misc.PerformancePitfall
|
||||||
import space.kscience.kmath.operations.invoke
|
import space.kscience.kmath.operations.invoke
|
||||||
import space.kscience.kmath.tensors.core.DoubleTensor
|
import space.kscience.kmath.tensors.core.DoubleTensor
|
||||||
import space.kscience.kmath.tensors.core.DoubleTensorAlgebra
|
import space.kscience.kmath.tensors.core.DoubleTensorAlgebra
|
||||||
@ -13,6 +14,7 @@ import kotlin.math.abs
|
|||||||
|
|
||||||
// OLS estimator using SVD
|
// OLS estimator using SVD
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
fun main() {
|
fun main() {
|
||||||
//seed for random
|
//seed for random
|
||||||
val randSeed = 100500L
|
val randSeed = 100500L
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:OptIn(PerformancePitfall::class)
|
||||||
|
|
||||||
package space.kscience.kmath.tensors
|
package space.kscience.kmath.tensors
|
||||||
|
|
||||||
|
import space.kscience.kmath.misc.PerformancePitfall
|
||||||
import space.kscience.kmath.operations.invoke
|
import space.kscience.kmath.operations.invoke
|
||||||
import space.kscience.kmath.tensors.core.BroadcastDoubleTensorAlgebra
|
import space.kscience.kmath.tensors.core.BroadcastDoubleTensorAlgebra
|
||||||
import space.kscience.kmath.tensors.core.DoubleTensor
|
import space.kscience.kmath.tensors.core.DoubleTensor
|
||||||
|
@ -12,4 +12,4 @@ org.gradle.configureondemand=true
|
|||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.jvmargs=-Xmx4096m
|
org.gradle.jvmargs=-Xmx4096m
|
||||||
|
|
||||||
toolsVersion=0.12.0-kotlin-1.7.20-Beta
|
toolsVersion=0.13.0-kotlin-1.7.20-Beta
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.js {
|
kotlin.js {
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018-2022 KMath contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package space.kscience.kmath.ast.rendering
|
||||||
|
|
||||||
|
internal actual fun Double.multiplatformToString(): String = toString()
|
||||||
|
internal actual fun Float.multiplatformToString(): String = toString()
|
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018-2022 KMath contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package space.kscience.kmath.ast
|
||||||
|
|
||||||
|
internal actual inline fun runCompilerTest(action: CompilerTestContext.() -> Unit) {
|
||||||
|
//doNothing
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
id("space.kscience.gradle.jvm")
|
||||||
id("space.kscience.gradle.common")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "Commons math binding for kmath"
|
description = "Commons math binding for kmath"
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
id("space.kscience.gradle.native")
|
|
||||||
|
kscience {
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
@ -20,14 +22,14 @@ readme {
|
|||||||
feature(
|
feature(
|
||||||
id = "complex",
|
id = "complex",
|
||||||
ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt"
|
||||||
){
|
) {
|
||||||
"Complex numbers operations"
|
"Complex numbers operations"
|
||||||
}
|
}
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "quaternion",
|
id = "quaternion",
|
||||||
ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt"
|
||||||
){
|
) {
|
||||||
"Quaternions and their composition"
|
"Quaternions and their composition"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api(project(":kmath-memory"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
@ -10,20 +17,8 @@ kotlin.sourceSets {
|
|||||||
it.optIn("space.kscience.kmath.misc.PerformancePitfall")
|
it.optIn("space.kscience.kmath.misc.PerformancePitfall")
|
||||||
it.optIn("space.kscience.kmath.misc.UnstableKMathAPI")
|
it.optIn("space.kscience.kmath.misc.UnstableKMathAPI")
|
||||||
}
|
}
|
||||||
|
|
||||||
commonMain {
|
|
||||||
dependencies {
|
|
||||||
api(project(":kmath-memory"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//generateUml {
|
|
||||||
// classTree {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
readme {
|
readme {
|
||||||
description = "Core classes, algebra definitions, basic linear algebra"
|
description = "Core classes, algebra definitions, basic linear algebra"
|
||||||
maturity = space.kscience.gradle.Maturity.DEVELOPMENT
|
maturity = space.kscience.gradle.Maturity.DEVELOPMENT
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
id("space.kscience.gradle.native")
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "A proof of concept module for adding type-safe dimensions to structures"
|
description = "A proof of concept module for adding type-safe dimensions to structures"
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import space.kscience.kmath.ejml.codegen.ejmlCodegen
|
import space.kscience.kmath.ejml.codegen.ejmlCodegen
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
id("space.kscience.gradle.jvm")
|
||||||
id("space.kscience.gradle.common")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2022 KMath contributors.
|
* Copyright 2018-2021 KMath contributors.
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This file is generated with buildSrc/src/main/kotlin/space/kscience/kmath/ejml/codegen/ejmlCodegen.kt */
|
/* This file is generated with buildSrc/src/main/kotlin/space/kscience/kmath/ejml/codegen/ejmlCodegen.kt */
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
id("space.kscience.gradle.native")
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets.commonMain {
|
kotlin.sourceSets.commonMain {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
id("space.kscience.gradle.native")
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "Functions, integration and interpolation"
|
description = "Functions, integration and interpolation"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets.commonMain {
|
kotlin.sourceSets.commonMain {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply(plugin = "kotlinx-atomicfu")
|
//apply(plugin = "kotlinx-atomicfu")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
id("space.kscience.gradle.jvm")
|
||||||
id("space.kscience.gradle.common")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets
|
kotlin.sourceSets
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience {
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
readme {
|
readme {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
package space.kscience.kmath.multik
|
package space.kscience.kmath.multik
|
||||||
|
|
||||||
import org.jetbrains.kotlinx.multik.default.DefaultEngine
|
import org.jetbrains.kotlinx.multik.default.DefaultEngine
|
||||||
|
import space.kscience.kmath.misc.PerformancePitfall
|
||||||
import space.kscience.kmath.nd.StructureND
|
import space.kscience.kmath.nd.StructureND
|
||||||
import space.kscience.kmath.nd.one
|
import space.kscience.kmath.nd.one
|
||||||
import space.kscience.kmath.operations.DoubleField
|
import space.kscience.kmath.operations.DoubleField
|
||||||
@ -14,6 +15,7 @@ import space.kscience.kmath.tensors.core.tensorAlgebra
|
|||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
internal class MultikNDTest {
|
internal class MultikNDTest {
|
||||||
val multikAlgebra = MultikDoubleAlgebra(DefaultEngine())
|
val multikAlgebra = MultikDoubleAlgebra(DefaultEngine())
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
id("space.kscience.gradle.jvm")
|
||||||
id("space.kscience.gradle.common")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "ND4J NDStructure implementation and according NDAlgebra classes"
|
description = "ND4J NDStructure implementation and according NDAlgebra classes"
|
||||||
|
@ -45,6 +45,7 @@ public sealed interface Nd4jArrayAlgebra<T, out C : Algebra<T>> : AlgebraND<T, C
|
|||||||
return newStruct
|
return newStruct
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun StructureND<T>.mapIndexed(
|
override fun StructureND<T>.mapIndexed(
|
||||||
transform: C.(index: IntArray, T) -> T,
|
transform: C.(index: IntArray, T) -> T,
|
||||||
): Nd4jArrayStructure<T> {
|
): Nd4jArrayStructure<T> {
|
||||||
@ -53,6 +54,7 @@ public sealed interface Nd4jArrayAlgebra<T, out C : Algebra<T>> : AlgebraND<T, C
|
|||||||
return new
|
return new
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun zip(
|
override fun zip(
|
||||||
left: StructureND<T>,
|
left: StructureND<T>,
|
||||||
right: StructureND<T>,
|
right: StructureND<T>,
|
||||||
|
@ -40,12 +40,15 @@ public sealed interface Nd4jTensorAlgebra<T : Number, A : Field<T>> : AnalyticTe
|
|||||||
|
|
||||||
override fun structureND(shape: Shape, initializer: A.(IntArray) -> T): Nd4jArrayStructure<T>
|
override fun structureND(shape: Shape, initializer: A.(IntArray) -> T): Nd4jArrayStructure<T>
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun StructureND<T>.map(transform: A.(T) -> T): Nd4jArrayStructure<T> =
|
override fun StructureND<T>.map(transform: A.(T) -> T): Nd4jArrayStructure<T> =
|
||||||
structureND(shape) { index -> elementAlgebra.transform(get(index)) }
|
structureND(shape) { index -> elementAlgebra.transform(get(index)) }
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun StructureND<T>.mapIndexed(transform: A.(index: IntArray, T) -> T): Nd4jArrayStructure<T> =
|
override fun StructureND<T>.mapIndexed(transform: A.(index: IntArray, T) -> T): Nd4jArrayStructure<T> =
|
||||||
structureND(shape) { index -> elementAlgebra.transform(index, get(index)) }
|
structureND(shape) { index -> elementAlgebra.transform(index, get(index)) }
|
||||||
|
|
||||||
|
@OptIn(PerformancePitfall::class)
|
||||||
override fun zip(left: StructureND<T>, right: StructureND<T>, transform: A.(T, T) -> T): Nd4jArrayStructure<T> {
|
override fun zip(left: StructureND<T>, right: StructureND<T>, transform: A.(T, T) -> T): Nd4jArrayStructure<T> {
|
||||||
require(left.shape.contentEquals(right.shape))
|
require(left.shape.contentEquals(right.shape))
|
||||||
return structureND(left.shape) { index -> elementAlgebra.transform(left[index], right[index]) }
|
return structureND(left.shape) { index -> elementAlgebra.transform(left[index], right[index]) }
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
// Disable native target to avoid CI crashes
|
}
|
||||||
// id("space.kscience.gradle.native")
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "Polynomials, rational functions, and utilities"
|
description = "Polynomials, rational functions, and utilities"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
id("space.kscience.gradle.jvm")
|
||||||
id("space.kscience.gradle.common")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "Symja integration module"
|
description = "Symja integration module"
|
||||||
|
@ -93,6 +93,7 @@ public fun DoubleField.produceWithTF(
|
|||||||
*
|
*
|
||||||
* The resulting tensors are available outside of scope
|
* The resulting tensors are available outside of scope
|
||||||
*/
|
*/
|
||||||
|
@OptIn(UnstableKMathAPI::class)
|
||||||
public fun DoubleField.produceMapWithTF(
|
public fun DoubleField.produceMapWithTF(
|
||||||
block: DoubleTensorFlowAlgebra.() -> Map<Symbol, StructureND<Double>>,
|
block: DoubleTensorFlowAlgebra.() -> Map<Symbol, StructureND<Double>>,
|
||||||
): Map<Symbol, StructureND<Double>> = Graph().use { graph ->
|
): Map<Symbol, StructureND<Double>> = Graph().use { graph ->
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
package space.kscience.kmath.tensorflow
|
package space.kscience.kmath.tensorflow
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
import space.kscience.kmath.misc.UnstableKMathAPI
|
||||||
import space.kscience.kmath.nd.get
|
import space.kscience.kmath.nd.get
|
||||||
import space.kscience.kmath.nd.structureND
|
import space.kscience.kmath.nd.structureND
|
||||||
import space.kscience.kmath.operations.DoubleField
|
import space.kscience.kmath.operations.DoubleField
|
||||||
@ -13,6 +14,7 @@ import space.kscience.kmath.tensors.core.DoubleTensorAlgebra
|
|||||||
import space.kscience.kmath.tensors.core.DoubleTensorAlgebra.Companion.sum
|
import space.kscience.kmath.tensors.core.DoubleTensorAlgebra.Companion.sum
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
|
@OptIn(UnstableKMathAPI::class)
|
||||||
class DoubleTensorFlowOps {
|
class DoubleTensorFlowOps {
|
||||||
@Test
|
@Test
|
||||||
fun basicOps() {
|
fun basicOps() {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
id("space.kscience.gradle.native")
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.common")
|
}
|
||||||
id("space.kscience.gradle.native")
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets.commonMain {
|
kotlin.sourceSets.commonMain {
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
id("space.kscience.gradle.jvm")
|
||||||
id("space.kscience.gradle.common")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "Binding for https://github.com/JetBrains-Research/viktor"
|
description = "Binding for https://github.com/JetBrains-Research/viktor"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":kmath-core"))
|
api(project(":kmath-core"))
|
||||||
api("org.jetbrains.bio:viktor:1.1.0")
|
api("org.jetbrains.bio:viktor:1.2.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
readme {
|
readme {
|
||||||
|
@ -13,7 +13,7 @@ import space.kscience.kmath.structures.MutableBuffer
|
|||||||
@JvmInline
|
@JvmInline
|
||||||
public value class ViktorBuffer(public val flatArray: F64FlatArray) : MutableBuffer<Double> {
|
public value class ViktorBuffer(public val flatArray: F64FlatArray) : MutableBuffer<Double> {
|
||||||
override val size: Int
|
override val size: Int
|
||||||
get() = flatArray.size
|
get() = flatArray.length
|
||||||
|
|
||||||
override inline fun get(index: Int): Double = flatArray[index]
|
override inline fun get(index: Int): Double = flatArray[index]
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("space.kscience.gradle.mpp")
|
id("space.kscience.gradle.mpp")
|
||||||
id("space.kscience.gradle.native")
|
}
|
||||||
|
|
||||||
|
kscience{
|
||||||
|
native()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin.sourceSets {
|
kotlin.sourceSets {
|
||||||
|
Loading…
Reference in New Issue
Block a user