# Path: selfsup/multi/methods/base.py
# class Method:
#     def __init__(self, name, batch_size):
#         self.name = name
#         self.batch_size = batch_size
# 
#     def input_size(self):
#         return 0
# 
#     def batch_loader(self):
#         raise NotImplemented("Abstract base class")
# 
#     def build_network(network, y, phase_test):
#         raise NotImplemented("Abstract base class")
# 
#     @property
#     def basenet_settings():
#         return {}
# 
#     def make_path(self, name, ext, iteration):
#         return f'img/{self.name}_{name}_{iteration}.png'


import selfsup
import tensorflow as tf
import os
from .base import Method
from collections import OrderedDict
    rot = tf.image.rot90(image, k=k)
    rot = tf.slice(rot, [0, 0, 0], image.get_shape().as_list())
    return [rot, k]


def _batch_random_rotate(batch):
    i = tf.constant(0)
    batch_rotated, batch_y = tf.map_fn(_random_rotate, batch, dtype=[tf.float32, tf.int32])
    return batch_rotated, batch_y


class Rot90(Method):
    def __init__(self, basenet, batch_size, loader):
        self.basenet = basenet
        self.batch_size = batch_size
        self._loader = loader

    @property
    def basenet_settings(self):
        return {'convolutional': False}

    def batch(self):
        x_upright, _ = self._loader.batch()

        x, y = _batch_random_rotate(x_upright)
        return x, y#, imgshape, imgname

    def build_network(self, network, y, phase_test, global_step):
        info = selfsup.info.create(scale_summary=True)


# Path: selfsup/multi/methods/base.py
# class Method:
#     def __init__(self, name, batch_size):
#         self.name = name
#         self.batch_size = batch_size
# 
#     def input_size(self):
#         return 0
# 
#     def batch_loader(self):
#         raise NotImplemented("Abstract base class")
# 
#     def build_network(network, y, phase_test):
#         raise NotImplemented("Abstract base class")
# 
#     @property
#     def basenet_settings():
#         return {}
# 
#     def make_path(self, name, ext, iteration):
#         return f'img/{self.name}_{name}_{iteration}.png'


# Path: selfsup/multi/methods/rot90.py
import selfsup
import tensorflow as tf
import os
from .base import Method
from collections import OrderedDict

    rot = tf.image.rot90(image, k=k)
    rot = tf.slice(rot, [0, 0, 0], image.get_shape().as_list())
    return [rot, k]


def _batch_random_rotate(batch):
    i = tf.constant(0)
    batch_rotated, batch_y = tf.map_fn(_random_rotate, batch, dtype=[tf.float32, tf.int32])
    return batch_rotated, batch_y


class Rot90(Method):
    def __init__(self, basenet, batch_size, loader):
        self.basenet = basenet
        self.batch_size = batch_size
        self._loader = loader

    @property
    def basenet_settings(self):
        return {'convolutional': False}

    def batch(self):
        x_upright, _ = self._loader.batch()

        x, y = _batch_random_rotate(x_upright)
        return x, y#, imgshape, imgname

    def build_network(self, network, y, phase_test, global_step):
        info = selfsup.info.create(scale_summary=True)


        z = network['activations']['top']