# Path: dlearn/utils/math.py
# def create_shared(x):
#     return theano.shared(np.asarray(x), borrow=True)


import numpy as np
from ..utils.math import create_shared



class HierarData(object):

    def __init__(self, data, limit=None):
        self._cpu_data = data

        if limit is None or limit > data.shape[0]:
            limit = data.shape[0]
        self._limit = limit

        self._gpu_data = create_shared(self._cpu_data[0:limit])

# Path: dlearn/utils/math.py
# def create_shared(x):
#     return theano.shared(np.asarray(x), borrow=True)


# Path: dlearn/data/hidata.py
import numpy as np
from ..utils.math import create_shared




class HierarData(object):

    def __init__(self, data, limit=None):
        self._cpu_data = data

        if limit is None or limit > data.shape[0]:
            limit = data.shape[0]
        self._limit = limit

        self._gpu_data = create_shared(self._cpu_data[0:limit])

        self._cur_irange = create_shared(np.asarray([0, limit]))