CustomNorm
- class odl.core.space.weightings.weighting.CustomNorm(norm, impl, device, shape=())[source]
Bases:
WeightingClass for handling a user-specified norm.
Note that this removes
inner.- __init__(norm, impl, device, shape=())[source]
Initialize a new instance.
Parameters
- normcallable
The norm implementation. It must accept a
LinearSpaceElementargument, return a float and satisfy the following conditions for all space elementsx, yand scalarss:||x|| >= 0||x|| = 0if and only ifx = 0||s * x|| = |s| * ||x||||x + y|| <= ||x|| + ||y||
- implstring
Specifier for the implementation backend
- device :
device identifier, compatible with the backend associated with
impl- shape :
what shape array need to have to be processed by this weighting. The
normcallable can assume that the shape has already been checked. If an empty shape is specified (the default),normshould be able to handle arrays of arbitrary shape.