code: def test_log1msigm_to_softplus(self):
      x = T.matrix()
  
      out = T.log(1 - sigmoid(x))
      f = theano.function([x], out, mode=self.m)
      topo = f.maker.fgraph.toposort()
      assert len(topo) == 2
      assert isinstance(
          topo[0].op.scalar_op, theano.tensor.nnet.sigm.ScalarSoftplus
      )
      assert isinstance(topo[1].op.scalar_op, theano.scalar.Neg)
      # assert check_stack_trace(f, ops_to_check='all')
      f(np.random.rand(54, 11).astype(config.floatX))
  
      # Same test with a flatten
      out = T.log(1 - T.flatten(sigmoid(x)))
      f = theano.function([x], out, mode=self.m)
  
      # assert check_stack_trace(f, ops_to_check='all')
      topo = f.maker.fgraph.toposort()
      assert len(topo) == 3
      assert tensor.is_flat(topo[0].outputs[0])
      assert isinstance(
          topo[1].op.scalar_op, theano.tensor.nnet.sigm.ScalarSoftplus
      )
      assert isinstance(topo[2].op.scalar_op, theano.scalar.Neg)
      f(np.random.rand(54, 11).astype(config.floatX))
  
      # Same test with a reshape
      out = T.log(1 - sigmoid(x).reshape([x.size]))
      f = theano.function([x], out, mode=self.m)
      topo = f.maker.fgraph.toposort()
      # assert len(topo) == 3
      assert any(isinstance(node.op, T.Reshape) for node in topo)
      assert any(
          isinstance(
              getattr(node.op, "scalar_op", None),
              theano.tensor.nnet.sigm.ScalarSoftplus,
          )
          for node in topo
      )
      f(np.random.rand(54, 11).astype(config.floatX))
  
imports: from __future__ import absolute_import, print_function, division
  import unittest
  import numpy
  from theano.compat import imap
  import theano.tensor.inplace
  from theano.tensor import basic
  from theano import tensor
  from theano import config
  from theano.gof.opt import check_stack_trace
  from theano.tests import unittest_tools
  from theano.tensor.nnet import sigmoid, sigmoid_inplace, softplus, ultra_fast_sigmoid, hard_sigmoid
  from theano.tensor.nnet.sigm import compute_mul, is_1pexp, parse_mul_tree, perform_sigm_times_exp, register_local_1msigmoid, simplify_mul
  from theano.tensor.tests.test_basic import makeBroadcastTester, copymod, check_floatX, upcast_int8_nfunc, _good_broadcast_unary_normal_no_complex
label_desc: Use image node_id 3 for calling the T_softplus_opts obj's underlying member method code with example usage: obj.test_log1msigm_to_softplus() without return types