From dev-return-3092-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Thu Aug 1 12:13:49 2019 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 58120180644 for ; Thu, 1 Aug 2019 14:13:49 +0200 (CEST) Received: (qmail 60763 invoked by uid 500); 1 Aug 2019 12:13:48 -0000 Mailing-List: contact dev-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list dev@singa.incubator.apache.org Received: (qmail 60750 invoked by uid 99); 1 Aug 2019 12:13:48 -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; Thu, 01 Aug 2019 12:13:48 +0000 From: GitBox To: dev@singa.apache.org Subject: [GitHub] [incubator-singa] joddiy commented on a change in pull request #483: SINGA-474 identity operator Message-ID: <156466162820.5420.15167787698232223330.gitbox@gitbox.apache.org> Date: Thu, 01 Aug 2019 12:13:48 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit joddiy commented on a change in pull request #483: SINGA-474 identity operator URL: https://github.com/apache/incubator-singa/pull/483#discussion_r309664724 ########## File path: test/python/test_operation.py ########## @@ -322,6 +322,27 @@ def test_LeakyRelu(self): np.testing.assert_array_almost_equal(tensor.to_numpy(result), XT) self.check_shape(dx.shape(), (3, 2)) + def test_Identity_cpu(self): + x = np.array([-0.9, -0.3, -0.1, 0.1, 0.5, 0.9]).reshape(3, 2).astype(np.float32) + y = x.copy() + x = tensor.from_numpy(x) + x.to_device(cpu_dev) + result = autograd.identity(x) + dx = result.creator.backward(x.data) + + np.testing.assert_array_almost_equal(tensor.to_numpy(result), y, decimal=5) Review comment: please add the test case of backward propagation. ---------------------------------------------------------------- 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