Пример #1
0
 def test_log(self):
     a = Variable(1.5)
     c = a.log()
     c.backward()
     self.assertAlmostEqual(c.value, log(1.5))
     self.assertAlmostEqual(a.d.value, 1 / 1.5)
Пример #2
0
 def test_log(self):
     a = Variable(1.5)
     c = a.log()
     self.assertAlmostEqual(c.value, log(1.5))