ArrayBackendChange

class odl.ArrayBackendChange(domain_impl: str, range_impl: str, subspace_index: int | list[int] = [])

Bases: AdapterOperator

A pseudo-operator that transfers arrays from one backend to another. Both backends must support the same device (this can mean you first need to use DeviceChange to transfer to 'cpu', which should be supported by all backends).

Further reading: Switching between array backends

__init__(domain_impl: str, range_impl: str, subspace_index: int | list[int] = [])[source]

Create an operator tying two equivalent spaces with different storage together.

Parameters

domain_impl, range_implstr

Backend specifiers such as 'numpy' or 'pytorch'. Which ones are supported depends on the installed packages.