From dev-return-5577-archive-asf-public=cust-asf.ponee.io@singa.apache.org Tue Jun 2 02:23:39 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 EC47A1804BB for ; Tue, 2 Jun 2020 04:23:38 +0200 (CEST) Received: (qmail 75333 invoked by uid 500); 2 Jun 2020 02:23:38 -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 75321 invoked by uid 99); 2 Jun 2020 02:23:38 -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, 02 Jun 2020 02:23:38 +0000 From: =?utf-8?q?GitBox?= To: dev@singa.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bsinga=5D_nudles_commented_on_a_change_in_pull_requ?= =?utf-8?q?est_=23697=3A_New_Model_Layer_Operator_API?= Message-ID: <159106461815.10999.16130755609764611050.asfpy@gitbox.apache.org> Date: Tue, 02 Jun 2020 02:23:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: nudles commented on a change in pull request #697: URL: https://github.com/apache/singa/pull/697#discussion_r433585960 ########## File path: examples/cnn/model/resnet.py ########## @@ -21,30 +21,31 @@ # https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py from singa import autograd -from singa import module +from singa import layer +from singa import model def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" - return autograd.Conv2d( + return layer.Conv2d( in_planes, out_planes, - kernel_size=3, + 3, stride=stride, padding=1, bias=False, ) -class BasicBlock(autograd.Layer): +class BasicBlock(layer.Layer): expansion = 1 def __init__(self, inplanes, planes, stride=1, downsample=None): super(BasicBlock, self).__init__() self.conv1 = conv3x3(inplanes, planes, stride) - self.bn1 = autograd.BatchNorm2d(planes) + self.bn1 = layer.BatchNorm2d(planes) Review comment: I think that is more consistent. otherwise, it is a bit confusing when to use autograd.xx and when to use layer.xxx ---------------------------------------------------------------- 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