# Path: gelato/layers/base.py
# class LayerModelMeta(pm.model.InitContextMeta):
#             class BayesianAnalog(layercls, pm.Model):
#     def __init__(cls, what, bases, dic):
#         def fget(self):
#         def fset(self, value):
#         def wrap_init(__init__):
#             def wrapped(self, *args, **kwargs):
#         def wrap_new(__new__):
#             def wrapped(_cls_, *args, **kwargs):
#         def add_param(self, spec, shape, name=None, **tags):
#         def wrap_getitem(__getitem__):
#             def wrapped(self, item):
#     def __repr__(self):
#     def __subclasshook__(cls, C):
# def bayes(layercls, stack=1):


from .base import Layer

__all__ = [
    'PosteriorLayer',
    'SamplingLayer'
]


class PosteriorLayer(Layer):
    """
    Layer that makes replacements in the graph in the incoming layer 
    so that `get_output` can be evaluated 
    """
    def get_output_for(self, incoming, approx=None, deterministic=False, **kwargs):
        if approx is None:
            raise ValueError('No approximation specified')
        return approx.apply_replacements(incoming, deterministic=deterministic)



# Path: gelato/layers/base.py
# class LayerModelMeta(pm.model.InitContextMeta):
#             class BayesianAnalog(layercls, pm.Model):
#     def __init__(cls, what, bases, dic):
#         def fget(self):
#         def fset(self, value):
#         def wrap_init(__init__):
#             def wrapped(self, *args, **kwargs):
#         def wrap_new(__new__):
#             def wrapped(_cls_, *args, **kwargs):
#         def add_param(self, spec, shape, name=None, **tags):
#         def wrap_getitem(__getitem__):
#             def wrapped(self, item):
#     def __repr__(self):
#     def __subclasshook__(cls, C):
# def bayes(layercls, stack=1):


# Path: gelato/layers/stats.py
from .base import Layer


__all__ = [
    'PosteriorLayer',
    'SamplingLayer'
]


class PosteriorLayer(Layer):
    """
    Layer that makes replacements in the graph in the incoming layer 
    so that `get_output` can be evaluated 
    """
    def get_output_for(self, incoming, approx=None, deterministic=False, **kwargs):
        if approx is None:
            raise ValueError('No approximation specified')
        return approx.apply_replacements(incoming, deterministic=deterministic)



class SamplingLayer(Layer):