From df99d1db91e036c5adb027440540a69126b726a6 Mon Sep 17 00:00:00 2001 From: Taehee Jeong Date: Wed, 1 Apr 2020 20:27:23 -0700 Subject: [PATCH] Opensource Core ML delegate coremltools 3.3 is added to third party dependencies. PiperOrigin-RevId: 304316799 Change-Id: Ib14351512c2e57d7da70aa14991cd1b8354fcc03 --- tensorflow/opensource_only.files | 1 + tensorflow/workspace.bzl | 10 ++++++++++ third_party/coremltools.BUILD | 15 +++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 third_party/coremltools.BUILD diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files index fdb1b66943b..2ebfdbee26c 100644 --- a/tensorflow/opensource_only.files +++ b/tensorflow/opensource_only.files @@ -32,6 +32,7 @@ tensorflow/third_party/clang_toolchain/download_clang.bzl tensorflow/third_party/codegen.BUILD tensorflow/third_party/com_google_absl.BUILD tensorflow/third_party/common.bzl +tensorflow/third_party/coremltools.BUILD tensorflow/third_party/cub.BUILD tensorflow/third_party/curl.BUILD tensorflow/third_party/cython.BUILD diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index 142652f3e23..6d05e490d4a 100755 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -1045,6 +1045,16 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""): "https://github.com/GrahamDumpleton/wrapt/archive/1.11.1.tar.gz", ], ) + tf_http_archive( + name = "coremltools", + sha256 = "0d594a714e8a5fd5bd740ad112ef59155c0482e25fdc8f8efa5758f90abdcf1e", + strip_prefix = "coremltools-3.3", + build_file = clean_dep("//third_party:coremltools.BUILD"), + urls = [ + "http://mirror.tensorflow.org/github.com/apple/coremltools/archive/3.3.zip", + "https://github.com/apple/coremltools/archive/3.3.zip", + ], + ) def tf_bind(): """Bind targets for some external repositories""" diff --git a/third_party/coremltools.BUILD b/third_party/coremltools.BUILD new file mode 100644 index 00000000000..2c50359de5a --- /dev/null +++ b/third_party/coremltools.BUILD @@ -0,0 +1,15 @@ +load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") + +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) # BSD + +exports_files(["LICENSE.txt"]) + +cc_proto_library( + name = "mlmodel_cc_proto", + srcs = glob(["mlmodel/format/*.proto"]), + include = "mlmodel/format", + default_runtime = "@com_google_protobuf//:protobuf_lite", + protoc = "@com_google_protobuf//:protoc", +)