import tensorflow as tf


def _relu(name, x):
    """
    Applies ReLU function.

    :param name: [string]     Name of the op.
    :param x:    [Tensor]     Input to the function.

    :return:     [Tensor]     Output of the function.
    """
    return tf.nn.relu(x, name=name)
    # log.warning('Not using ReLU to test performance at inference time')
    # return x


def _stride_arr(n, data_format='NHWC'):
    """Makes strides array for downsampling convolution."""
    if data_format == 'NHWC':
        return [1, n, n, 1]
    elif data_format == 'NCHW':
