# Path: experimental/lo/utils.py
# def get_padding_value(padding, kernel):
#   """Returns padding value for kernel."""
# 
#   if padding == "valid":
#     return 0
#   elif padding == "same":
#     return kernel // 2
#   elif padding == "full":
#     return kernel - 1
# 
#   raise ValueError("accepted paddings are 'valid', 'same' or 'full', found " +
#                    padding)


import math
from .utils import get_padding_value
#
# 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.
# ==============================================================================
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




def print_rf(layer_name, x):
  print("Layer {}:".format(layer_name))
  print(
      "\theight/width: {}\n\tstride: {}\n\teq_kernel_size: {}\n\tstart: {}\n".format(
          *x)
  )


def rf_computation_for_layer(layer, layer_in):
  k, s, p = layer

# Path: experimental/lo/utils.py
# def get_padding_value(padding, kernel):
#   """Returns padding value for kernel."""
# 
#   if padding == "valid":
#     return 0
#   elif padding == "same":
#     return kernel // 2
#   elif padding == "full":
#     return kernel - 1
# 
#   raise ValueError("accepted paddings are 'valid', 'same' or 'full', found " +
#                    padding)


# Path: experimental/lo/receptive.py
import math
from .utils import get_padding_value

#
# 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.
# ==============================================================================
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




def print_rf(layer_name, x):
  print("Layer {}:".format(layer_name))
  print(
      "\theight/width: {}\n\tstride: {}\n\teq_kernel_size: {}\n\tstart: {}\n".format(
          *x)
  )


def rf_computation_for_layer(layer, layer_in):
  k, s, p = layer

  n_in, j_in, r_in, start_in = layer_in