PTWM
ptwm

ptwm.classify

Tensor-role classifier chain.

ptwm.classify

Tensor-role classifier chain.

pymodule

ptwm.classify

python/ptwm/classify/__init__.py:1
module ptwm.classify

Tensor-role classifier chain.

pyclass

ptwm.classify.AuditEntry

python/ptwm/classify/_audit.py:14
class AuditEntry:
pymethod

ptwm.classify.AuditEntry.__init__

python/ptwm/classify/_audit.py:1
def __init__(self, name: str, role: TensorRole, source: str, pattern: str) -> None
pyattribute

ptwm.classify.AuditEntry.name

python/ptwm/classify/_audit.py:16
name: str
pyattribute

ptwm.classify.AuditEntry.pattern

python/ptwm/classify/_audit.py:19
pattern: str
pyattribute

ptwm.classify.AuditEntry.role

python/ptwm/classify/_audit.py:17
role: TensorRole
pyattribute

ptwm.classify.AuditEntry.source

python/ptwm/classify/_audit.py:18
source: str
pyclass

ptwm.classify.AuditLog

python/ptwm/classify/_audit.py:33
class AuditLog:

Ordered list of (name, classification) pairs, with optional discovery section.

pymethod

ptwm.classify.AuditLog.__init__

python/ptwm/classify/_audit.py:36
def __init__(self) -> None
pymethod

ptwm.classify.AuditLog.discovered_chains

python/ptwm/classify/_audit.py:67
def discovered_chains(self) -> tuple[DiscoveredChain, ...]
pymethod

ptwm.classify.AuditLog.entries

python/ptwm/classify/_audit.py:64
def entries(self) -> tuple[AuditEntry, ...]
pymethod

ptwm.classify.AuditLog.from_cbor

python/ptwm/classify/_audit.py:94
def from_cbor(cls, blob: bytes) -> AuditLog
pymethod

ptwm.classify.AuditLog.record

python/ptwm/classify/_audit.py:40
def record(self, name: str, c: TensorClassification) -> None
pymethod

ptwm.classify.AuditLog.record_discovered

python/ptwm/classify/_audit.py:45
def record_discovered(self, chain_bytes: bytes, dtype_code: int, role: TensorRole, n_candidates_tried: int, sample_tensor_name: str) -> None

Record a chain candidate explored during generative search.

pymethod

ptwm.classify.AuditLog.to_cbor

python/ptwm/classify/_audit.py:70
def to_cbor(self) -> bytes
pyclass

ptwm.classify.ClassifierChain

python/ptwm/classify/_chain.py:15
class ClassifierChain:

Sequence of classifiers; first non-``None`` decision wins.

pymethod

ptwm.classify.ClassifierChain.__init__

python/ptwm/classify/_chain.py:18
def __init__(self, classifiers: Sequence[TensorClassifier]) -> None
pymethod

ptwm.classify.ClassifierChain.classify

python/ptwm/classify/_chain.py:21
def classify(self, name: str, dtype: str, shape: tuple[int, ...], archive_keys: tuple[str, ...]) -> TensorClassification
pyclass

ptwm.classify.DiscoveredChain

python/ptwm/classify/_audit.py:22
class DiscoveredChain:

A chain candidate that was explored for a given dtype + role pair.

pymethod

ptwm.classify.DiscoveredChain.__init__

python/ptwm/classify/_audit.py:1
def __init__(self, chain: bytes, dtype_code: int, role: str, n_candidates_tried: int, sample_tensor_name: str) -> None
pyattribute

ptwm.classify.DiscoveredChain.chain

python/ptwm/classify/_audit.py:26
chain: bytes
pyattribute

ptwm.classify.DiscoveredChain.dtype_code

python/ptwm/classify/_audit.py:27
dtype_code: int
pyattribute

ptwm.classify.DiscoveredChain.n_candidates_tried

python/ptwm/classify/_audit.py:29
n_candidates_tried: int
pyattribute

ptwm.classify.DiscoveredChain.role

python/ptwm/classify/_audit.py:28
role: str
pyattribute

ptwm.classify.DiscoveredChain.sample_tensor_name

python/ptwm/classify/_audit.py:30
sample_tensor_name: str
pyclass

ptwm.classify.ExplicitFlagsClassifier

python/ptwm/classify/_flags.py:13
class ExplicitFlagsClassifier:

In-order pattern → role rules from CLI flags.

pymethod

ptwm.classify.ExplicitFlagsClassifier.__init__

python/ptwm/classify/_flags.py:18
def __init__(self, rules: list[tuple[str, TensorRole]]) -> None
pymethod

ptwm.classify.ExplicitFlagsClassifier.classify

python/ptwm/classify/_flags.py:40
def classify(self, name: str, dtype: str, shape: tuple[int, ...], archive_keys: tuple[str, ...]) -> TensorClassification | None
pymethod

ptwm.classify.ExplicitFlagsClassifier.from_flag_strings

python/ptwm/classify/_flags.py:21
def from_flag_strings(cls, flags: Sequence[str]) -> ExplicitFlagsClassifier
pyclass

ptwm.classify.HeuristicClassifier

python/ptwm/classify/_heuristic.py:36
class HeuristicClassifier:

Conservative dtype + suffix + sibling matcher.

Returns ``SCALE_BLOCK`` only when all three conditions hold; otherwise defers via ``None``.
pymethod

ptwm.classify.HeuristicClassifier.classify

python/ptwm/classify/_heuristic.py:45
def classify(self, name: str, dtype: str, shape: tuple[int, ...], archive_keys: tuple[str, ...]) -> TensorClassification | None
pyclass

ptwm.classify.HfQuantConfigClassifier

python/ptwm/classify/_hf_quant.py:28
class HfQuantConfigClassifier:

Classifier built from a ModelOpt ``hf_quant_config.json``.

pymethod

ptwm.classify.HfQuantConfigClassifier.__init__

python/ptwm/classify/_hf_quant.py:33
def __init__(self, quant_algo: str, exclude_modules: tuple[str, ...]) -> None
pymethod

ptwm.classify.HfQuantConfigClassifier.classify

python/ptwm/classify/_hf_quant.py:69
def classify(self, name: str, dtype: str, shape: tuple[int, ...], archive_keys: tuple[str, ...]) -> TensorClassification | None
pymethod

ptwm.classify.HfQuantConfigClassifier.from_path

python/ptwm/classify/_hf_quant.py:43
def from_path(cls, path: str | Path) -> HfQuantConfigClassifier
pyclass

ptwm.classify.PtwmConfigClassifier

python/ptwm/classify/_ptwm_config.py:14
class PtwmConfigClassifier:

Pattern → role rules from TOML. First match in file order wins.

pymethod

ptwm.classify.PtwmConfigClassifier.__init__

python/ptwm/classify/_ptwm_config.py:19
def __init__(self, rules: list[tuple[str, TensorRole]]) -> None
pymethod

ptwm.classify.PtwmConfigClassifier.classify

python/ptwm/classify/_ptwm_config.py:41
def classify(self, name: str, dtype: str, shape: tuple[int, ...], archive_keys: tuple[str, ...]) -> TensorClassification | None
pymethod

ptwm.classify.PtwmConfigClassifier.from_path

python/ptwm/classify/_ptwm_config.py:22
def from_path(cls, path: str | Path) -> PtwmConfigClassifier
pyclass

ptwm.classify.TensorClassification

python/ptwm/classify/_role.py:20
class TensorClassification:

Classifier output: role plus the source rule that produced it.

pymethod

ptwm.classify.TensorClassification.__init__

python/ptwm/classify/_role.py:1
def __init__(self, role: TensorRole, source: str, pattern: str) -> None
pyattribute

ptwm.classify.TensorClassification.pattern

python/ptwm/classify/_role.py:26
pattern: str
pyattribute

ptwm.classify.TensorClassification.role

python/ptwm/classify/_role.py:24
role: TensorRole
pyattribute

ptwm.classify.TensorClassification.source

python/ptwm/classify/_role.py:25
source: str
pyclass

ptwm.classify.TensorClassifier

python/ptwm/classify/_protocol.py:12
class TensorClassifier(Protocol):

Stateless per-tensor classifier.

Returns ``None`` to defer to the next chain step.
pymethod

ptwm.classify.TensorClassifier.classify

python/ptwm/classify/_protocol.py:18
def classify(self, name: str, dtype: str, shape: tuple[int, ...], archive_keys: tuple[str, ...]) -> TensorClassification | None
pyclass

ptwm.classify.TensorRole

python/ptwm/classify/_role.py:11
class TensorRole(StrEnum):

Compressor-dispatch role for a single safetensors entry.

pyconstant

ptwm.classify.TensorRole.PACKED_VALUES

python/ptwm/classify/_role.py:16
PACKED_VALUES = 'packed_values'
pyconstant

ptwm.classify.TensorRole.SCALE_BLOCK

python/ptwm/classify/_role.py:14
SCALE_BLOCK = 'scale_block'
pyconstant

ptwm.classify.TensorRole.SCALE_GLOBAL

python/ptwm/classify/_role.py:15
SCALE_GLOBAL = 'scale_global'
pyconstant

ptwm.classify.TensorRole.STANDARD

python/ptwm/classify/_role.py:17
STANDARD = 'standard'