ndarray.py 文件源码

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

项目:Aurora 作者: upul 项目源码 文件源码
def __setitem__(self, in_slice, value):
        """Set ndarray value"""
        if (not isinstance(in_slice, slice) or
                in_slice.start is not None
                or in_slice.stop is not None):
            raise ValueError('Array only support set from numpy array')
        if isinstance(value, NDArray):
            if value.handle is not self.handle:
                value.copyto(self)
        elif isinstance(value, (np.ndarray, np.generic)):
            self._sync_copyfrom(value)
        else:
            raise TypeError('type %s not supported' % str(type(value)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号