matutils.py 文件源码

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

项目:discretize 作者: simpeg 项目源码 文件源码
def ind2sub(shape, inds):
    """From the given shape, returns the subscripts of the given index"""
    if type(inds) is not np.ndarray:
        inds = np.array(inds)
    assert len(inds.shape) == 1, (
        'Indexing must be done as a 1D row vector, e.g. [3,6,6,...]'
    )
    return np.unravel_index(inds, shape, order='F')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号