code: def test_lop_override(self, cls_ofg):
      x = T.vector()
      y = 1.0 / (1.0 + T.exp(-x))
  
      def lop_ov(inps, outs, grads):
          (y_,) = outs
          (dedy_,) = grads
          return [2.0 * y_ * (1.0 - y_) * dedy_]
  
      y_, dedy = T.vector(), T.vector()
      op_lop_ov = cls_ofg([x, y_, dedy], [2.0 * y_ * (1.0 - y_) * dedy])
  
      xx = T.vector()
      yy1 = T.sum(T.nnet.sigmoid(xx))
      gyy1 = 2.0 * T.grad(yy1, xx)
  
      for ov in [lop_ov, op_lop_ov]:
          op = cls_ofg([x], [y], lop_overrides=ov)
          yy2 = T.sum(op(xx))
          gyy2 = T.grad(yy2, xx)
          fn = function([xx], [gyy1, gyy2])
  
          xval = np.random.rand(32).astype(config.floatX)
          y1val, y2val = fn(xval)
          assert np.allclose(y1val, y2val)
  
imports: from __future__ import absolute_import, print_function, division
  from functools import partial
  import numpy
  import theano
  from theano import config, shared
  from theano.gradient import DisconnectedType
  from theano.gof.null_type import NullType
  from theano.compile import function
  from theano import tensor
  from theano.tensor.shared_randomstreams import RandomStreams
  from theano.compile.builders import OpFromGraph
  from theano.tests import unittest_tools
label_desc: Use image node_id 8 for calling the T_OpFromGraph obj's underlying member method code with example usage: obj.test_lop_override(cls_ofg) and returns: list