Commit 6f441f78 authored by Yeqing Li's avatar Yeqing Li Committed by A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 429075761
parent b50cea6e
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment