(self, function, sz)
| 1876 | seeds = range(4) |
| 1877 | |
| 1878 | def check_function(self, function, sz): |
| 1879 | from threading import Thread |
| 1880 | |
| 1881 | out1 = np.empty((len(self.seeds),) + sz) |
| 1882 | out2 = np.empty((len(self.seeds),) + sz) |
| 1883 | |
| 1884 | # threaded generation |
| 1885 | t = [Thread(target=function, args=(random.RandomState(s), o)) |
| 1886 | for s, o in zip(self.seeds, out1)] |
| 1887 | [x.start() for x in t] |
| 1888 | [x.join() for x in t] |
| 1889 | |
| 1890 | # the same serial |
| 1891 | for s, o in zip(self.seeds, out2): |
| 1892 | function(random.RandomState(s), o) |
| 1893 | |
| 1894 | # these platforms change x87 fpu precision mode in threads |
| 1895 | if np.intp().dtype.itemsize == 4 and sys.platform == "win32": |
| 1896 | assert_array_almost_equal(out1, out2) |
| 1897 | else: |
| 1898 | assert_array_equal(out1, out2) |
| 1899 | |
| 1900 | def test_normal(self): |
| 1901 | def gen_random(state, out): |
no test coverage detected