(self, src_module, var_type='all')
| 60 | return clone_ops |
| 61 | |
| 62 | def clone_from_module(self, src_module, var_type='all'): |
| 63 | assert var_type in ['all', 'trainable', 'nontrainable'] |
| 64 | assert type(self) == type(src_module), 'The types of the target module and the source module are inconsistent!' |
| 65 | assert self._is_built, 'The target module should be already built (called at least once)!' |
| 66 | assert src_module._is_built, 'The source module should be already built (called at least once)!' |
| 67 | |
| 68 | src_vars = {'all': src_module.variables, 'trainable': src_module.trainable_variables, 'nontrainable': src_module.nontrainable_variables}[var_type] |
| 69 | clone_ops = self.clone_from_vars(src_vars, var_type=var_type) |
| 70 | |
| 71 | return clone_ops |
| 72 | |
| 73 | @property |
| 74 | def scope(self): |
no test coverage detected