From commits-return-76622-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Mon Mar 4 07:22:18 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id AF54F18067C for ; Mon, 4 Mar 2019 08:22:17 +0100 (CET) Received: (qmail 96759 invoked by uid 500); 4 Mar 2019 07:22:16 -0000 Mailing-List: contact commits-help@mxnet.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mxnet.incubator.apache.org Delivered-To: mailing list commits@mxnet.incubator.apache.org Received: (qmail 96750 invoked by uid 99); 4 Mar 2019 07:22:16 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Mar 2019 07:22:16 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] [incubator-mxnet] szha commented on a change in pull request #14314: support long for mx.random.seed Message-ID: <155168413608.14189.14028980467156445885.gitbox@gitbox.apache.org> Date: Mon, 04 Mar 2019 07:22:16 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit szha commented on a change in pull request #14314: support long for mx.random.seed URL: https://github.com/apache/incubator-mxnet/pull/14314#discussion_r261943116 ########## File path: tests/python/unittest/test_random.py ########## @@ -717,12 +717,24 @@ def test_random_seed(): shape = (5, 5) seed = rnd.randint(-(1 << 31), (1 << 31)) mx.random.seed(seed) - v1 = mx.nd.random_uniform(shape=shape) + + def _assert_same_mx_arrays(a, b): + assert len(a) == len(b) + for a_i, b_i in zip(a, b): + assert (a_i.asnumpy() == b_i.asnumpy()).all() + + N = 100 + v1 = [mx.nd.random_uniform(shape=shape) for _ in range(N)] Review comment: nit: `mx.random.uniform` is the preferred way now. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services