Opensource Core ML delegate

coremltools 3.3 is added to third party dependencies.

PiperOrigin-RevId: 304316799
Change-Id: Ib14351512c2e57d7da70aa14991cd1b8354fcc03
diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files
index fdb1b66..2ebfdbe 100644
--- a/tensorflow/opensource_only.files
+++ b/tensorflow/opensource_only.files
@@ -32,6 +32,7 @@
 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 142652f..6d05e49 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -1045,6 +1045,16 @@
             "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 0000000..2c50359
--- /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",
+)