Compute

Compute modules for benchmarking

source

compute_compute


def compute_compute(
    model:nn.Module, # model to analyze
    sample:torch.Tensor, # input tensor (with batch dimension)
)->ComputeMetrics:

Compute MACs for a single forward pass.


source

ComputeMetrics


def ComputeMetrics(
    macs_m:float | None
)->None:

MACs (Multiply-Accumulate operations) in millions.