summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-tf20
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-05 23:14:56 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-18 15:21:29 +0200
commitcc9310efad6177909ff2f7415384d7c393383106 (patch)
tree5e94f0443cdf1c63ec77248aaf520974e5bfd7d0 /opendc-experiments/opendc-experiments-tf20
parentef3868ec729f7ce3f5976d4f9a0c8b95098d9857 (diff)
chore: Address deprecations due to Kotlin 1.5
This change addresses the deprecations that were caused by the migration to Kotlin 1.5.
Diffstat (limited to 'opendc-experiments/opendc-experiments-tf20')
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/Sequential.kt4
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/network/NetworkController.kt2
2 files changed, 3 insertions, 3 deletions
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/Sequential.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/Sequential.kt
index 411ddb59..83995fa1 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/Sequential.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/Sequential.kt
@@ -49,10 +49,10 @@ public class Sequential(vararg layers: Layer) : TrainableModel(*layers) {
}
override fun forward(): Double {
- return layers.sumByDouble { it.forward() }
+ return layers.sumOf { it.forward() }
}
override fun backward(): Double {
- return layers.sumByDouble { it.backward() }
+ return layers.sumOf { it.backward() }
}
}
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/network/NetworkController.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/network/NetworkController.kt
index 75b11423..9771cc20 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/network/NetworkController.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/network/NetworkController.kt
@@ -82,7 +82,7 @@ public class NetworkController(context: CoroutineContext, clock: Clock) : AutoCl
val target = channels[to] ?: return // Drop if destination not found
- scheduler.startSingleTimer(message, delayTime) { target.offer(message) }
+ scheduler.startSingleTimer(message, delayTime) { target.trySend(message) }
}
/**