# Path: selfsup/util.py
# class DummyDict(object):
#     def __init__(self):
#         pass
#     def __getitem__(self, item):
#         return DummyDict()
#     def __setitem__(self, item, value):
#         return DummyDict()
#     def get(self, item, default=None):
#         if default is None:
#             return DummyDict()
#         else:
#             return default


import tensorflow as tf
import numpy as np
from .util import DummyDict
from tensorflow.python.framework import ops as tfops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import nn_ops
        value = array_ops.space_to_batch(input=value,
                                                                         paddings=space_to_batch_pad,
                                                                         block_size=rate)

        value = nn_ops.avg_pool(value=value, ksize=[1, size, size, 1],
                                                            strides=[1, 1, 1, 1],
                                                            padding="VALID",
                                                            name=name)

        # The crops argument to batch_to_space is just the extra padding component.
        batch_to_space_crop = [[0, pad_bottom_extra], [0, pad_right_extra]]

        value = array_ops.batch_to_space(input=value,
                                                                         crops=batch_to_space_crop,
                                                                         block_size=rate)

    info['activations'][name] = value
    return value


def conv(x, channels, size=3, strides=1, activation=tf.nn.relu, name=None, padding='SAME',
         info=DummyDict(), output_shape=None):
    with tf.name_scope(name):
        features = x.get_shape().as_list()[3]
        f = channels
        shape = [size, size, features, f]

        W_init = tf.contrib.layers.variance_scaling_initializer()
        b_init = tf.constant_initializer(0.0)


# Path: selfsup/util.py
# class DummyDict(object):
#     def __init__(self):
#         pass
#     def __getitem__(self, item):
#         return DummyDict()
#     def __setitem__(self, item, value):
#         return DummyDict()
#     def get(self, item, default=None):
#         if default is None:
#             return DummyDict()
#         else:
#             return default


# Path: selfsup/ops.py
import tensorflow as tf
import numpy as np
from .util import DummyDict
from tensorflow.python.framework import ops as tfops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import nn_ops

        value = array_ops.space_to_batch(input=value,
                                                                         paddings=space_to_batch_pad,
                                                                         block_size=rate)

        value = nn_ops.avg_pool(value=value, ksize=[1, size, size, 1],
                                                            strides=[1, 1, 1, 1],
                                                            padding="VALID",
                                                            name=name)

        # The crops argument to batch_to_space is just the extra padding component.
        batch_to_space_crop = [[0, pad_bottom_extra], [0, pad_right_extra]]

        value = array_ops.batch_to_space(input=value,
                                                                         crops=batch_to_space_crop,
                                                                         block_size=rate)

    info['activations'][name] = value
    return value


def conv(x, channels, size=3, strides=1, activation=tf.nn.relu, name=None, padding='SAME',
         info=DummyDict(), output_shape=None):
    with tf.name_scope(name):
        features = x.get_shape().as_list()[3]
        f = channels
        shape = [size, size, features, f]

        W_init = tf.contrib.layers.variance_scaling_initializer()
        b_init = tf.constant_initializer(0.0)


        W = tf.get_variable(name + '/weights', shape, dtype=tf.float32,