Esempio n. 1
0
    def test_avg_pool_same_padding_class_with_inferred_shapes(self):
        x = np.ones((2, 3, 6))

        result = pool.AvgPool(3, 1, padding="SAME", channel_axis=None)(x)

        np.testing.assert_equal(result.shape, x.shape)
        # Since x is constant, its avg value should be itself.
        np.testing.assert_equal(result, x)
Esempio n. 2
0
  def test_avg_pool_same_padding_class(self):
    x = np.ones((2, 3, 6))

    window_shape = [1, 3, 3]
    strides = [1, 1, 1]
    avg_pool = pool.AvgPool(
        window_shape=window_shape, strides=strides, padding="SAME")
    result = avg_pool(x)

    np.testing.assert_equal(result.shape, x.shape)
    # Since x is constant, its avg value should be itself.
    np.testing.assert_equal(result, x)