Adapt a model to pruned structure from file specification. Args: parent_module: Original model to adapt. model_variant: Name of pruned model variant file. Returns: Adapted model with pruned layer dimensions.
(parent_module, model_variant)
| 163 | |
| 164 | |
| 165 | def adapt_model_from_file(parent_module, model_variant): |
| 166 | """Adapt a model to pruned structure from file specification. |
| 167 | |
| 168 | Args: |
| 169 | parent_module: Original model to adapt. |
| 170 | model_variant: Name of pruned model variant file. |
| 171 | |
| 172 | Returns: |
| 173 | Adapted model with pruned layer dimensions. |
| 174 | """ |
| 175 | adapt_data = pkgutil.get_data(__name__, os.path.join('_pruned', model_variant + '.txt')) |
| 176 | return adapt_model_from_string(parent_module, adapt_data.decode('utf-8').strip()) |
no test coverage detected