from cil.framework import VectorGeometry, ImageGeometry
vg = VectorGeometry(505)
ig = ImageGeometry(505,505)
x1 = ig.allocate("random")
x2 = vg.allocate("random")
res1 = x1.array.dot(x2.array)
print(res1.shape)
res2 = x1.dot(x2)
(505,)
ValueError Traceback (most recent call last)
Cell In[3], line 11
8 res1 = x1.array.dot(x2.array)
9 print(res1.shape)
---> 11 res2 = x1.dot(x2)
File /opt/conda/lib/python3.11/site-packages/cil/framework/data_container.py:718, in DataContainer.dot(self, other, *args, **kwargs)
716 return sf
717 else:
--> 718 raise ValueError('Shapes are not aligned: {} != {}'.format(self.shape, other.shape))
ValueError: Shapes are not aligned: (505, 505) != (505,)
@bosschmidt
There is a problem with
ImageDatamultiplied withVectorDatareturns
So when comparing shapes in https://github.com/TomographicImaging/CIL/blob/master/Wrappers/Python/cil/framework/data_container.py#L705
we should check
self.shape[1] == other.shape[0].