Skip to content
  • Gordian Edenhofer's avatar
    operator.py: Raise not-implemented in matmul call · 40b6376b
    Gordian Edenhofer authored and Martin Reinecke's avatar Martin Reinecke committed
    Contrary to other overloaded operators, the `__matmul__` call apparently
    needs to raise an exception instead of returning `NotImplemented`. This
    behaviour can be seen for example in:
    
    ```python
    psp = ift.RGSpace(512)
    m = ift.MaskOperator(ift.Field.from_raw(psp, np.random.randint(0, 2, 512)))
    m(ift.from_random("normal", m.domain).val) is NotImplemented
    ```
    
    which should be invalid and raise an exception but previously returned
    `True` instead.
    40b6376b