Skip to content

Commit

Permalink
enforce abstract methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Sayers committed Sep 12, 2024
1 parent 5bfb497 commit c962bbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/llmcompressor/modifiers/utils/compression_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abc import ABC
from abc import ABC, abstractmethod
from typing import Optional, Set

import torch
Expand Down Expand Up @@ -72,12 +72,14 @@ def free(self):
"""
delattr(self, "nsamples")

@abstractmethod
def add_batch(self, *args, **kwargs):
"""
Add a batch of layer input and output data to the layer statistics calculation
"""
raise NotImplementedError("Child class must implement `add_batch`")

@abstractmethod
def compress(self, *args, **kwargs):
"""
Run pruning on the layer up to the target sparsity
Expand Down

0 comments on commit c962bbf

Please sign in to comment.