-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create edge_model_compression_test.py
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import unittest | ||
import torch | ||
from edge_ai import load_model, model_quantization, model_pruning, model_knowledge_distillation | ||
|
||
class TestEdgeModelCompression(unittest.TestCase): | ||
def test_model_quantization(self): | ||
model = load_model() | ||
model_quantization(model) | ||
self.assertTrue(True) | ||
|
||
def test_model_pruning(self): | ||
model = load_model() | ||
model_pruning(model) | ||
self.assertTrue(True) | ||
|
||
def test_model_knowledge_distillation(self): | ||
dataset = EdgeAIDataset(np.random.rand(100, 3, 224, 224), np.random.randint(0, 10, 100)) | ||
teacher = EdgeAIModel() | ||
student = EdgeAIModel() | ||
model_knowledge_distillation(student, teacher, dataset) | ||
self.assertTrue(True) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |