Esempio n. 1
0
 def test_torch_pruner(self):
     model = TorchMnist()
     configure_list = [{'sparsity': 0.8, 'op_types': ['default']}]
     torch_compressor.LevelPruner(configure_list).compress(model)
Esempio n. 2
0
 def test_torch_level_pruner(self):
     model = TorchModel()
     optimizer = torch.optim.SGD(model.parameters(), lr=0.01, momentum=0.5)
     configure_list = [{'sparsity': 0.8, 'op_types': ['default']}]
     torch_compressor.LevelPruner(model, configure_list,
                                  optimizer).compress()