Exemplo n.º 1
0
 def test_forward_log_det_jacobian(self):
     exe = paddle.static.Executor()
     sp = paddle.static.Program()
     mp = paddle.static.Program()
     with paddle.static.program_guard(mp, sp):
         x = paddle.ones(self.in_event_shape)
         t = transform.ReshapeTransform(self.in_event_shape,
                                        self.out_event_shape)
         output = self._t.forward_log_det_jacobian(x)
     exe.run(sp)
     [output] = exe.run(mp, feed={}, fetch_list=[output])
     expected = np.zeros([1])
     np.testing.assert_allclose(output,
                                expected,
                                rtol=config.RTOL.get(str(expected.dtype)),
                                atol=config.ATOL.get(str(expected.dtype)))
Exemplo n.º 2
0
 def setUp(self):
     self._t = transform.ReshapeTransform(self.in_event_shape,
                                          self.out_event_shape)