[Python-modules-commits] [python-brainstorm] 01/06: fix tests for numpy 1.12

Daniel Stender danstender-guest at moszumanska.debian.org
Thu Jan 19 19:37:42 UTC 2017


This is an automated email from the git hooks/post-receive script.

danstender-guest pushed a commit to branch master
in repository python-brainstorm.

commit 6fb0fd984637c08e16f00e736d387a8c9e33dc08
Author: Daniel Stender <stender at debian.org>
Date:   Thu Jan 19 20:24:51 2017 +0100

    fix tests for numpy 1.12
    
    Description: fixes tests for Numpy 1.12.0.
    Bug-Debian: https://bugs.debian.org/849232
    Author: Graham Inggs <ginggs at debian.org>
    Forwarded: no
---
 brainstorm/tests/test_handler_operations.py | 4 ++--
 brainstorm/tests/test_weight_modifiers.py   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/brainstorm/tests/test_handler_operations.py b/brainstorm/tests/test_handler_operations.py
index 783281d..20cc1e8 100644
--- a/brainstorm/tests/test_handler_operations.py
+++ b/brainstorm/tests/test_handler_operations.py
@@ -81,8 +81,8 @@ def test_conv2d_forward_batch_numpy():
                                      kernel_shape[1]) / stride[1] + 1
 
                                 outputs = np.zeros((nr_images,
-                                                    output_height,
-                                                    output_width,
+                                                    int(output_height),
+                                                    int(output_width),
                                                     nr_filters), dtype=dtype)
                                 true_outputs = np.zeros_like(outputs)
 
diff --git a/brainstorm/tests/test_weight_modifiers.py b/brainstorm/tests/test_weight_modifiers.py
index dae512c..2254156 100644
--- a/brainstorm/tests/test_weight_modifiers.py
+++ b/brainstorm/tests/test_weight_modifiers.py
@@ -17,7 +17,7 @@ if has_pycuda:
 def test_limit_incoming_weights_squared():
     for orig in (np.random.rand(4, 5), np.random.randn(3, 5, 4, 6)):
         for limit in [0.00001, 1, 10, 10000]:
-            x = orig.reshape(orig.shape[0], orig.size / orig.shape[0]).copy()
+            x = orig.reshape(orig.shape[0], int(orig.size / orig.shape[0])).copy()
             divisor = (x * x).sum(axis=1, keepdims=True) ** 0.5 / limit
             divisor[divisor < 1] = 1
             out = (x / divisor).reshape(orig.shape)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-brainstorm.git



More information about the Python-modules-commits mailing list