sparse-convolution 0.1.4__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sparse_convolution
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Sparse convolution in python using Toeplitz convolution matrix multiplication.
5
5
  Home-page: https://github.com/RichieHakim/sparse_convolution
6
6
  Author: Richard Hakim
@@ -1,3 +1,3 @@
1
1
  from sparse_convolution.sparse_convolution import Toeplitz_convolution2d
2
2
 
3
- __version__ = '0.1.4'
3
+ __version__ = '0.1.5'
@@ -68,8 +68,8 @@ class Toeplitz_convolution2d():
68
68
  matrix.
69
69
  """
70
70
  ## Type checking
71
- assert isinstance(x_shape, tuple), "x_shape must be a tuple"
72
- assert all([isinstance(s, (int, float)) for s in x_shape]), "x_shape must be a tuple of integers"
71
+ assert isinstance(x_shape, (tuple, list)), f"x_shape must be a tuple. Found: {type(x_shape)}"
72
+ assert all([isinstance(s, (int, float, np.integer, np.floating)) for s in x_shape]), f"x_shape must be a tuple of integers. Found: {[type(s) for s in x_shape]}"
73
73
  x_shape = (int(x_shape[0]), int(x_shape[1]))
74
74
 
75
75
  assert isinstance(k, np.ndarray), "k must be a numpy array"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sparse_convolution
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Sparse convolution in python using Toeplitz convolution matrix multiplication.
5
5
  Home-page: https://github.com/RichieHakim/sparse_convolution
6
6
  Author: Richard Hakim
@@ -40,7 +40,7 @@ def test_toeplitz_convolution2d():
40
40
  success = False
41
41
  break
42
42
  try:
43
- if np.allclose(out_t2d, out_t2d_s.A) and np.allclose(out_t2d, out_sp) and np.allclose(out_sp, out_t2d_s.A):
43
+ if np.allclose(out_t2d, out_t2d_s.toarray()) and np.allclose(out_t2d, out_sp) and np.allclose(out_sp, out_t2d_s.toarray()):
44
44
  success = True
45
45
  continue
46
46
  except Exception as e: