def test_maxpool3d(): """ Test the layer.MaxPool3d class and its default attributes. """ pooling = layer.MaxPool3d(2) assert isinstance(pooling._max_pool, tf.keras.layers.MaxPool3D) assert pooling._max_pool.pool_function == tf.nn.max_pool3d assert pooling._max_pool.strides == (2, 2, 2) assert pooling._max_pool.padding == "same"
def test_maxpool3d(): """ Test the layer.MaxPool3d class and its default attributes. No need to test the call() function since its a tensorflow class """ pooling = layer.MaxPool3d(2) assert isinstance(pooling._max_pool, type(tf.keras.layers.MaxPool3D())) assert pooling._max_pool.pool_function == tf.nn.max_pool3d assert pooling._max_pool.strides == (2, 2, 2) assert pooling._max_pool.padding == "same"
def test_downsampleResnetBlock(): """ Test the layer.DownSampleResnetBlock class and its default attributes. No need to test the call() function since a concatenation of tensorflow classes """ model = layer.DownSampleResnetBlock(8) assert model._pooling is True assert isinstance(model._conv3d_block, type(layer.Conv3dBlock(8))) assert isinstance(model._residual_block, type(layer.Residual3dBlock(8))) assert isinstance(model._max_pool3d, type(layer.MaxPool3d(2))) assert model._conv3d_block3 is None model = layer.DownSampleResnetBlock(8, pooling=False) assert model._max_pool3d is None assert isinstance(model._conv3d_block3, type(layer.Conv3dBlock(8)))