Skip to content

test: add pytest suite (38 tests covering correctness, dtype, errors) - #4

Merged
asjad2401 merged 1 commit into
masterfrom
feature/pytest
May 21, 2026
Merged

test: add pytest suite (38 tests covering correctness, dtype, errors)#4
asjad2401 merged 1 commit into
masterfrom
feature/pytest

Conversation

@asjad2401

Copy link
Copy Markdown
Owner

What this does

Adds a proper pytest suite replacing the previous ad-hoc test scripts.

Tests added (38 total)

  • Dtype preservation — f32 in → f32 out, f64 in → f64 out for all functions
  • Relu — correctness vs NumPy, 1D/2D/3D, shape, negative→zero
  • Sigmoid — correctness vs NumPy, output range (0,1), boundary values (0→0.5, ±∞→0/1)
  • Softmax — correctness vs NumPy, sums-to-one, axis=0/-1/middle, numerical stability
  • Error handling — TypeError for int32/list inputs, ValueError for out-of-bounds axis

Running

maturin develop --release
pytest

@asjad2401
asjad2401 merged commit 1589afe into master May 21, 2026
17 checks passed
@asjad2401
asjad2401 deleted the feature/pytest branch May 21, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant