def check_savez(self, savez, dtype):
a1 = testing.shaped_arange((2, 3, 4), dtype=dtype)
a2 = testing.shaped_arange((3, 4, 5), dtype=dtype)
sio = six.BytesIO()
savez(sio, a1, a2)
s = sio.getvalue()
sio.close()
sio = six.BytesIO(s)
with cupy.load(sio) as d:
b1 = d['arr_0']
b2 = d['arr_1']
sio.close()
testing.assert_array_equal(a1, b1)
testing.assert_array_equal(a2, b2)
评论列表
文章目录