Skip to content

Commit d1e2589

Browse files
tensorflower-gardenerqlzh727
authored andcommitted
Internal change
PiperOrigin-RevId: 382327442
1 parent 71d6d6e commit d1e2589

File tree

4 files changed

+64
-5
lines changed

4 files changed

+64
-5
lines changed

WORKSPACE

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,38 @@ workspace(name = "org_keras")
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

5+
# Needed by protobuf
6+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
7+
http_archive(
8+
name = "bazel_skylib",
9+
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.1/bazel-skylib-1.0.1.tar.gz",
10+
sha256 = "f1c8360c01fcf276778d3519394805dc2a71a64274a3a0908bc9edff7b5aebc8",
11+
)
12+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
13+
bazel_skylib_workspace()
14+
15+
# Needed by protobuf
16+
http_archive(
17+
name = "six_archive",
18+
build_file = "//third_party:six.BUILD",
19+
sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
20+
strip_prefix = "six-1.12.0",
21+
urls = [
22+
"http://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz",
23+
"https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz", # 2018-12-10
24+
],
25+
)
26+
27+
bind(
28+
name = "six",
29+
actual = "@six_archive//:six",
30+
)
31+
532
http_archive(
633
name = "com_google_protobuf",
7-
sha256 = "b10bf4e2d1a7586f54e64a5d9e7837e5188fc75ae69e36f215eb01def4f9721b",
8-
strip_prefix = "protobuf-3.15.3",
9-
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.15.3.tar.gz"],
34+
sha256 = "1fbf1c2962af287607232b2eddeaec9b4f4a7a6f5934e1a9276e9af76952f7e0",
35+
strip_prefix = "protobuf-3.9.2",
36+
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.9.2.tar.gz"],
1037
)
1138
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
1239
protobuf_deps()

keras/legacy_tf_layers/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,7 @@ def _should_add_regularizer(variable, existing_variable_set):
473473
# When the shim to get variable scope working in TF2 is used,
474474
# We need to explicitly make the shim track the regularization
475475
# losses as the collections will not be accessible.
476-
if isinstance(var_store,
477-
variable_scope_shim._EagerVariableStore): # pylint: disable=protected-access
476+
if hasattr(var_store, 'add_regularizer'):
478477
var_store.add_regularizer(variable, regularizer)
479478

480479
if init_graph is not None:

third_party/BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package(
2+
licenses = ["notice"], # Apache 2.0
3+
)
4+
5+
exports_files([
6+
"LICENSE",
7+
"six.BUILD",
8+
])
9+
10+
package(default_visibility = ["//visibility:public"])

third_party/six.BUILD

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
16+
package(default_visibility = ["//visibility:public"])
17+
18+
licenses(["notice"])
19+
20+
py_library(
21+
name = "six",
22+
srcs = ["six.py"],
23+
)

0 commit comments

Comments
 (0)