Closed
Description
While working on the Bregman distance functional in #1267 I encountered the following bug:
import odl
import numpy as np
space = odl.uniform_discr(0, 1, 10)
point = space.one()
l2_sq = odl.solvers.L2NormSquared(space)
breg = odl.solvers.BregmanDistance(l2_sq, point)
sigma_array = np.array(0.4)
sigma = float(sigma_array)
tmp = breg.proximal
tmp(sigma)
tmp(sigma_array)
which gives a very short call stack and a cryptical error message.
Traceback (most recent call last):
File "<ipython-input-4-2907eb4487d1>", line 1, in <module>
runfile('[...]/tmp.py', wdir='[...]')
File "[...]/miniconda3/envs/odl-py36/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "[...]/miniconda3/envs/odl-py36/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "[...]/tmp.py", line 15, in <module>
tmp(sigma_array)
TypeError: unhashable type: 'numpy.ndarray'
Does anyone know what the problem is?
Metadata
Metadata
Assignees
Labels
No labels