diff --git a/chainladder/core/io.py b/chainladder/core/io.py index 0f1c6ae7..b3da9b7e 100644 --- a/chainladder/core/io.py +++ b/chainladder/core/io.py @@ -23,7 +23,7 @@ def to_json(self): def sparse_out(tri): k, v, o, d = tri.shape xp = cp.get_array_module(tri) - if xp == cp: + if xp == cp != np: out = cp.asnumpy(tri) else: out = tri @@ -44,7 +44,7 @@ def sparse_out(tri): 'dtype': str(getattr(self, attribute).dtype), 'array': getattr(self, attribute).tolist()} xp = cp.get_array_module(self.values) - if xp == cp: + if xp == cp != np: out = cp.asnumpy(self.cum_to_incr().values) else: out = self.cum_to_incr().values