Skip to content

Commit f0240d0

Browse files
committed
Fix formatting
Signed-off-by: Ryan Nett <[email protected]>
1 parent bfa702b commit f0240d0

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

tensorflow-kotlin-parent/tensorflow-core-kotlin-jupyter/src/main/kotlin/org/tensorflow/jupyter/TensorflowKotlinCoreIntegration.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public class TensorflowKotlinCoreIntegration : JupyterIntegration() {
3838
render<Operand<*>> { it.asOutput().toString() }
3939
render<Op> { it.op().toString() }
4040

41-
onLoaded {
42-
EagerSession.getDefault()
43-
declare("tf" to EagerSession.getDefault().tf)
44-
}
41+
onLoaded { declare("tf" to EagerSession.getDefault().tf) }
4542
}
4643
}

tensorflow-kotlin-parent/tensorflow-kotlin-jupyter/src/main/kotlin/org/tensorflow/jupyter/TensorflowKotlinIntegration.kt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ limitations under the License.
1717
*/
1818
package org.tensorflow.jupyter
1919

20-
import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterIntegration
2120
import java.util.*
21+
import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterIntegration
2222

2323
private const val tensorflowPropertiesFile = "org/tensorflow/jupyter/tensorflow.properties"
2424

@@ -30,23 +30,25 @@ public class TensorflowKotlinIntegration : JupyterIntegration() {
3030
os.contains("mac") -> "macosx-x86_64"
3131
os.startsWith("windows") -> "windows-x86_64"
3232
else -> "linux-x86_64"
33-
}// + "-gpu"
33+
} + "-gpu"
3434

3535
val version =
36-
this@TensorflowKotlinIntegration.javaClass.classLoader.getResourceAsStream(tensorflowPropertiesFile).let {
37-
it
38-
?: error(
39-
"No $tensorflowPropertiesFile resource found, can't determine the library version")
40-
Properties().apply { load(it) }.getProperty("version")
41-
?: error(
42-
"No version property found in the $tensorflowPropertiesFile resource, did you overwrite it?")
43-
}
44-
45-
if(version.lowercase().endsWith("snapshot")){
36+
this@TensorflowKotlinIntegration.javaClass.classLoader.getResourceAsStream(
37+
tensorflowPropertiesFile)
38+
.let {
39+
it
40+
?: error(
41+
"No $tensorflowPropertiesFile resource found, can't determine the library version")
42+
Properties().apply { load(it) }.getProperty("version")
43+
?: error(
44+
"No version property found in the $tensorflowPropertiesFile resource, did you overwrite it?")
45+
}
46+
47+
if (version.lowercase().endsWith("snapshot")) {
4648
repositories("https://oss.sonatype.org/content/repositories/snapshots/")
4749
}
4850

49-
//TODO use ext instead of platform https://github.com/Kotlin/kotlin-jupyter/issues/285
51+
// TODO use ext instead of platform https://github.com/Kotlin/kotlin-jupyter/issues/285
5052
dependencies("org.tensorflow:tensorflow-core-platform-gpu:$version")
5153
dependencies("org.tensorflow:tensorflow-core-kotlin-jupyter:$version")
5254
}

0 commit comments

Comments
 (0)