File: leanpass/nn.py
If a user passes non‑positive integers (e.g., in_features=0 or negative values), the weight initialization scale = 1.0 / np.sqrt(in_features) will raise a ZeroDivisionError or produce nan values. Libraries usually validate layer dimensions and raise a clear ValueError.
Fix: add checks in Linear.__init__ to ensure both dimensions are positive integers and raise an informative exception otherwise.
Label: bug (edge‑case handling).
Filed automatically by ai-issue-scan.
File:
leanpass/nn.pyIf a user passes non‑positive integers (e.g.,
in_features=0or negative values), the weight initializationscale = 1.0 / np.sqrt(in_features)will raise aZeroDivisionErroror producenanvalues. Libraries usually validate layer dimensions and raise a clearValueError.Fix: add checks in
Linear.__init__to ensure both dimensions are positive integers and raise an informative exception otherwise.Label: bug (edge‑case handling).
Filed automatically by ai-issue-scan.