From dad4197fcf00186df0fe2842228750f484d72b40 Mon Sep 17 00:00:00 2001
From: "A. Unique TensorFlower" <gardener@tensorflow.org>
Date: Mon, 24 Jun 2019 07:21:59 -0700
Subject: [PATCH] Fix tf_workspace for projects use TensorFlow as an external
 repository.

PiperOrigin-RevId: 254752872
---
 WORKSPACE                | 8 ++++----
 tensorflow/workspace.bzl | 5 +++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/WORKSPACE b/WORKSPACE
index 22e400a286e..43312f350d6 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -12,11 +12,11 @@ http_archive(
     ],
 )
 
-# Load tf_workspace() before loading dependencies for other repository so that
-# dependencies like com_google_protobuf won't be overridden.
-load("//tensorflow:workspace.bzl", "tf_workspace")
+# Load tf_repositories() before loading dependencies for other repository so
+# that dependencies like com_google_protobuf won't be overridden.
+load("//tensorflow:workspace.bzl", "tf_repositories")
 # Please add all new TensorFlow dependencies in workspace.bzl.
-tf_workspace()
+tf_repositories()
 
 load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
 
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 9e107cdda35..99f5447105b 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -55,6 +55,11 @@ def clean_dep(dep):
 # path_prefix is no longer used.
 # tf_repo_name is thought to be under consideration.
 def tf_workspace(path_prefix = "", tf_repo_name = ""):
+    tf_repositories(path_prefix, tf_repo_name)
+    tf_bind()
+
+# Define all external repositories required by TensorFlow
+def tf_repositories(path_prefix = "", tf_repo_name = ""):
     """All external dependencies for TF builds."""
 
     # Note that we check the minimum bazel version in WORKSPACE.