def build(self):
"""Build the widget.
The main purpose of this function is to create the trainable variables (parameters) for the widget.
:return: None.
"""
if self._built:
return self
else:
if self._name is None:
#
# Build WITHOUT scope.
self._build()
self._built = True
return self
else:
#
# Build WITH scope.
self._scope = tf.get_variable_scope().name
with tf.variable_scope(self._name):
self._build()
self._built = True
return self
评论列表
文章目录