Exemplo n.º 1
0
 def test_infer_shape(self):
     for format in sparse.sparse_formats:
         self._compile_and_check(
             [self.x[format]],
             [poisson(self.x[format])],
             [self.a[format]],
             self.op_class,
         )
Exemplo n.º 2
0
    def test_op(self):
        for format in sparse.sparse_formats:
            f = theano.function([self.x[format]], poisson(self.x[format]))

            tested = f(self.a[format])

            assert tested.format == format
            assert tested.dtype == self.a[format].dtype
            assert np.allclose(np.floor(tested.data), tested.data)
            assert tested.shape == self.a[format].shape
Exemplo n.º 3
0
    def test_op(self):
        for format in sparse.sparse_formats:
            f = theano.function([self.x[format]], poisson(self.x[format]))

            tested = f(self.a[format])

            assert tested.format == format
            assert tested.dtype == self.a[format].dtype
            assert numpy.allclose(numpy.floor(tested.data), tested.data)
            assert tested.shape == self.a[format].shape
Exemplo n.º 4
0
 def test_infer_shape(self):
     for format in sparse.sparse_formats:
         self._compile_and_check([self.x[format]],
                                 [poisson(self.x[format])],
                                 [self.a[format]],
                                 self.op_class)