Compute
Compute modules for benchmarking
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.
ComputeMetrics
def ComputeMetrics(
macs_m:float | None
)->None:
MACs (Multiply-Accumulate operations) in millions.