From dev-return-5108-archive-asf-public=cust-asf.ponee.io@singa.apache.org Sun Apr 12 06:13:23 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 9B725180608 for ; Sun, 12 Apr 2020 08:13:23 +0200 (CEST) Received: (qmail 72020 invoked by uid 500); 12 Apr 2020 06:13:23 -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 72005 invoked by uid 99); 12 Apr 2020 06:13:22 -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, 12 Apr 2020 06:13:22 +0000 From: GitBox To: dev@singa.apache.org Subject: [GitHub] [singa] XJDKC commented on issue #674: Autograd Layer constructor Message-ID: <158667200282.24527.921557438208799436.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Sun, 12 Apr 2020 06:13:22 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit XJDKC commented on issue #674: Autograd Layer constructor URL: https://github.com/apache/singa/issues/674#issuecomment-612569864 > > I think the Module class is quite similar to Layer, we can think about combining them together. At present, users can't get params from the Module, they can only get them from the Layer. If the Layer class is the subclass of Module, this problem will be solved. > > Yes, when we buffer the ops, there won't be any actual run, but all the parameters size will be obtained after the call function. > > > > I think the Module class is quite similar to Layer, we can think about combining them together. At present, users can't get params from the Module, they can only get them from the Layer. If the Layer class is the subclass of Module, this problem will be solved. > > > > > > > > > Yes, when we buffer the ops, there won't be any actual run, but all the parameters size will be obtained after the call function. > > > > > > After calling the constructor of Layer class. > > Constructor might not be enough, because in the case of RNN the CudnnRNNHandle.weight_size is inferred from the input size. So this can only be obtained from the forward function. FYI, this is the new Shicong's code in his PR (I guess this issue is for solving this PR problem): > https://github.com/apache/singa/blob/19f2020fda36032fdc26dc5910dacbfcff638e7f/python/singa/autograd.py#L3406 Sorry, I haven't checked the newest code. Handles in the past code like ConvHandle are initialized in the constructor, so I thought CudnnRNNHandle was the same. ---------------------------------------------------------------- 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