Ejemplo n.º 1
0
def testOutChannelInput():
    sboard = mh.ChannelSwitchboard(input_dim=6,
                                   connections=[5, 5, 0, 1],
                                   out_channel_dim=2,
                                   in_channel_dim=2)
    assert numx.all(sboard.get_out_channel_input(0) == numx.array([5, 5]))
    assert numx.all(sboard.get_out_channel_input(1) == numx.array([0, 1]))
Ejemplo n.º 2
0
def testOutChannelsInputChannels():
    sboard = mh.ChannelSwitchboard(
        input_dim=6,
        connections=[
            5,
            5,  # out chan 1
            0,
            1
        ],  # out chan 2
        out_channel_dim=2,
        in_channel_dim=2)
    # note that there are 3 input channels
    assert numx.all(
        sboard.get_out_channels_input_channels(0) == numx.array([2]))
    assert numx.all(
        sboard.get_out_channels_input_channels(1) == numx.array([0]))
    assert numx.all(
        sboard.get_out_channels_input_channels([0, 1]) == numx.array([0, 2]))