Example #1
0
 def test_facade(self):
     Deallocatable.ALLOCATION_TRACKING = True
     facade = ModelFacade(self.config, progress_bar=False)
     facade.writer = None
     facade.train()
     res = facade.test()
     self.validate_results(res)
     facade.deallocate()
     path = Path('target/iris/model')
     facade = ModelFacade.load_from_path(path, progress_bar=False)
     facade.writer = None
     res = facade.test()
     self.validate_results(res)
     facade.deallocate()
     #Deallocatable._print_undeallocated(True)
     self.assertEqual(0, Deallocatable._num_deallocations())
     Deallocatable.ALLOCATION_TRACKING = False
Example #2
0
def end_dealloc():
    print('deallocations:', Deallocatable._num_deallocations())
    Deallocatable._print_undeallocated(True)