# Path: tf_slim/layers/normalization.py
# DATA_FORMAT_NCHW = 'NCHW'
# DATA_FORMAT_NHWC = 'NHWC'
# def instance_norm(inputs,
#                   center=True,
#                   scale=True,
#                   epsilon=1e-6,
#                   activation_fn=None,
#                   param_initializers=None,
#                   reuse=None,
#                   variables_collections=None,
#                   outputs_collections=None,
#                   trainable=True,
#                   data_format=DATA_FORMAT_NHWC,
#                   scope=None):
# def group_norm(inputs,
#                groups=32,
#                channels_axis=-1,
#                reduction_axes=(-3, -2),
#                center=True,
#                scale=True,
#                epsilon=1e-6,
#                activation_fn=None,
#                param_initializers=None,
#                reuse=None,
#                variables_collections=None,
#                outputs_collections=None,
#                trainable=True,
#                scope=None,
#                mean_close_to_zero=False):
# 
# Path: tf_slim/ops/variables.py
# def assert_global_step(global_step_tensor):
# def assert_or_get_global_step(graph=None, global_step_tensor=None):
# def get_global_step(graph=None):
# def create_global_step(graph=None):
# def get_or_create_global_step(graph=None):
# def local_variable(initial_value,
#                    validate_shape=True,
#                    name=None,
#                    use_resource=None):
# def global_variable(initial_value,
#                     validate_shape=True,
#                     name=None,
#                     use_resource=None):
# def variable(name,
#              shape=None,
#              dtype=None,
#              initializer=None,
#              regularizer=None,
#              trainable=True,
#              collections=None,
#              caching_device=None,
#              device=None,
#              partitioner=None,
#              custom_getter=None,
#              use_resource=None,
#              synchronization=variables.VariableSynchronization.AUTO,
#              aggregation=variables.VariableAggregation.NONE):
# def model_variable(name,
#                    shape=None,
#                    dtype=dtypes.float32,
#                    initializer=None,
#                    regularizer=None,
#                    trainable=True,
#                    collections=None,
#                    caching_device=None,
#                    device=None,
#                    partitioner=None,
#                    custom_getter=None,
#                    use_resource=None,
#                    synchronization=variables.VariableSynchronization.AUTO,
#                    aggregation=variables.VariableAggregation.NONE):
# def add_model_variable(var):
# def get_variables(scope=None,
#                   suffix=None,
#                   collection=ops.GraphKeys.GLOBAL_VARIABLES):
# def get_model_variables(scope=None, suffix=None):
# def get_local_variables(scope=None, suffix=None):
# def get_trainable_variables(scope=None, suffix=None):
# def get_variables_to_restore(include=None, exclude=None):
# def get_variables_by_suffix(suffix, scope=None):
# def get_variables_by_name(given_name, scope=None):
# def get_unique_variable(var_op_name):
# def assign_from_values(var_names_to_values):
# def assign_from_values_fn(var_names_to_values):
#   def callback(session):
# def get_variable_full_name(var):
# def assign_from_checkpoint(model_path, var_list, ignore_missing_vars=False):
# def assign_from_checkpoint_fn(model_path,
#                               var_list,
#                               ignore_missing_vars=False,
#                               reshape_variables=False):
#     def callback(session):
#   def __init__(self,
#                num_tasks=0,
#                job_name='ps',
#                device_type='CPU',
#                device_index=0,
#                replica=None):
#   def __call__(self, op):
# def filter_variables(var_list,
#                      include_patterns=None,
#                      exclude_patterns=None,
#                      reg_search=True):
# class VariableDeviceChooser(object):


import numpy as np
import tensorflow.compat.v1 as tf
from tf_slim.layers import normalization
from tf_slim.ops import variables as contrib_variables
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import random_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import test
#
#     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 contrib.layers.python.layers.normalization."""

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



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



def setUpModule():
  tf.disable_eager_execution()


class InstanceNormTest(test.TestCase):

  def testUnknownShape(self):
    inputs = array_ops.placeholder(dtypes.float32)
    with self.assertRaisesRegexp(ValueError, 'undefined rank'):

# Path: tf_slim/layers/normalization.py
# DATA_FORMAT_NCHW = 'NCHW'
# DATA_FORMAT_NHWC = 'NHWC'
# def instance_norm(inputs,
#                   center=True,
#                   scale=True,
#                   epsilon=1e-6,
#                   activation_fn=None,
#                   param_initializers=None,
#                   reuse=None,
#                   variables_collections=None,
#                   outputs_collections=None,
#                   trainable=True,
#                   data_format=DATA_FORMAT_NHWC,
#                   scope=None):
# def group_norm(inputs,
#                groups=32,
#                channels_axis=-1,
#                reduction_axes=(-3, -2),
#                center=True,
#                scale=True,
#                epsilon=1e-6,
#                activation_fn=None,
#                param_initializers=None,
#                reuse=None,
#                variables_collections=None,
#                outputs_collections=None,
#                trainable=True,
#                scope=None,
#                mean_close_to_zero=False):
# 
# Path: tf_slim/ops/variables.py
# def assert_global_step(global_step_tensor):
# def assert_or_get_global_step(graph=None, global_step_tensor=None):
# def get_global_step(graph=None):
# def create_global_step(graph=None):
# def get_or_create_global_step(graph=None):
# def local_variable(initial_value,
#                    validate_shape=True,
#                    name=None,
#                    use_resource=None):
# def global_variable(initial_value,
#                     validate_shape=True,
#                     name=None,
#                     use_resource=None):
# def variable(name,
#              shape=None,
#              dtype=None,
#              initializer=None,
#              regularizer=None,
#              trainable=True,
#              collections=None,
#              caching_device=None,
#              device=None,
#              partitioner=None,
#              custom_getter=None,
#              use_resource=None,
#              synchronization=variables.VariableSynchronization.AUTO,
#              aggregation=variables.VariableAggregation.NONE):
# def model_variable(name,
#                    shape=None,
#                    dtype=dtypes.float32,
#                    initializer=None,
#                    regularizer=None,
#                    trainable=True,
#                    collections=None,
#                    caching_device=None,
#                    device=None,
#                    partitioner=None,
#                    custom_getter=None,
#                    use_resource=None,
#                    synchronization=variables.VariableSynchronization.AUTO,
#                    aggregation=variables.VariableAggregation.NONE):
# def add_model_variable(var):
# def get_variables(scope=None,
#                   suffix=None,
#                   collection=ops.GraphKeys.GLOBAL_VARIABLES):
# def get_model_variables(scope=None, suffix=None):
# def get_local_variables(scope=None, suffix=None):
# def get_trainable_variables(scope=None, suffix=None):
# def get_variables_to_restore(include=None, exclude=None):
# def get_variables_by_suffix(suffix, scope=None):
# def get_variables_by_name(given_name, scope=None):
# def get_unique_variable(var_op_name):
# def assign_from_values(var_names_to_values):
# def assign_from_values_fn(var_names_to_values):
#   def callback(session):
# def get_variable_full_name(var):
# def assign_from_checkpoint(model_path, var_list, ignore_missing_vars=False):
# def assign_from_checkpoint_fn(model_path,
#                               var_list,
#                               ignore_missing_vars=False,
#                               reshape_variables=False):
#     def callback(session):
#   def __init__(self,
#                num_tasks=0,
#                job_name='ps',
#                device_type='CPU',
#                device_index=0,
#                replica=None):
#   def __call__(self, op):
# def filter_variables(var_list,
#                      include_patterns=None,
#                      exclude_patterns=None,
#                      reg_search=True):
# class VariableDeviceChooser(object):


# Path: tf_slim/layers/normalization_test.py
import numpy as np
import tensorflow.compat.v1 as tf
from tf_slim.layers import normalization
from tf_slim.ops import variables as contrib_variables
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import random_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import test

#
#     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 contrib.layers.python.layers.normalization."""

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



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



def setUpModule():
  tf.disable_eager_execution()


class InstanceNormTest(test.TestCase):

  def testUnknownShape(self):
    inputs = array_ops.placeholder(dtypes.float32)
    with self.assertRaisesRegexp(ValueError, 'undefined rank'):

      normalization.instance_norm(inputs)