Initial project scaffold
This commit is contained in:
11
reference/torch_vector_add.py
Normal file
11
reference/torch_vector_add.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
def torch_vector_add(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
|
||||
"""Reference vector add with explicit shape checks."""
|
||||
if x.shape != y.shape:
|
||||
raise ValueError(f"shape mismatch: {x.shape} vs {y.shape}")
|
||||
return x + y
|
||||
|
||||
Reference in New Issue
Block a user