1 def update_snapshot_name(self, var_coll_name):
2 var_list = self._metagraph.collection_def[var_coll_name]
3 for i, value in enumerate(var_list.bytes_list.value):
4 var_def = variable_pb2.VariableDef()
5 var_def.ParseFromString(value)
6 # Somehow node Model/global_step/read doesn't have any fanout and seems to
7 # be only used for snapshot; this is different from all other variables.
8 if var_def.snapshot_name != "Model/global_step/read:0":
9 var_def.snapshot_name = with_autoparallel_prefix(
10 0, var_def.snapshot_name)
11 value = var_def.SerializeToString()
12 var_list.bytes_list.value[i] = value
沒有輸出?
https://stackoverflow.com/questions/10151080/the-immutable-object-in-python
https://vinta.ws/code/python-的參數傳遞是-call-by-assignment.html
http://blog.hitripod.com/python-function-passed-by-assignment/
https://stackoverflow.com/questions/986006/how-do-i-pass-a-variable-by-reference