Initial project scaffold

This commit is contained in:
2026-04-10 13:22:19 +00:00
commit 7fa69b1354
94 changed files with 3964 additions and 0 deletions

13
reference/torch_matmul.py Normal file
View File

@@ -0,0 +1,13 @@
from __future__ import annotations
import torch
def torch_matmul(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
"""Reference matrix multiplication with simple shape validation."""
if a.ndim != 2 or b.ndim != 2:
raise ValueError("torch_matmul expects two 2D tensors")
if a.shape[1] != b.shape[0]:
raise ValueError(f"incompatible shapes: {a.shape} and {b.shape}")
return a @ b