# Path: reservoir_nn/keras/blocks.py
# class DownSampleConvolution(tf.keras.layers.Layer):
# class UpSampleConvolution(tf.keras.layers.Layer):
# class AtrousSpatialPyramidPooling(tf.keras.layers.Layer):
# class InceptionV3Stem(tf.keras.layers.Layer):
# class InceptionBlock(tf.keras.layers.Layer):
# class MobileNetV2BlockLike(tf.keras.layers.Layer):
#   def __init__(
#       self,
#       conv_filters: Tuple[int, ...],
#       conv_kernel_sizes: Tuple[int, ...],
#       max_poolings: Tuple[bool, ...],
#       conv_strides: Tuple[int, ...],
#       activation: Optional[types.Activation] = None,
#       apply_batchnorm: bool = False,
#       leaky: bool = False,
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(
#       self,
#       conv_filters: Tuple[int, ...],
#       conv_kernel_sizes: Tuple[int, ...],
#       conv_strides: Tuple[int, ...],
#       apply_batchnorm: bool = False,
#       dropout_rate: float = 0.0,
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(
#       self,
#       dilation_rates: Tuple[int, int, int, int] = (1, 6, 12, 18),
#       dilation_kernel_sizes: Tuple[int, int, int, int] = (1, 3, 3, 3),
#       conv_num_filters: int = 256,
#       conv_kernel_size: int = 1,
#       pooling: str = 'global',
#       pooling_size: Optional[int] = None,
#       padding: str = 'same',
#       use_separable_conv=True,
#       name: Optional[str] = 'ASPP',
#       **kwargs: Any,
#   ):
#   def build(self, input_shape):
#   def call(self, inputs):
#   def get_config(self):
# def conv2d_bn(filters,
#               num_rows,
#               num_cols,
#               dilation_rate=(1, 1),
#               padding='same',
#               strides=(1, 1),
#               name=None) -> tf.keras.Sequential:
# def separable_conv2d_bn(filters,
#                         kernel_size,
#                         dilation_rate,
#                         padding='same',
#                         name=None) -> tf.keras.Sequential:
#   def __init__(
#       self,
#       num_filters: Tuple[int, int, int, int, int] = (32, 32, 64, 80, 192),
#       padding: str = 'same',
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(self,
#                num_filters: int,
#                name: Optional[str] = None,
#                **kwargs: Any):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(
#       self,
#       output_filters: int,
#       expansion_factor: int = 1,
#       conv_stride: int = 1,
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def build(self, input_shape):
#   def call(self, input_: tf.Tensor) -> tf.Tensor:
#   def get_config(self):
# def downsample_block(
#     filters: int,
#     size: int,
#     strides: int = 2,
#     apply_batchnorm: bool = True,
#     name: Optional[str] = None,
# ) -> tf.keras.Sequential:
# def upsample_block(
#     filters: int,
#     size: int,
#     strides: int = 2,
#     apply_batchnorm: bool = True,
#     apply_dropout: bool = False,
#     name: Optional[str] = None,
# ) -> tf.keras.Sequential:


import os
import tensorflow as tf
from absl.testing import absltest
from absl.testing import parameterized
from reservoir_nn.keras import blocks
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for blocks.py."""



class DownSampleConvolutionTest(absltest.TestCase):

  def test_it_returns_output_of_expected_shape(self):
    image = tf.range(3 * 20 * 40 * 7, dtype=tf.float32)
    image = tf.reshape(image, (3, 20, 40, 7))

# Path: reservoir_nn/keras/blocks.py
# class DownSampleConvolution(tf.keras.layers.Layer):
# class UpSampleConvolution(tf.keras.layers.Layer):
# class AtrousSpatialPyramidPooling(tf.keras.layers.Layer):
# class InceptionV3Stem(tf.keras.layers.Layer):
# class InceptionBlock(tf.keras.layers.Layer):
# class MobileNetV2BlockLike(tf.keras.layers.Layer):
#   def __init__(
#       self,
#       conv_filters: Tuple[int, ...],
#       conv_kernel_sizes: Tuple[int, ...],
#       max_poolings: Tuple[bool, ...],
#       conv_strides: Tuple[int, ...],
#       activation: Optional[types.Activation] = None,
#       apply_batchnorm: bool = False,
#       leaky: bool = False,
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(
#       self,
#       conv_filters: Tuple[int, ...],
#       conv_kernel_sizes: Tuple[int, ...],
#       conv_strides: Tuple[int, ...],
#       apply_batchnorm: bool = False,
#       dropout_rate: float = 0.0,
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(
#       self,
#       dilation_rates: Tuple[int, int, int, int] = (1, 6, 12, 18),
#       dilation_kernel_sizes: Tuple[int, int, int, int] = (1, 3, 3, 3),
#       conv_num_filters: int = 256,
#       conv_kernel_size: int = 1,
#       pooling: str = 'global',
#       pooling_size: Optional[int] = None,
#       padding: str = 'same',
#       use_separable_conv=True,
#       name: Optional[str] = 'ASPP',
#       **kwargs: Any,
#   ):
#   def build(self, input_shape):
#   def call(self, inputs):
#   def get_config(self):
# def conv2d_bn(filters,
#               num_rows,
#               num_cols,
#               dilation_rate=(1, 1),
#               padding='same',
#               strides=(1, 1),
#               name=None) -> tf.keras.Sequential:
# def separable_conv2d_bn(filters,
#                         kernel_size,
#                         dilation_rate,
#                         padding='same',
#                         name=None) -> tf.keras.Sequential:
#   def __init__(
#       self,
#       num_filters: Tuple[int, int, int, int, int] = (32, 32, 64, 80, 192),
#       padding: str = 'same',
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(self,
#                num_filters: int,
#                name: Optional[str] = None,
#                **kwargs: Any):
#   def call(self, inputs):
#   def get_config(self):
#   def __init__(
#       self,
#       output_filters: int,
#       expansion_factor: int = 1,
#       conv_stride: int = 1,
#       name: Optional[str] = None,
#       **kwargs: Any,
#   ):
#   def build(self, input_shape):
#   def call(self, input_: tf.Tensor) -> tf.Tensor:
#   def get_config(self):
# def downsample_block(
#     filters: int,
#     size: int,
#     strides: int = 2,
#     apply_batchnorm: bool = True,
#     name: Optional[str] = None,
# ) -> tf.keras.Sequential:
# def upsample_block(
#     filters: int,
#     size: int,
#     strides: int = 2,
#     apply_batchnorm: bool = True,
#     apply_dropout: bool = False,
#     name: Optional[str] = None,
# ) -> tf.keras.Sequential:


# Path: reservoir_nn/keras/blocks_test.py
import os
import tensorflow as tf
from absl.testing import absltest
from absl.testing import parameterized
from reservoir_nn.keras import blocks

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for blocks.py."""



class DownSampleConvolutionTest(absltest.TestCase):

  def test_it_returns_output_of_expected_shape(self):
    image = tf.range(3 * 20 * 40 * 7, dtype=tf.float32)
    image = tf.reshape(image, (3, 20, 40, 7))

    conv_head = blocks.DownSampleConvolution(