variables.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:Tensormodels 作者: asheshjain399 项目源码 文件源码
def add_variable(var, restore=True):
  """Adds a variable to the MODEL_VARIABLES collection.

    Optionally it will add the variable to  the VARIABLES_TO_RESTORE collection.
  Args:
    var: a variable.
    restore: whether the variable should be added to the
      VARIABLES_TO_RESTORE collection.

  """
  collections = [MODEL_VARIABLES]
  if restore:
    collections.append(VARIABLES_TO_RESTORE)
  for collection in collections:
    if var not in tf.get_collection(collection):
      tf.add_to_collection(collection, var)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号