From dev-return-5787-archive-asf-public=cust-asf.ponee.io@singa.apache.org Tue Jun 16 07:20:53 2020 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id B3E49180621 for ; Tue, 16 Jun 2020 09:20:52 +0200 (CEST) Received: (qmail 64039 invoked by uid 500); 16 Jun 2020 07:20:52 -0000 Mailing-List: contact dev-help@singa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.apache.org Delivered-To: mailing list dev@singa.apache.org Received: (qmail 64010 invoked by uid 99); 16 Jun 2020 07:20:52 -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; Tue, 16 Jun 2020 07:20:52 +0000 From: =?utf-8?q?GitBox?= To: dev@singa.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bsinga=5D_joddiy_commented_on_a_change_in_pull_requ?= =?utf-8?q?est_=23736=3A_Add_expand_operator?= Message-ID: <159229205206.8807.2350328505586726588.asfpy@gitbox.apache.org> Date: Tue, 16 Jun 2020 07:20:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: joddiy commented on a change in pull request #736: URL: https://github.com/apache/singa/pull/736#discussion_r440637288 ########## File path: python/singa/autograd.py ########## @@ -4698,6 +4698,103 @@ def cossim(a, b): return CosSim()(a, b)[0] +class Expand(Operator): + """ + Init a expand operator Review comment: I've added an example usage at the comment. The `expand` duplicates the data along with the axis. It looks like `upsample` but still has some differences. > Example usage:: data = [[1.], [2.], [3.]] # dim_changed shape = [2, 1, 6] output = [[[1., 1., 1., 1., 1., 1.], [2., 2., 2., 2., 2., 2.], [3., 3., 3., 3., 3., 3.]], [[1., 1., 1., 1., 1., 1.], [2., 2., 2., 2., 2., 2.], [3., 3., 3., 3., 3., 3.]]] # dim_unchanged shape = [3, 4] output = [[1., 1., 1., 1.], [2., 2., 2., 2.], [3., 3., 3., 3.]] > For upsample > Example usage:: data = [[[[1, 2], [3, 4],]]] # nearest scales = [1.0, 1.0, 2.0, 3.0] output = [[[[1, 1, 1, 2, 2, 2], [1, 1, 1, 2, 2, 2], [3, 3, 3, 4, 4, 4], [3, 3, 3, 4, 4, 4],]]] > ---------------------------------------------------------------- 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