# 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/util.py
# def tprint(*args, **kwargs):
#     global _tlog_path
#     import datetime
#     GRAY = '\033[1;30m'
#     RESET = '\033[0m'
#     time_str = GRAY+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')+RESET
#     print(*((time_str,) + args), **kwargs) 
# 
#     if _tlog_path is not None:
#         with open(_tlog_path, 'a') as f:
#             nocol_time_str = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
#             print(*((nocol_time_str,) + args), file=f, **kwargs) 


from .util import DummyDict
from .util import tprint
import deepdish as dd
import numpy as np
    import tensorflow as tf
    import tensorflow as tf
                    if pre_adjust_batch_norm and bn_name in data:
                        bn_data = data[bn_name]
                        sigma = np.sqrt(1e-5 + bn_data['1'] / bn_data['2'])
                        W /= sigma
                        init_str += ' batch-adjusted'

                    assigns.append(weights.assign(W))
                    loaded.append('{}:0 -> {}:weights{} {}'.format(key, local_key, init_str, info.get(key, '')))

            if '1' in data[key]:
                biases = find_weights(local_key, 'biases')
                if biases is not None:
                    bias = data[key]['1']

                    init_str = ''
                    if pre_adjust_batch_norm and bn_name in data:
                        bn_data = data[bn_name]
                        sigma = np.sqrt(1e-5 + bn_data['1'] / bn_data['2'])
                        mu = bn_data['0'] / bn_data['2']
                        bias = (bias - mu) / sigma
                        init_str += ' batch-adjusted'

                    assigns.append(biases.assign(bias))
                    loaded.append('{}:1 -> {}:biases{}'.format(key, local_key, init_str))

            # Check batch norm and load them (unless they have been folded into)
            #if not pre_adjust_batch_norm:

    session.run(assigns)
    if verbose:

# 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/util.py
# def tprint(*args, **kwargs):
#     global _tlog_path
#     import datetime
#     GRAY = '\033[1;30m'
#     RESET = '\033[0m'
#     time_str = GRAY+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')+RESET
#     print(*((time_str,) + args), **kwargs) 
# 
#     if _tlog_path is not None:
#         with open(_tlog_path, 'a') as f:
#             nocol_time_str = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
#             print(*((nocol_time_str,) + args), file=f, **kwargs) 


# Path: selfsup/caffe.py
from .util import DummyDict
from .util import tprint
import deepdish as dd
import numpy as np
    import tensorflow as tf
    import tensorflow as tf

                    if pre_adjust_batch_norm and bn_name in data:
                        bn_data = data[bn_name]
                        sigma = np.sqrt(1e-5 + bn_data['1'] / bn_data['2'])
                        W /= sigma
                        init_str += ' batch-adjusted'

                    assigns.append(weights.assign(W))
                    loaded.append('{}:0 -> {}:weights{} {}'.format(key, local_key, init_str, info.get(key, '')))

            if '1' in data[key]:
                biases = find_weights(local_key, 'biases')
                if biases is not None:
                    bias = data[key]['1']

                    init_str = ''
                    if pre_adjust_batch_norm and bn_name in data:
                        bn_data = data[bn_name]
                        sigma = np.sqrt(1e-5 + bn_data['1'] / bn_data['2'])
                        mu = bn_data['0'] / bn_data['2']
                        bias = (bias - mu) / sigma
                        init_str += ' batch-adjusted'

                    assigns.append(biases.assign(bias))
                    loaded.append('{}:1 -> {}:biases{}'.format(key, local_key, init_str))

            # Check batch norm and load them (unless they have been folded into)
            #if not pre_adjust_batch_norm:

    session.run(assigns)
    if verbose:

        tprint('Loaded model from', path)