Skip to content
v2.0
----

Enhancements
~~~~~~~~~~~~

* The user can now select between two different computation backends: `PyTorch` and `Numpy`. As the names suggest,
  with `PyTorch` all involved numbers/tensors are reprenseted as `torch.Tensor` objects which also allow for gradient
  tracking; with `Numpy` all involved numbers/tensors are represented as `np.ndarray` objects. This allows working
  with other Numpy-compatible libraries and generally opens the door for incorporating new backends such as Jax.
  The backend can be selected via the `DIPAS_BACKEND` environment variable (`'numpy'` or `'pytorch'`); if unset,
  the backend will default to `PyTorch` as before. Alternatively, the backend can be manually switched via
  `import dipas.backends; dipas.backends.backend = dipas.backends.Numpy()`. Note that in this case all previously
  loaded lattices/elements will retain the old backend's tensor types, so reloading is required.

Changes
~~~~~~~

* The `dipas.elements` module does not expose `Tensor` and `Parameter` attributes anymore; these are now accessible
  via `dipas.backends.backend.(TensorType|ParameterType)`.