# Path: tf_slim/layers/initializers.py
# def xavier_initializer(uniform=True, seed=None, dtype=dtypes.float32):
# def variance_scaling_initializer(factor=2.0, mode='FAN_IN', uniform=False,
#                                  seed=None, dtype=dtypes.float32):
#   def _initializer(shape, dtype=dtype, partition_info=None):
# 
# Path: tf_slim/layers/regularizers.py
# def l1_regularizer(scale, scope=None):
#   def l1(weights, name=None):
# def l2_regularizer(scale, scope=None):
#   def l2(weights):
# def l1_l2_regularizer(scale_l1=1.0, scale_l2=1.0, scope=None):
# def sum_regularizer(regularizer_list, scope=None):
#   def sum_reg(weights):
# def apply_regularization(regularizer, weights_list=None):


import numpy as np
import tf_slim
from tf_slim.layers import initializers
from tf_slim.layers import regularizers
from tensorflow.python.client import session
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import variables
from tensorflow.python.platform import test
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for initializers."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



# pylint: disable=g-direct-tensorflow-import


class InitializerTest(test.TestCase):

  def test_xavier_wrong_dtype(self):
    with self.assertRaisesRegexp(
        TypeError, 'Cannot create initializer for non-floating point type.'):

# Path: tf_slim/layers/initializers.py
# def xavier_initializer(uniform=True, seed=None, dtype=dtypes.float32):
# def variance_scaling_initializer(factor=2.0, mode='FAN_IN', uniform=False,
#                                  seed=None, dtype=dtypes.float32):
#   def _initializer(shape, dtype=dtype, partition_info=None):
# 
# Path: tf_slim/layers/regularizers.py
# def l1_regularizer(scale, scope=None):
#   def l1(weights, name=None):
# def l2_regularizer(scale, scope=None):
#   def l2(weights):
# def l1_l2_regularizer(scale_l1=1.0, scale_l2=1.0, scope=None):
# def sum_regularizer(regularizer_list, scope=None):
#   def sum_reg(weights):
# def apply_regularization(regularizer, weights_list=None):


# Path: tf_slim/layers/initializers_test.py
import numpy as np
import tf_slim
from tf_slim.layers import initializers
from tf_slim.layers import regularizers
from tensorflow.python.client import session
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import variables
from tensorflow.python.platform import test

# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for initializers."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



# pylint: disable=g-direct-tensorflow-import


class InitializerTest(test.TestCase):

  def test_xavier_wrong_dtype(self):
    with self.assertRaisesRegexp(
        TypeError, 'Cannot create initializer for non-floating point type.'):

      initializers.xavier_initializer(dtype=dtypes.int32)