# Path: tf_slim/metrics/histogram_ops.py
# def auc_using_histogram(boolean_labels,
#                         scores,
#                         score_range,
#                         nbins=100,
#                         collections=None,
#                         check_shape=True,
#                         name=None):
# def _check_labels_and_scores(boolean_labels, scores, check_shape):
# def _make_auc_histograms(boolean_labels, scores, score_range, nbins):
# def _auc_hist_accumulate(hist_true, hist_false, nbins, collections):
# def _auc_convert_hist_to_auc(hist_true_acc, hist_false_acc, nbins):
# def _strict_1d_cumsum(tensor, len_tensor):


import numpy as np
import tensorflow.compat.v1 as tf
from tf_slim.metrics import histogram_ops
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import test
# 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 histogram_ops."""
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 Strict1dCumsumTest(test.TestCase):
  """Test this private function."""

  def test_empty_tensor_returns_empty(self):
    with self.cached_session():
      tensor = constant_op.constant([])

# Path: tf_slim/metrics/histogram_ops.py
# def auc_using_histogram(boolean_labels,
#                         scores,
#                         score_range,
#                         nbins=100,
#                         collections=None,
#                         check_shape=True,
#                         name=None):
# def _check_labels_and_scores(boolean_labels, scores, check_shape):
# def _make_auc_histograms(boolean_labels, scores, score_range, nbins):
# def _auc_hist_accumulate(hist_true, hist_false, nbins, collections):
# def _auc_convert_hist_to_auc(hist_true_acc, hist_false_acc, nbins):
# def _strict_1d_cumsum(tensor, len_tensor):


# Path: tf_slim/metrics/histogram_ops_test.py
import numpy as np
import tensorflow.compat.v1 as tf
from tf_slim.metrics import histogram_ops
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import test

# 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 histogram_ops."""
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 Strict1dCumsumTest(test.TestCase):
  """Test this private function."""

  def test_empty_tensor_returns_empty(self):
    with self.cached_session():
      tensor = constant_op.constant([])

      result = histogram_ops._strict_1d_cumsum(tensor, 0)