code: def test_transinv_to_invtrans():
      X = tensor.matrix("X")
      Y = tensor.nlinalg.matrix_inverse(X)
      Z = Y.transpose()
      f = theano.function([X], Z)
      if config.mode != "FAST_COMPILE":
          for node in f.maker.fgraph.toposort():
              if isinstance(node.op, MatrixInverse):
                  assert isinstance(node.inputs[0].owner.op, DimShuffle)
              if isinstance(node.op, DimShuffle):
                  assert node.inputs[0].name == "X"
  
file_path: Theano/theano/sandbox/linalg/tests/test_linalg.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import numpy.linalg
  import theano
  from theano import tensor, function
  from theano.tensor.basic import _allclose
  from theano.tests.test_rop import break_op
  from theano.tests import unittest_tools
  from theano import config
  from theano.tensor.nlinalg import MatrixInverse
  from theano.tensor import DimShuffle
  from theano.sandbox.linalg.ops import Cholesky, matrix_inverse, Solve, solve, spectral_radius_bound, imported_scipy, inv_as_solve
  from nose.plugins.skip import SkipTest
label_desc: Use image node_id 3 for calling a global function with example usage: test_transinv_to_invtrans() without return types