def arg_of_sigmoid(Y_hat):
 assert hasattr(Y_hat, 'owner')
 owner = Y_hat.owner
 assert (owner is not None)
 op = owner.op
 if isinstance(op, Print):
  assert (len(owner.inputs) == 1)
  (Y_hat,) = owner.inputs
  owner = Y_hat.owner
  op = owner.op
 success = False
 if isinstance(op, T.Elemwise):
  if isinstance(op.scalar_op, T.nnet.sigm.ScalarSigmoid):
   success = True
 if (not success):
  raise TypeError(((('Expected Y_hat to be the output of a sigmoid, but it appears to be the output of ' + str(op)) + ' of type ') + str(type(op))))
 (z,) = owner.inputs
 assert (z.ndim == 2)
 return z

def arg_of_sigmoid ( Y_hat ) : assert hasattr ( Y_hat , 'owner' ) owner = Y_hat . owner assert ( owner is not None ) op = owner . op if isinstance ( op , Print ) : assert ( len ( owner . inputs ) == 1 ) ( Y_hat , ) = owner . inputs owner = Y_hat . owner op = owner . op success = False if isinstance ( op , T . Elemwise ) : if isinstance ( op . scalar_op , T . nnet . sigm . ScalarSigmoid ) : success = True if ( not success ) : raise TypeError ( ( ( ( 'Expected Y_hat to be the output of a sigmoid, but it appears to be the output of ' + str ( op ) ) + ' of type ' ) + str ( type ( op ) ) ) ) ( z , ) = owner . inputs assert ( z . ndim == 2 ) return z
given the output of a call to theano .