π Geometric Computer Vision Library for Spatial AI
fit_line raises a ShapeError when weights does not have the shape (B, N) of the points, instead of accepting a (B, 1) tensor. Such weights broadcast in the weighted sums but not in the normaliser, so the centroid came out wrong (the sum of the points for D >= 3, the first point plus the sum of the offsets from it for D = 2), and they skipped the zero-weight-sum and negative-weight checks: a zero weight gave a NaN line in 2-D and a negative weight was accepted. Weights with another second dimension raised a RuntimeError from torch, and a mismatched batch size a bare BaseError; both now raise the same ShapeError. The sizes are compared as numbers, so the check also holds for a symbolic N under a dynamic torch.export.