Files
Rocky 3b0fd02b0f test(tinytorch): add PyTorch-compat coverage for ndim, numel, view, contiguous, masked_fill
Closes #1298 (test coverage for the API additions landed in #1391 plus
the deferred view/masked_fill that arrived in the same merge window).

Ten focused tests in TestTensorPyTorchCompat verify the methods students
are most likely to call when porting PyTorch training loops to TinyTorch:

- ndim matches len(shape) for rank 0-3 tensors
- numel() equals .size
- view() is a reshape alias, including -1 inference
- contiguous() returns correct data and guarantees C-order layout
- masked_fill basic replacement and the -inf attention-mask pattern
- masked_fill does not mutate the original tensor
- Tensor([t1, t2]) stacking constructor

Each test targets one specific behavioral contract so failures pinpoint
exactly which method regressed.
2026-04-18 04:48:22 +05:30
..