def _get_base_variable_list(self):
"""
This methods checks that all the elements of var_list are legitimate (tf.Variables or MergedVariables)
and returns the underlying tf.Variables.
:return:
"""
res = []
for v in self._var_list:
if isinstance(v, MergedVariable):
res.extend(v._get_base_variable_list())
elif isinstance(v, tf.Variable):
res.append(v)
else:
raise ValueError('something wrong here')
return res
评论列表
文章目录