diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ffa81d4b..917ef5b8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,20 +6,20 @@ jvmTarget = "11" openrndr = "0.0.0" kotlinxCoroutines = "1.6.4" kotlinLogging = "3.0.0" -kotlinxSerialization = "1.4.1" +kotlinxSerialization = "1.5.0-RC" dokka = "1.7.10" nebulaRelease = "17.1.0" -gradleNexusPublish = "1.1.0" +gradleNexusPublish = "1.2.0" spek = "2.0.19" boofcv = "0.41" kluent = "1.72" junitJupiter = "5.9.2" slf4j = "2.0.6" -libfreenect = "0.5.7-1.5.7" -librealsense = "2.50.0-1.5.7" +libfreenect = "0.5.7-1.5.8" +librealsense = "2.50.0-1.5.8" gson = "2.10.1" -antlr = "4.11.1" -tensorflow = "0.4.1" +antlr = "4.12.0" +tensorflow = "0.5.0" jarchivelib = "1.2.0" logbackClassic = "1.2.11" minim = "2.2.2" diff --git a/orx-jvm/orx-tensorflow/src/main/kotlin/Tensor.kt b/orx-jvm/orx-tensorflow/src/main/kotlin/Tensor.kt index eebce184..6dfb0200 100644 --- a/orx-jvm/orx-tensorflow/src/main/kotlin/Tensor.kt +++ b/orx-jvm/orx-tensorflow/src/main/kotlin/Tensor.kt @@ -42,8 +42,8 @@ fun TFloat32.copyTo(colorBuffer: ColorBuffer) { val components = when { s.numDimensions() == 2 -> 1 - s.numDimensions() == 3 -> s.size(2).toInt() - s.numDimensions() == 4 -> s.size(3).toInt() + s.numDimensions() == 3 -> s.get(2).toInt() + s.numDimensions() == 4 -> s.get(3).toInt() else -> error("can't copy to colorbuffer from ${s.numDimensions()}D tensor") } @@ -103,7 +103,7 @@ fun TFloat32.toFloatArray2D(): FloatArray2D { require(shape.numDimensions() == 2) { "tensor has ${shape.numDimensions()} dimensions, need 2" } - val targetArray = floatArray2D(shape.size(0).toInt(), shape.size(1).toInt()) + val targetArray = floatArray2D(shape.get(0).toInt(), shape.get(1).toInt()) StdArrays.copyFrom(this, targetArray) return targetArray } @@ -113,7 +113,7 @@ fun TFloat32.toFloatArray3D(): FloatArray3D { require(shape.numDimensions() == 3) { "tensor has ${shape.numDimensions()} dimensions, need 3" } - val targetArray = floatArray3D(shape.size(0).toInt(), shape.size(1).toInt(), shape.size(2).toInt()) + val targetArray = floatArray3D(shape.get(0).toInt(), shape.get(1).toInt(), shape.get(2).toInt()) StdArrays.copyFrom(this, targetArray) return targetArray } @@ -123,7 +123,7 @@ fun TFloat32.toFloatArray4D(): FloatArray4D { require(shape.numDimensions() == 4) { "tensor has ${shape.numDimensions()} dimensions, need 4" } - val targetArray = floatArray4D(shape.size(0).toInt(), shape.size(1).toInt(), shape.size(2).toInt(), shape.size(3).toInt()) + val targetArray = floatArray4D(shape.get(0).toInt(), shape.get(1).toInt(), shape.get(2).toInt(), shape.get(3).toInt()) StdArrays.copyFrom(this, targetArray) return targetArray } @@ -139,9 +139,9 @@ fun TFloat32.toColorBuffer(target: ColorBuffer? = null): ColorBuffer { val s = shape() require(s.numDimensions() == 2 || s.numDimensions() == 3) - val width = (if (s.numDimensions() == 3) s.size(1) else s.size(0)).toInt() - val height = (if (s.numDimensions() == 3) s.size(2) else s.size(1)).toInt() - val components = if (s.numDimensions() == 3) s.size(0).toInt() else 1 + val width = (if (s.numDimensions() == 3) s.get(1) else s.get(0)).toInt() + val height = (if (s.numDimensions() == 3) s.get(2) else s.get(1)).toInt() + val components = if (s.numDimensions() == 3) s.get(0).toInt() else 1 val format = when (components) { 4 -> ColorFormat.RGBa @@ -168,9 +168,9 @@ fun TUint8.toColorBuffer(target: ColorBuffer? = null): ColorBuffer { val s = shape() require(s.numDimensions() == 2 || s.numDimensions() == 3) - val width = (if (s.numDimensions() == 3) s.size(1) else s.size(0)).toInt() - val height = (if (s.numDimensions() == 3) s.size(2) else s.size(1)).toInt() - val components = if (s.numDimensions() == 3) s.size(0).toInt() else 1 + val width = (if (s.numDimensions() == 3) s.get(1) else s.get(0)).toInt() + val height = (if (s.numDimensions() == 3) s.get(2) else s.get(1)).toInt() + val components = if (s.numDimensions() == 3) s.get(0).toInt() else 1 val format = when (components) { 4 -> ColorFormat.RGBa