fiery.diffeo.backends
Interchangeable backends for the sampling operations.
Every layer and function in this package delegates warping (pull),
splatting (push, count) and sampled gradients (grad) to a backend
module. Three are available:
torchusestorch.nn.functional.grid_sample. It is fast, but it does not implement all the boundary conditions used by the metrics and it approximates splatting with a small-deformation model.interpolusesfiery-interpol, which implements every operator and boundary condition consistently in TorchScript. This is the default backend.jitfieldsusesjitfields, which implements the same operators in C++/CUDA. It needscupyandcppyy, so it is an optional dependency.
Pick one per layer with the backend= argument, or for a whole block
with the backend context manager.
Attributes
default_backend
module-attribute
Backend used by every layer and function that is not given an
explicit backend= argument. Defaults to interpol.
Functions:
backend
Temporarily set the default backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bck
|
module
|
Backend to use inside the block. Must be one of the modules
under |
required |
Yields:
| Name | Type | Description |
|---|---|---|
bck |
module
|
The backend that was set. |
Examples: