Skip to content

Commit

Permalink
Upgrade to TF version 2.16.1 (#100)
Browse files Browse the repository at this point in the history
* Upgrade to TF version 2.16.1

* Handle different macOS and Linux version with test

* Upgrade Scala Native to 0.5.3
  • Loading branch information
ekrich authored Jun 6, 2024
1 parent a2d49c4 commit 3824c0b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Note: Refer to release notes for older versions of Scala and Scala Native

## Tensorflow library

The TensorFlow C library is required and the current version is `2.15.0`.
The TensorFlow C library is required and the current version is `2.16.1`
with `2.5.0` pre-built for Linux.

* Linux/Ubuntu can TensorFlow following the following directions:

Expand All @@ -65,7 +66,8 @@ $ sudo ldconfig /usr/local/lib
which will install into the `/usr/local/Cellar/libtensorflow/<version>` directory.

Note: macOS 12 or greater is recommended to install TensorFlow via
Homebrew and is used in CI. Tensorflow `2.15` is built for macos `13.1`.
Homebrew and is used in CI. Tensorflow `2.16.1` is built for macos `13.1` so you
will get a linking warning if using an older OS version.

```
$ brew install libtensorflow
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolvers ++= Resolver.sonatypeOssRepos("snapshots")

// Current releases
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.3")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ import org.ekrich.tensorflow.unsafe.tensorflowEnums._

class TensorflowTest {

val tfVersion = "2.15"
val tfMinVersion = "2.15"

// major, minor
case class Version(major: Int, minor: Int) extends Ordered[Version] {
import math.Ordered.orderingToOrdered
def compare(that: Version): Int =
(this.major, this.minor).compare(that.major, that.minor)
}

def version(ver: String): Version = {
val arr = ver.split("[.]")
Version(arr(0).toInt, arr(1).toInt)
}

type DeallocateTensor = CFuncPtr3[Ptr[Byte], CSize, Ptr[Byte], Unit]

Expand All @@ -25,11 +37,13 @@ class TensorflowTest {

@Test def TF_VersionTest(): Unit = {
Zone {
val reportVersion = fromCString(TF_Version())
println(s"Tensorflow version: ${reportVersion}")
val tfVersion = fromCString(TF_Version())
println(s"Tensorflow version: ${tfVersion}")
val swVersion = version(tfVersion)
val minVersion = version(tfMinVersion)
assertTrue(
s"Looking for version: $tfVersion",
reportVersion.startsWith(tfVersion)
s"Looking for version: $tfMinVersion",
minVersion <= swVersion
)
}
}
Expand Down

0 comments on commit 3824c0b

Please sign in to comment.