data.py 文件源码

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

项目:MXShuffleNet 作者: ZiyueHuang 项目源码 文件源码
def __init__(self, num_classes, data_shape, max_iter, dtype):
        self.batch_size = data_shape[0]
        self.cur_iter = 0
        self.max_iter = max_iter
        self.dtype = dtype
        label = np.random.randint(0, num_classes, [self.batch_size,])
        data = np.random.uniform(-1, 1, data_shape)
        self.data = mx.nd.array(data, dtype=self.dtype, ctx=mx.Context('cpu_pinned', 0))
        self.label = mx.nd.array(label, dtype=self.dtype, ctx=mx.Context('cpu_pinned', 0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号