| # Copyright 2024 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| workspace(name = "cros_tflite") |
| |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| # Update `bazel_external_uris` in ebuild as well when upgrading TensorFlow, and |
| # all the required dependencies need to be upload to our mirror first. |
| TENSORFLOW_VERSION = "2.15.0" |
| |
| http_archive( |
| name = "org_tensorflow", |
| sha256 = "f771db8d96ca13c72f73c85c9cfb6f5358e2de3dd62a97a9ae4b672fe4c6d094", |
| strip_prefix = "tensorflow-{}".format(TENSORFLOW_VERSION), |
| url = "https://github.com/tensorflow/tensorflow/archive/v{}.zip".format(TENSORFLOW_VERSION), |
| ) |
| |
| # Python is required before initializing TensorFlow. |
| http_archive( |
| name = "rules_python", |
| sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b", |
| strip_prefix = "rules_python-0.26.0", |
| url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz", |
| ) |
| |
| load("@rules_python//python:repositories.bzl", "py_repositories") |
| py_repositories() |
| |
| load( |
| "@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl", |
| "python_repository", |
| ) |
| python_repository(name = "python_version_repo") |
| |
| load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION") |
| load("@rules_python//python:repositories.bzl", "python_register_toolchains") |
| python_register_toolchains( |
| name = "python", |
| ignore_root_user_error = True, |
| python_version = HERMETIC_PYTHON_VERSION, |
| ) |
| |
| # Initialize TensorFlow and its external dependencies. |
| load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3") |
| tf_workspace3() |
| load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2") |
| tf_workspace2() |
| load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1") |
| tf_workspace1() |
| load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0") |
| tf_workspace0() |