def load_grid8(return_imsize=True):
"""Load grid 8x8.
Parameters
----------
return_imsize : bool
return a tuple with grid size if True
Returns
-------
db : h5py.File
a HDF5 file object
imsize : tuple
(optional) grid size
"""
file_path = os.path.join(rlvision.RLVISION_DATA,
"HDF5", "gridworld_8.hdf5")
if not os.path.isfile(file_path):
raise ValueError("The dataset %s is not existed!" % (file_path))
if return_imsize is True:
return h5py.File(file_path, mode="r"), (8, 8)
else:
return h5py.File(file_path, mode="r")
utils.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录