Skip to content

Commit

Permalink
Fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-savelyevv committed Dec 16, 2024
1 parent fddbbd3 commit cf228d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nncf/experimental/torch/sparsify_activations/torch_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
from nncf.common.graph.operator_metatypes import CONST_NOOP_METATYPES
from nncf.common.graph.operator_metatypes import OperatorMetatype
from nncf.common.graph.transformations.commands import TargetType
from nncf.experimental.common.tensor_statistics.collectors import AbsQuantileReducer
from nncf.experimental.torch.sparsify_activations.sparsify_activations_impl import SparsifyActivationsAlgoBackend
from nncf.torch.graph import operator_metatypes as om
from nncf.torch.graph.transformations.commands import PTSharedFnInsertionCommand
from nncf.torch.graph.transformations.commands import PTTargetPoint
from nncf.torch.graph.transformations.layout import PTTransformationLayout
from nncf.torch.model_transformer import PTModelTransformer
from nncf.torch.nncf_network import NNCFNetwork
from nncf.torch.tensor_statistics.collectors import PTAbsQuantileReducer

ACTIVATIONS_SPARSIFIER_PREFIX = "activations_sparsifier"

Expand Down Expand Up @@ -61,8 +61,8 @@ class PTSparsifyActivationsAlgoBackend(SparsifyActivationsAlgoBackend):
def supported_metatypes(self) -> List[Type[OperatorMetatype]]:
return [om.PTLinearMetatype]

def abs_quantile_reducer(self, quantile: Optional[Union[float, List[float]]] = None) -> PTAbsQuantileReducer:
return PTAbsQuantileReducer(quantile=quantile)
def abs_quantile_reducer(self, quantile: Optional[Union[float, List[float]]] = None) -> AbsQuantileReducer:
return AbsQuantileReducer(quantile=quantile)

def target_point(self, target_type: TargetType, target_node_name: str, port_id: int) -> PTTargetPoint:
return PTTargetPoint(TargetType.PRE_LAYER_OPERATION, target_node_name, input_port_id=port_id)
Expand Down

0 comments on commit cf228d9

Please sign in to comment.