mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127841 Approved by: https://github.com/oulgen
20 lines
593 B
Python
20 lines
593 B
Python
# mypy: allow-untyped-defs
|
|
__all__ = [
|
|
"get_static_sparse_quantized_mapping",
|
|
"get_dynamic_sparse_quantized_mapping",
|
|
]
|
|
|
|
def get_static_sparse_quantized_mapping():
|
|
import torch.ao.nn.sparse
|
|
_static_sparse_quantized_mapping = {
|
|
torch.nn.Linear: torch.ao.nn.sparse.quantized.Linear,
|
|
}
|
|
return _static_sparse_quantized_mapping
|
|
|
|
def get_dynamic_sparse_quantized_mapping():
|
|
import torch.ao.nn.sparse
|
|
_dynamic_sparse_quantized_mapping = {
|
|
torch.nn.Linear: torch.ao.nn.sparse.quantized.dynamic.Linear,
|
|
}
|
|
return _dynamic_sparse_quantized_mapping
|