From commits-return-29834-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Mon Apr 2 01:08:13 2018 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 29C55180634 for ; Mon, 2 Apr 2018 01:08:13 +0200 (CEST) Received: (qmail 5201 invoked by uid 500); 1 Apr 2018 23:08:12 -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 5192 invoked by uid 99); 1 Apr 2018 23:08:12 -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; Sun, 01 Apr 2018 23:08:12 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] piiswrong commented on a change in pull request #10351: [MXNET-259] Performance improvement of random.shuffle Message-ID: <152262409167.28097.14933044761732720915.gitbox@gitbox.apache.org> Date: Sun, 01 Apr 2018 23:08:11 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit piiswrong commented on a change in pull request #10351: [MXNET-259] Performance improvement of random.shuffle URL: https://github.com/apache/incubator-mxnet/pull/10351#discussion_r178471176 ########## File path: src/operator/random/shuffle_op.cc ########## @@ -55,18 +56,24 @@ void Shuffle1D(DType* const out, const index_t size, Rand* const prnd) { template void ShuffleND(DType* const out, const index_t size, const index_t first_axis_len, - Rand* const prnd) { + Rand* const prnd, const OpContext& ctx) { // Fisher-Yates shuffling + using namespace mxnet_op; const index_t stride = size / first_axis_len; auto rand_n = [prnd](index_t n) { std::uniform_int_distribution dist(0, n - 1); return dist(*prnd); }; CHECK_GT(first_axis_len, 0U); + const size_t stride_bytes = sizeof(DType) * stride; + Tensor buf = + ctx.requested[1].get_space_typed(Shape1(stride_bytes), ctx.get_stream()); Review comment: I think you need to add Fresources to operator registration? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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