| 197 | |
| 198 | @modules(module_db) |
| 199 | def test_repr(self, device, dtype, module_info, training): |
| 200 | # Test module can be represented with repr and str without errors. |
| 201 | module_cls = module_info.module_cls |
| 202 | module_inputs = module_info.module_inputs_func(module_info, device=device, dtype=dtype, |
| 203 | requires_grad=False, training=training) |
| 204 | for module_input in module_inputs: |
| 205 | args, kwargs = module_input.constructor_input.args, module_input.constructor_input.kwargs |
| 206 | m = module_cls(*args, **kwargs) |
| 207 | m.to(device).to(dtype) |
| 208 | m.train(training) |
| 209 | |
| 210 | # Check that these methods do not raise errors |
| 211 | m.__repr__() |
| 212 | str(m) |
| 213 | |
| 214 | @modules(module_db) |
| 215 | def test_pickle(self, device, dtype, module_info, training): |