From commits-return-29850-apmail-mxnet-commits-archive=mxnet.apache.org@mxnet.incubator.apache.org Sun Apr 1 23:41:58 2018 Return-Path: X-Original-To: apmail-mxnet-commits-archive@minotaur.apache.org Delivered-To: apmail-mxnet-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D665317A4A for ; Sun, 1 Apr 2018 23:41:58 +0000 (UTC) Received: (qmail 42988 invoked by uid 500); 1 Apr 2018 23:41:57 -0000 Delivered-To: apmail-mxnet-commits-archive@mxnet.apache.org Received: (qmail 42957 invoked by uid 500); 1 Apr 2018 23:41:57 -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 42948 invoked by uid 99); 1 Apr 2018 23:41:57 -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:41:57 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] szha commented on a change in pull request #10347: [MXNET-257] Do not copy when casting as same type Message-ID: <152262611687.16910.15966223998753435864.gitbox@gitbox.apache.org> Date: Sun, 01 Apr 2018 23:41:56 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit szha commented on a change in pull request #10347: [MXNET-257] Do not copy when casting as same type URL: https://github.com/apache/incubator-mxnet/pull/10347#discussion_r178471936 ########## File path: python/mxnet/ndarray/sparse.py ########## @@ -179,19 +179,27 @@ def asnumpy(self): """ return self.tostype('default').asnumpy() - def astype(self, dtype): + def astype(self, dtype, copy=True): """Returns a copy of the array after casting to a specified type. Parameters ---------- dtype : numpy.dtype or str The type of the returned array. + copy : bool + Default `True`. By default, astype always returns a newly + allocated ndarray on the same context. If this is set to + False, and the dtype requirement is satisfied, Review comment: It's unclear what the `dtype requirement` here is from the doc. Please fix. ---------------------------------------------------------------- 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