Skip to content

Commit

Permalink
Create edge_model_compression_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jun 1, 2024
1 parent a9d6540 commit b4c48ee
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions edge_ai/edge_model_compression_test.py
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()

0 comments on commit b4c48ee

Please sign in to comment.