Exemplo n.º 1
0
def test_convolution_limitation(transformer_factory, filter_count, batch_size, dilation,
                                description):
    with pytest.raises(AssertionError) as excinfo:
        execute_convolution(image_height=7, image_width=7, filter_height=3, filter_width=3,
                            channel=16, batch_size=batch_size, filter_count=filter_count,
                            image_3rd_dim=1, filter_3rd_dim=1, dilation=dilation)
    assert excinfo.match(description)
Exemplo n.º 2
0
def test_execute_convolution(image_height, image_width, image_3rd_dim, filter_height, filter_width,
                             filter_3rd_dim, padding, stride, description):
    out, np_out = execute_convolution(image_height=image_height, image_width=image_width,
                                      image_3rd_dim=image_3rd_dim, filter_height=filter_height,
                                      filter_width=filter_width, filter_3rd_dim=filter_3rd_dim,
                                      channel=16, batch_size=32, filter_count=8,
                                      padding=padding, stride=stride, dilation=1,
                                      np_comparison=True)
    print("out: ", out)
    print("np_out: ", np_out)
    assert np.array_equal(out, np_out)