Skip to content

Commit

Permalink
Make chainer#8182 work with h5py<2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
toslunar committed Oct 2, 2019
1 parent 3a184c8 commit bc93d87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/chainer_tests/serializers_tests/test_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,14 @@ def test_deserialize_different_dtype_cpu(self):
# It should be bit-identical to the result directly retrieved from
# h5py.
arr_hdf5 = numpy.empty((2, 3), dtype=numpy.float16)
with tempfile.TemporaryFile() as buf:
with h5py.File(buf, 'w') as f:
fd, path = tempfile.mkstemp()
os.close(fd)
try:
with h5py.File(path, 'w') as f:
f.create_dataset('a', data=self.data)
f['a'].read_direct(arr_hdf5)
finally:
os.remove(path)
numpy.testing.assert_array_equal(y, arr_hdf5)

@attr.gpu
Expand Down

0 comments on commit bc93d87

Please sign in to comment.