# Path: deeppy/expr/base.py
# class Op(PickleMixin):
#     _pickle_ignore = ['_tmp_', 'array', 'grad_array']
#     inputs = []
#     bpropable = True
#     shape = None
#     array = None
#     grad_array = None
# 
#     def setup(self):
#         pass
# 
#     def fprop(self):
#         raise NotImplementedError()
# 
#     def bprop(self):
#         raise NotImplementedError()
# 
#     def __add__(self, other):
#         return deeppy.expr.Add()(self, other)
# 
#     def __radd__(self, other):
#         return deeppy.expr.Add()(other, self)
# 
#     def __iadd__(self, other):
#         return self.__add__(other)
# 
#     def __sub__(self, other):
#         return deeppy.expr.Subtract()(self, other)
# 
#     def __rsub__(self, other):
#         return deeppy.expr.Subtract()(other, self)
# 
#     def __isub__(self, other):
#         return self.__sub__(other)
# 
#     def __mul__(self, other):
#         return deeppy.expr.Multiply()(self, other)
# 
#     def __rmul__(self, other):
#         return deeppy.expr.Multiply()(other, self)
# 
#     def __imul__(self, other):
#         return self.__mul__(other)
# 
#     def __div__(self, other):
#         return deeppy.expr.Divide()(self, other)
# 
#     def __rdiv__(self, other):
#         return deeppy.expr.Divide()(other, self)
# 
#     def __idiv__(self, other):
#         return self.__div__(other)
# 
#     def __truediv__(self, other):
#         return deeppy.expr.Divide()(self, other)
# 
#     def __rtruediv__(self, other):
#         return deeppy.expr.Divide()(other, self)
# 
#     def __itruediv__(self, other):
#         return self.__truediv__(other)
# 
#     def __pow__(self, other):
#         return deeppy.expr.Power()(self, other)
# 
#     def __rpow__(self, other):
#         return deeppy.expr.Power()(other, self)
# 
#     def __ipow__(self, other):
#         return self.__pow__(other)
# 
#     def __neg__(self):
#         return deeppy.expr.Negative()(self)
# 
#     @property
#     def T(self):
#         return deeppy.expr.transpose(self)
# 
# class NoBPropMixin(object):
#     def bprop(self):
#         raise ValueError('NoBPropMixin should not bprop().')


import cudarray as ca
from .base import Op, NoBPropMixin


class Normal(Op, NoBPropMixin):
    bpropable = False

    def __init__(self, shape, mu=0.0, sigma=1.0):
        self.shape = shape
        self.mu = mu
        self.sigma = sigma
        self.array = ca.zeros(self.shape)

    def fprop(self):
        self.array = ca.random.normal(loc=self.mu, scale=self.sigma,
                                      size=self.shape)



# Path: deeppy/expr/base.py
# class Op(PickleMixin):
#     _pickle_ignore = ['_tmp_', 'array', 'grad_array']
#     inputs = []
#     bpropable = True
#     shape = None
#     array = None
#     grad_array = None
# 
#     def setup(self):
#         pass
# 
#     def fprop(self):
#         raise NotImplementedError()
# 
#     def bprop(self):
#         raise NotImplementedError()
# 
#     def __add__(self, other):
#         return deeppy.expr.Add()(self, other)
# 
#     def __radd__(self, other):
#         return deeppy.expr.Add()(other, self)
# 
#     def __iadd__(self, other):
#         return self.__add__(other)
# 
#     def __sub__(self, other):
#         return deeppy.expr.Subtract()(self, other)
# 
#     def __rsub__(self, other):
#         return deeppy.expr.Subtract()(other, self)
# 
#     def __isub__(self, other):
#         return self.__sub__(other)
# 
#     def __mul__(self, other):
#         return deeppy.expr.Multiply()(self, other)
# 
#     def __rmul__(self, other):
#         return deeppy.expr.Multiply()(other, self)
# 
#     def __imul__(self, other):
#         return self.__mul__(other)
# 
#     def __div__(self, other):
#         return deeppy.expr.Divide()(self, other)
# 
#     def __rdiv__(self, other):
#         return deeppy.expr.Divide()(other, self)
# 
#     def __idiv__(self, other):
#         return self.__div__(other)
# 
#     def __truediv__(self, other):
#         return deeppy.expr.Divide()(self, other)
# 
#     def __rtruediv__(self, other):
#         return deeppy.expr.Divide()(other, self)
# 
#     def __itruediv__(self, other):
#         return self.__truediv__(other)
# 
#     def __pow__(self, other):
#         return deeppy.expr.Power()(self, other)
# 
#     def __rpow__(self, other):
#         return deeppy.expr.Power()(other, self)
# 
#     def __ipow__(self, other):
#         return self.__pow__(other)
# 
#     def __neg__(self):
#         return deeppy.expr.Negative()(self)
# 
#     @property
#     def T(self):
#         return deeppy.expr.transpose(self)
# 
# class NoBPropMixin(object):
#     def bprop(self):
#         raise ValueError('NoBPropMixin should not bprop().')


# Path: deeppy/expr/random.py
import cudarray as ca
from .base import Op, NoBPropMixin



class Normal(Op, NoBPropMixin):
    bpropable = False

    def __init__(self, shape, mu=0.0, sigma=1.0):
        self.shape = shape
        self.mu = mu
        self.sigma = sigma
        self.array = ca.zeros(self.shape)

    def fprop(self):
        self.array = ca.random.normal(loc=self.mu, scale=self.sigma,
                                      size=self.shape)



class Uniform(Op, NoBPropMixin):