import unittest
import numpy as np

from hindemith.types.common import Array
from hindemith.operations.optical_flow.reductions import *

class TestReductions(unittest.TestCase):
    def test_pure_python(self):
        x = Array('x',np.random.rand(100,100))
        sum = Sum(pure_python=True)
        min = Min(pure_python=True)
        max = Max(pure_python=True)
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail("Sum not equal! %s" % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail("Min not equal! %s" % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail("Max not equal! %s" % e.message)

    def test_specialized(self):
        x = Array('x',np.random.rand(100,100))
        sum = Sum()
        min = Min()
        max = Max()
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail("Sum not equal! %s" % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail("Min not equal! %s" % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail("Max not equal! %s" % e.message)
8d97d6067b939f3167a735a6bdd005547d3e3546
<mask token>


class TestReductions(unittest.TestCase):
    <mask token>
    <mask token>

<mask token>


class TestReductions(unittest.TestCase):
    <mask token>

    def test_specialized(self):
        x = Array('x', np.random.rand(100, 100))
        sum = Sum()
        min = Min()
        max = Max()
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail('Sum not equal! %s' % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail('Min not equal! %s' % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail('Max not equal! %s' % e.message)

<mask token>


class TestReductions(unittest.TestCase):

    def test_pure_python(self):
        x = Array('x', np.random.rand(100, 100))
        sum = Sum(pure_python=True)
        min = Min(pure_python=True)
        max = Max(pure_python=True)
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail('Sum not equal! %s' % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail('Min not equal! %s' % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail('Max not equal! %s' % e.message)

    def test_specialized(self):
        x = Array('x', np.random.rand(100, 100))
        sum = Sum()
        min = Min()
        max = Max()
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail('Sum not equal! %s' % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail('Min not equal! %s' % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail('Max not equal! %s' % e.message)

import unittest
import numpy as np
from hindemith.types.common import Array
from hindemith.operations.optical_flow.reductions import *


class TestReductions(unittest.TestCase):

    def test_pure_python(self):
        x = Array('x', np.random.rand(100, 100))
        sum = Sum(pure_python=True)
        min = Min(pure_python=True)
        max = Max(pure_python=True)
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail('Sum not equal! %s' % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail('Min not equal! %s' % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail('Max not equal! %s' % e.message)

    def test_specialized(self):
        x = Array('x', np.random.rand(100, 100))
        sum = Sum()
        min = Min()
        max = Max()
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail('Sum not equal! %s' % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail('Min not equal! %s' % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail('Max not equal! %s' % e.message)

import unittest
import numpy as np

from hindemith.types.common import Array
from hindemith.operations.optical_flow.reductions import *

class TestReductions(unittest.TestCase):
    def test_pure_python(self):
        x = Array('x',np.random.rand(100,100))
        sum = Sum(pure_python=True)
        min = Min(pure_python=True)
        max = Max(pure_python=True)
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail("Sum not equal! %s" % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail("Min not equal! %s" % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail("Max not equal! %s" % e.message)

    def test_specialized(self):
        x = Array('x',np.random.rand(100,100))
        sum = Sum()
        min = Min()
        max = Max()
        try:
            assert sum(x) == np.sum(x.data)
        except AssertionError as e:
            self.fail("Sum not equal! %s" % e.message)
        try:
            assert min(x) == np.min(x.data)
        except AssertionError as e:
            self.fail("Min not equal! %s" % e.message)
        try:
            assert max(x) == np.max(x.data)
        except AssertionError as e:
            self.fail("Max not equal! %s" % e.message)