# 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



def max_pool(x, size, stride=None, name=None, info=DummyDict(), padding='SAME'):
    if stride is None:
        stride = size

    z = tf.nn.max_pool(x, ksize=[1, size, size, 1],
                          strides=[1, stride, stride, 1],
                          padding=padding,
                          name=name)

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


def avg_pool(x, size, stride=None, name=None, info=DummyDict(), padding='SAME'):
    if stride is None:
        stride = size

    z = tf.nn.avg_pool(x, ksize=[1, size, size, 1],
                          strides=[1, stride, stride, 1],
                          padding=padding,
                          name=name)

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



# 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




def max_pool(x, size, stride=None, name=None, info=DummyDict(), padding='SAME'):
    if stride is None:
        stride = size

    z = tf.nn.max_pool(x, ksize=[1, size, size, 1],
                          strides=[1, stride, stride, 1],
                          padding=padding,
                          name=name)

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


def avg_pool(x, size, stride=None, name=None, info=DummyDict(), padding='SAME'):
    if stride is None:
        stride = size

    z = tf.nn.avg_pool(x, ksize=[1, size, size, 1],
                          strides=[1, stride, stride, 1],
                          padding=padding,
                          name=name)

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



def dropout(x, drop_prob, phase_test=None, name=None, info=DummyDict()):