# Path: seya/utils.py
# def batched_dot(input, W_list, b_list, sizes_list):
# def batchwise_function(func, X, batch_size=100, verbose=1):
# def alloc_ones_matrix(*dims):
# def theano_rng(seed=123):
# def apply_layer(layer, X, train=False):
# def apply_model(model, X):
# def s2s_to_s2t(sequences, targets):
# def pad_md_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncating='pre', value=0.):
# def diff_abs(z):
# def unroll_scan(fn, sequences, outputs_info, non_sequences, n_steps,
#                 go_backwards=False):
# def rnn_states(step_function, inputs, initial_states,
#                go_backwards=False, masking=True):
#     def _step(input, *states):
#     X = input
#     W = K.concatenate(W_list, axis=-1)
#     Y = K.dot(X, W) + b
#     Y = []
#     Y = layer.get_output(train=train)
#     Y = model.get_output()
#     X = []


import unittest
import numpy as np
import theano
from seya import utils
from keras import backend as K
# encoding: utf-8
"""Test seya.layers.recurrent module"""

from __future__ import print_function


floatX = K.common._FLOATX


class TestUtils(unittest.TestCase):
    """Test seya.utils"""

    def test_batched_dot(self):
        """Check if batched dot works"""
        samples = 8
        xdim = 7
        sizes_list = [10, 5]
        X = K.placeholder(ndim=2)
        W1 = K.placeholder(ndim=2)
        W2 = K.placeholder(ndim=2)
        B1 = K.placeholder(ndim=1)
        B2 = K.placeholder(ndim=1)

# Path: seya/utils.py
# def batched_dot(input, W_list, b_list, sizes_list):
# def batchwise_function(func, X, batch_size=100, verbose=1):
# def alloc_ones_matrix(*dims):
# def theano_rng(seed=123):
# def apply_layer(layer, X, train=False):
# def apply_model(model, X):
# def s2s_to_s2t(sequences, targets):
# def pad_md_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncating='pre', value=0.):
# def diff_abs(z):
# def unroll_scan(fn, sequences, outputs_info, non_sequences, n_steps,
#                 go_backwards=False):
# def rnn_states(step_function, inputs, initial_states,
#                go_backwards=False, masking=True):
#     def _step(input, *states):
#     X = input
#     W = K.concatenate(W_list, axis=-1)
#     Y = K.dot(X, W) + b
#     Y = []
#     Y = layer.get_output(train=train)
#     Y = model.get_output()
#     X = []


# Path: tests/test_utils.py
import unittest
import numpy as np
import theano
from seya import utils
from keras import backend as K

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

from __future__ import print_function


floatX = K.common._FLOATX


class TestUtils(unittest.TestCase):
    """Test seya.utils"""

    def test_batched_dot(self):
        """Check if batched dot works"""
        samples = 8
        xdim = 7
        sizes_list = [10, 5]
        X = K.placeholder(ndim=2)
        W1 = K.placeholder(ndim=2)
        W2 = K.placeholder(ndim=2)
        B1 = K.placeholder(ndim=1)
        B2 = K.placeholder(ndim=1)

        Y = utils.batched_dot(X, [W1, W2], [B1, B2], sizes_list)