features.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:pysc2 作者: deepmind 项目源码 文件源码
def unpack_layer(plane):
    """Return a correctly shaped numpy array given the feature layer bytes."""
    size = point.Point.build(plane.size)
    if size == (0, 0):
      # New layer that isn't implemented in this SC2 version.
      return None
    data = np.fromstring(plane.data, dtype=Feature.dtypes[plane.bits_per_pixel])
    if plane.bits_per_pixel == 1:
      data = np.unpackbits(data)
    return data.reshape(size.transpose())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号