Saves variables. Args: file_prefix: Path prefix of files created for the checkpoint. global_step: If provided the global step number is appended to file_prefix to create the checkpoint filename. The optional argument can be a Tensor, a Variable, or an integer. R
(self, file_prefix, global_step=None)
| 143 | self._saver = _saver.Saver(var_list=var_list) |
| 144 | |
| 145 | def save(self, file_prefix, global_step=None): |
| 146 | """Saves variables. |
| 147 | |
| 148 | Args: |
| 149 | file_prefix: Path prefix of files created for the checkpoint. |
| 150 | global_step: If provided the global step number is appended to file_prefix |
| 151 | to create the checkpoint filename. The optional argument can be a |
| 152 | Tensor, a Variable, or an integer. |
| 153 | |
| 154 | Returns: |
| 155 | A string: prefix of filenames created for the checkpoint. This may be |
| 156 | an extension of file_prefix that is suitable to pass as an argument |
| 157 | to a subsequent call to `restore()`. |
| 158 | """ |
| 159 | with ops.device("/device:CPU:0"): |
| 160 | return self._saver.save( |
| 161 | None, file_prefix, write_meta_graph=False, global_step=global_step) |
| 162 | |
| 163 | def restore(self, file_prefix): |
| 164 | """Restores previously saved variables. |