(self)
| 53 | self.assertEqual(len(MODELS.modules), 4) |
| 54 | |
| 55 | def test_list(self): |
| 56 | MODELS = Registry('models') |
| 57 | |
| 58 | @MODELS.register_module(Tasks.image_classification, 'SwinT') |
| 59 | class SwinTForCls(object): |
| 60 | pass |
| 61 | |
| 62 | @MODELS.register_module(Tasks.sentiment_analysis, 'Bert') |
| 63 | class BertForSentimentAnalysis(object): |
| 64 | pass |
| 65 | |
| 66 | MODELS.list() |
| 67 | print(MODELS) |
| 68 | |
| 69 | def test_build(self): |
| 70 | MODELS = Registry('models') |