Exemplo n.º 1
0
    def testLinspaceExecution(self):
        a = linspace(2.0, 9.0, num=11, chunk_size=3)

        res = self.executor.execute_tensor(a, concat=True)[0]
        expected = np.linspace(2.0, 9.0, num=11)
        np.testing.assert_allclose(res, expected)

        a = linspace(2.0, 9.0, num=11, endpoint=False, chunk_size=3)

        res = self.executor.execute_tensor(a, concat=True)[0]
        expected = np.linspace(2.0, 9.0, num=11, endpoint=False)
        np.testing.assert_allclose(res, expected)

        a = linspace(2.0, 9.0, num=11, chunk_size=3, dtype=int)

        res = self.executor.execute_tensor(a, concat=True)[0]
        self.assertEqual(res.dtype, np.int_)
Exemplo n.º 2
0
def test_linspace_execution(setup):
    a = linspace(2.0, 9.0, num=11, chunk_size=3)

    res = a.execute().fetch()
    expected = np.linspace(2.0, 9.0, num=11)
    np.testing.assert_allclose(res, expected)

    a = linspace(2.0, 9.0, num=11, endpoint=False, chunk_size=3)

    res = a.execute().fetch()
    expected = np.linspace(2.0, 9.0, num=11, endpoint=False)
    np.testing.assert_allclose(res, expected)

    a = linspace(2.0, 9.0, num=11, chunk_size=3, dtype=int)

    res = a.execute().fetch()
    assert res.dtype == np.int_