提交 977d55cc 编写于 作者: F François Chollet

Fix thread safety issue

上级 a0335a32
......@@ -1212,6 +1212,8 @@ class Layer(object):
# Keep track of metric instance created in subclassed model/layer.
# We do this so that we can maintain the correct order of metrics by adding
# the instance to the `metrics` list as soon as it is created.
if not hasattr(_DISABLE_TRACKING, 'value'):
_DISABLE_TRACKING.value = False
if not _DISABLE_TRACKING.value:
from .. import metrics as metrics_module
if isinstance(value, metrics_module.Metric):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册