def test_local_mul_s_d(): mode = theano.compile.mode.get_default_mode() mode = mode.including("specialize", "local_mul_s_d") for sp_format in sparse.sparse_formats: inputs = [getattr(theano.sparse, sp_format + '_matrix')(), tensor.matrix()] f = theano.function(inputs, sparse.mul_s_d(*inputs), mode=mode) assert not any(isinstance(node.op, sparse.MulSD) for node in f.maker.fgraph.toposort())
def test_local_mul_s_d(): if not theano.config.cxx: raise SkipTest("G++ not available, so we need to skip this test.") mode = theano.compile.mode.get_default_mode() mode = mode.including("specialize", "local_mul_s_d") for sp_format in sparse.sparse_formats: inputs = [getattr(theano.sparse, sp_format + '_matrix')(), tensor.matrix()] f = theano.function(inputs, sparse.mul_s_d(*inputs), mode=mode) assert not any(isinstance(node.op, sparse.MulSD) for node in f.maker.fgraph.toposort())