code: def test_local_dense_from_sparse_sparse_from_dense():
      mode = theano.compile.mode.get_default_mode()
      mode = mode.including("local_dense_from_sparse_sparse_from_dense")
  
      m = theano.tensor.matrix()
      for op in [
          theano.sparse.csr_from_dense,
          theano.sparse.csc_from_dense,
      ]:
          s = op(m)
          o = theano.sparse.dense_from_sparse(s)
          f = theano.function([m], o, mode=mode)
          # We should just have a deep copy.
          assert len(f.maker.fgraph.apply_nodes) == 1
          f([[1, 2], [3, 4]])
  
file_path: Theano/theano/sparse/tests/test_opt.py
imports: from __future__ import absolute_import, print_function, division
  from nose.plugins.skip import SkipTest
  import numpy
  import theano
  from theano import sparse, config, tensor
  from theano.sparse import enable_sparse
  from theano.tests import unittest_tools
  from theano.sparse.tests.test_basic import random_lil
label_desc: Use image node_id 7 for calling a global function with example usage: test_local_dense_from_sparse_sparse_from_dense() without return types