def test_Rect_double_routing_1(): sboard = mh.DoubleRect2dSwitchboard(in_channels_xy=4, field_channels_xy=2, in_channel_dim=1) assert (sboard.connections == numx.array([ 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15, # uneven fields 5, 6, 9, 10 ])).all() x = numx.array([ list(range(0, sboard.input_dim)), list(range(101, 101 + sboard.input_dim)) ]) sboard.execute(x)
def test_rect_double_routing_3(): sboard = mh.DoubleRect2dSwitchboard(in_channels_xy=(4, 6), field_channels_xy=2, in_channel_dim=1) assert numx.all((sboard.connections == numx.array([ 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15, 16, 17, 20, 21, 18, 19, 22, 23, 5, 6, 9, 10, 13, 14, 17, 18 ]))) # uneven fields x = numx.array([ list(range(0, sboard.input_dim)), list(range(101, 101 + sboard.input_dim)) ]) sboard.execute(x)
def test_Rect_double_routing_2(): sboard = mh.DoubleRect2dSwitchboard(in_channels_xy=(6, 4), field_channels_xy=(2, 2), in_channel_dim=1) assert (sboard.connections == numx.array([ 0, 1, 6, 7, 2, 3, 8, 9, 4, 5, 10, 11, 12, 13, 18, 19, 14, 15, 20, 21, 16, 17, 22, 23, # uneven fields 7, 8, 13, 14, 9, 10, 15, 16 ])).all() x = numx.array([ list(range(0, sboard.input_dim)), list(range(101, 101 + sboard.input_dim)) ]) sboard.execute(x)