Dramabox / ltx2 /ltx_core /loader /module_ops.py
Manmay's picture
DramaBox Space — initial app + vendored ltx2
08c5e28 verified
from typing import Callable, NamedTuple
import torch
class ModuleOps(NamedTuple):
"""
Defines a named operation for matching and mutating PyTorch modules.
Used to selectively transform modules in a model (e.g., replacing layers with quantized versions).
"""
name: str
matcher: Callable[[torch.nn.Module], bool]
mutator: Callable[[torch.nn.Module], torch.nn.Module]