Skip to content

Bm/torch_array_func#338

Merged
giovannivolpe merged 1 commit into
torch-backendfrom
bm/torch_array_func
May 24, 2025
Merged

Bm/torch_array_func#338
giovannivolpe merged 1 commit into
torch-backendfrom
bm/torch_array_func

Conversation

@BenjaminMidtvedt
Copy link
Copy Markdown
Collaborator

Fixes issues with torch<2.6.0 by implementing array dispatching for torch arrays on the Image class

@giovannivolpe giovannivolpe merged commit f496085 into torch-backend May 24, 2025
@giovannivolpe giovannivolpe deleted the bm/torch_array_func branch May 24, 2025 15:30
giovannivolpe added a commit that referenced this pull request May 28, 2025
…ce in features

* Torch backend (#326)

* support variable computation backend

* standardize random array creation

* add some examples

* add BackendContext to manage backend settings in Config class

* export xp from backend

* add torch() and numpy() methods

* refactor Feature class to use backend context for execution

* store backend on initialization in Feature class

* u

* Update requirements.txt

* Remove CuPy from all code

* remove cupy top level

* remove deprecated enable/disable gpu

* Refactor Config class to remove cupy backend support

* remove functionality to handle cupy arrays

* Remove cupy array handling from elementwise tests

* Refactor Image class to remove CuPy support and clean up related methods.

* Remove unused CuPy import from optics.py

* Remove CuPy array handling from harmonics function in mie.py

* Some code cleanup and comments to make it understandable (#337)

Co-authored-by: Giovanni Volpe <46021832+giovannivolpe@users.noreply.github.com>

* Bm/import-torch-lazy (#335)

* Only import torch on use

* formatting

* Remove unused import of torch in _config.py

---------

Co-authored-by: Giovanni Volpe <46021832+giovannivolpe@users.noreply.github.com>

* Update 01. Using xp.ipynb

* Update _config.py

* Update 02. Gradients.ipynb

* Add torch array function dispatching (#338)

* Update 01. Using xp.ipynb

* small edits

* Update _config.py

* Update _config.py

* Update _config.py

* Update _config.py

* Update DTDV411_style.ipynb

* Update DTDV411_style.ipynb

* Update DTDV401_overview.ipynb

* Update DTDV401_overview.ipynb

* Bm/implement-device-dtype (#340)

* get dtype from xp module

* implement dtypes and device on Feature

* import xp module

* Refactor backend initialization in _Proxy class to use set_backend method and update backend_info retrieval

* Update import statement in features.py to include Literal type

* Bm/implement-math (#341)

* update types to allow torch arrays

* implement xp math v1

* get dtype from xp module

* implement dtypes and device on Feature

* import xp module

* implement math with xp 2

* Add VSCode settings for Python unittest configuration

* Refactor backend initialization in _Proxy class to use set_backend method and update backend_info retrieval

* Update import statement in features.py to include Literal type

* Update type alias for ArrayLike to use string reference for Image

* Update VSCode settings to simplify unittestArgs configuration

* remove lazy imports pointing to nothing

* Refactor Average feature calculation to stack images before computing mean

* update imports to use non-relative paths

* Add BackendTestBase

* Remove unused backend mixin classes from BackendTestBase

* Refactor math tests to use backend-specific implementations and extend test coverage for numpy and torch backends

* Update test_math.py

* Update __init__.py

* Delete settings.json

* Update DTDV401_overview.ipynb

* Update test_math.py

* u

* Update _config.py

* Update _config.py

* Update _config.py

* Update _config.py

* Create test__config.py

* Update test__config.py

* Update test__config.py

* Update test__config.py

* Update _config.py

* Update test__config.py

* Update test__config.py

* Update DTDV411_style.ipynb

* Update _config.py

* Update _config.py

* Update test__config.py

* Update test__config.py

* Update _config.py

* Update test__config.py

* Update test__config.py

* Update _config.py

* u

* Update README.md

* Update DTDV421_backends.ipynb

* Update DTAT399F_backend._config.ipynb

* Update DTAT399F_backend._config.ipynb

* Update __init__.py

* Update DTAT399F_backend._config.ipynb

* Update types.py

* Delete 02. Gradients.ipynb

* Create DTGS161_torch_fitting.ipynb

* Update README.md

* u

* Update README.md

* Update README.md

* Update features.py

* Update DTGS161_torch_fitting.ipynb

---------

Co-authored-by: BenjaminMidtvedt <41636530+BenjaminMidtvedt@users.noreply.github.com>
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.

2 participants