test_block.py 文件源码

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

项目:bifrost 作者: ledatelescope 项目源码 文件源码
def test_100_inputs(self):
        """Test that 100 input rings work"""
        def dstack_handler(*args):
            """Stack all input arrays"""
            return np.dstack(tuple(args))
        number_inputs = 100
        connections = {'in_1': 0, 'out_1': 1}
        for index in range(number_inputs):
            self.blocks.append([
                NumpyBlock(function=np.copy),
                {'in_1': 0, 'out_1': index + 2}])
            connections['in_' + str(index + 2)] = index + 2
        self.blocks.append([
            NumpyBlock(function=dstack_handler, inputs=len(connections) - 1),
            connections])
        self.expected_result = np.dstack((self.test_array,) * (len(connections) - 1)).ravel()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号