Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
6f441f78
Commit
6f441f78
authored
Feb 16, 2022
by
Yeqing Li
Committed by
A. Unique TensorFlower
Feb 16, 2022
Browse files
Internal change
PiperOrigin-RevId: 429075761
parent
b50cea6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
official/core/registry.py
official/core/registry.py
+11
-2
No files found.
official/core/registry.py
View file @
6f441f78
...
...
@@ -13,6 +13,7 @@
# limitations under the License.
"""Registry utility."""
from
absl
import
logging
def
register
(
registered_collection
,
reg_key
):
...
...
@@ -54,6 +55,14 @@ def register(registered_collection, reg_key):
leaf_reg_key
=
reg_key
if
leaf_reg_key
in
collection
:
if
"beta"
in
fn_or_cls
.
__module__
:
# TODO(yeqing): Clean this temporary branch for beta.
logging
.
warn
(
"Duplicate registeration of beta module "
"name %r new %r old %r"
,
reg_key
,
collection
[
leaf_reg_key
],
fn_or_cls
.
__module__
)
return
else
:
raise
KeyError
(
"Function or class {} registered multiple times."
.
format
(
leaf_reg_key
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment