Skip to content

Update math/resize - #406

Merged
giovannivolpe merged 9 commits into
developfrom
mg/math/resize
Sep 8, 2025
Merged

giovannivolpe merged 9 commits into
developfrom
mg/math/resize

Conversation

@mirjagranfors

Copy link
Copy Markdown
Collaborator

Updated docs of math/resize.

Made it compatible with torch, with a focus on getting the same results regardless if the input is a numpy array or a torch tensor.

Updated the unittesting, and included tests for torch

@mirjagranfors
mirjagranfors requested review from JChonpca and Pwhsky July 30, 2025 12:17
@mirjagranfors mirjagranfors reopened this Aug 7, 2025
@mirjagranfors
mirjagranfors marked this pull request as draft August 7, 2025 15:33
@mirjagranfors
mirjagranfors marked this pull request as ready for review August 11, 2025 12:47
Comment thread deeptrack/tests/test_math.py Outdated
self.assertEqual(resized.shape, (4, 8))

### Test with PyTorch tensor (if available)
if TORCH_AVAILABLE:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests look good, I think we should separate the torch and numpy cases by putting them in either the TestMath_Numpy or TestMath_Torch classes, since they provide the BACKEND flag in the first line which makes it easily readable, like I did in PR #407

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. But maybe it is easiest to do the entire test_math.py like that in a separate PR?

@giovannivolpe
giovannivolpe merged commit a1ffaf9 into develop Sep 8, 2025
25 checks passed
@giovannivolpe
giovannivolpe deleted the mg/math/resize branch September 8, 2025 09:06
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.

3 participants