summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-06-13 16:59:33 +0100
committerGitHub <noreply@github.com>2019-06-13 16:59:33 +0100
commitb11f9e3c1fbf2181b906b185e1b32314e021d573 (patch)
tree2f8cfad76f440020d9010fecf238818ff026908d
parent70d033eed21238c44c8e248260b150b0a2892c0a (diff)
parent1c1b7fc260743e56bf02fa1f26c3a04b713ebcda (diff)
downloadframework-b11f9e3c1fbf2181b906b185e1b32314e021d573.tar.gz
framework-b11f9e3c1fbf2181b906b185e1b32314e021d573.tar.bz2
framework-b11f9e3c1fbf2181b906b185e1b32314e021d573.tar.xz
framework-b11f9e3c1fbf2181b906b185e1b32314e021d573.zip
Merge pull request #309 from vais-ral/dot_fix
replace default for dot by numpy
-rwxr-xr-xWrappers/Python/ccpi/framework/framework.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/framework/framework.py b/Wrappers/Python/ccpi/framework/framework.py
index 94bc866..8ee2c75 100755
--- a/Wrappers/Python/ccpi/framework/framework.py
+++ b/Wrappers/Python/ccpi/framework/framework.py
@@ -767,14 +767,14 @@ class DataContainer(object):
return numpy.sqrt(self.squared_norm())
def dot(self, other, *args, **kwargs):
'''return the inner product of 2 DataContainers viewed as vectors'''
- method = kwargs.get('method', 'reduce')
+ method = kwargs.get('method', 'numpy')
if method not in ['numpy','reduce']:
raise ValueError('dot: specified method not valid. Expecting numpy or reduce got {} '.format(
method))
if self.shape == other.shape:
# return (self*other).sum()
if method == 'numpy':
- return numpy.dot(self.as_array().ravel(), other.as_array())
+ return numpy.dot(self.as_array().ravel(), other.as_array().ravel())
elif method == 'reduce':
# see https://github.com/vais-ral/CCPi-Framework/pull/273
# notice that Python seems to be smart enough to use