| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| """Tests for resnet_utils.""" |
| import tensorflow as tf |
|
|
| from deeplab2.model.layers import stems |
| from deeplab2.utils import test_utils |
|
|
|
|
| class ResnetUtilsTest(tf.test.TestCase): |
|
|
| def test_inception_stem_output_shape(self): |
| batch = 2 |
| height, width = 65, 65 |
| input_tensor = test_utils.create_test_input(batch, height, width, 3) |
| model = stems.InceptionSTEM() |
| output_tensor = model(input_tensor) |
| expected_height = (height - 1) / 2 + 1 |
| expected_width = (width - 1) / 2 + 1 |
| expected_channels = 128 |
| self.assertListEqual( |
| output_tensor.get_shape().as_list(), |
| [batch, expected_height, expected_width, expected_channels]) |
|
|
|
|
| if __name__ == '__main__': |
| tf.test.main() |
|
|