示例#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,
         )
示例#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
示例#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
示例#4
0
文件: test_sp2.py 项目: 317070/Theano
 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)