element_wise

Element-wise functions expected by the python array API. Internally, all functions apply an element-wise operation on:

-> a python int/float/complex and a LinearSpaceElement -> two LinearSpaceElement -> a single LinearSpaceElement

Args:

operation (str): a string identifier to lookup the desired function in the LinearSpaceElement’s namespace. x1 (int | float | complex | LinearSpaceElement : Left operand x2 (int | float | complex | LinearSpaceElement (Optional) : Right operand. Defaults to None. out (LinearSpaceElement, optional): Out LinearSpaceElement for inplace updates. Defaults to None.

Returns:

LinearSpaceElement: result of the element-wise operation on the array wrapped inside the element of an ODL space.

Notes:
  1. The output array is wrapped in a space of which type depends of the output array’s. This is a change of behaviour compared to ODL < 0.8.2

  2. Although one could use it to perform an operation on array-specific backend only, there is no clean way to infer a LinearSpace from the output. As such, one of the two operands must be a LinearSpaceElement