# Path: seya/utils.py
# def apply_model(model, X):
#     tmp = model.layers[0].get_input
#     model.layers[0].get_input = lambda _: X
#     Y = model.get_output()
#     model.layers[0].get_input = tmp
# 
#     return Y


import unittest
import numpy as np
import theano
from numpy.testing import assert_allclose
from keras import backend as K
from keras.layers.core import Dense
from keras.models import Sequential
from seya.utils import apply_model
# encoding: utf-8
"""Test seya.layers.recurrent module"""

from __future__ import print_function




floatX = K.common._FLOATX


class TestApply(unittest.TestCase):
    """Test apply methods"""

    def test_apply_model(self):
        """Test keras.models.Sequential.__call__"""
        nb_samples, input_dim, output_dim = 3, 10, 5
        model = Sequential()
        model.add(Dense(output_dim=output_dim, input_dim=input_dim))
        model.compile('sgd', 'mse')

        X = K.placeholder(ndim=2)

# Path: seya/utils.py
# def apply_model(model, X):
#     tmp = model.layers[0].get_input
#     model.layers[0].get_input = lambda _: X
#     Y = model.get_output()
#     model.layers[0].get_input = tmp
# 
#     return Y


# Path: tests/test_apply.py
import unittest
import numpy as np
import theano
from numpy.testing import assert_allclose
from keras import backend as K
from keras.layers.core import Dense
from keras.models import Sequential
from seya.utils import apply_model

# encoding: utf-8
"""Test seya.layers.recurrent module"""

from __future__ import print_function




floatX = K.common._FLOATX


class TestApply(unittest.TestCase):
    """Test apply methods"""

    def test_apply_model(self):
        """Test keras.models.Sequential.__call__"""
        nb_samples, input_dim, output_dim = 3, 10, 5
        model = Sequential()
        model.add(Dense(output_dim=output_dim, input_dim=input_dim))
        model.compile('sgd', 'mse')

        X = K.placeholder(ndim=2)

        Y = apply_model(model, X)