Skip to content

save_npz sometimes fails #160

@ghost

Description

Hi,

save_npz sometimes fails because of this line of code, where params is a list of numpy arrays. When the first dimension of arrays in params is the same but other dimensions may be not, numpy would raise a broadcast error.

Here is a piece of code for reproducing the numpy error.

import numpy as np
t1 = np.arange(8).reshape((2, 2, 2))
t2 = np.arange(12).reshape((2, 2, 3))
t3 = np.arange(16).reshape((2, 2, 4))
np.savez('test.npz', params=[t1, t2, t3])

I use python 3.5 and numpy 1.12. I googled around and it seems to be an implementation problem in numpy, as suggested by this. A possible solution is not to use a list of numpy arrays for the params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions