Hello,
Imagine the following simple function that result depend on an optional arg
def fnt(a,b,c=None):
  if c != None:
    res = a+b+c
  else:
   res = a+b
 return res

The point is that if cis set to a torch tensor as aand `b, then an exception is rised.
TypeError: ne() received an invalid combination of arguments - got (NoneType), but expected one of:
 * (Tensor other)
      didn't match because some of the arguments have invalid types: (NoneType)
 * (Number other)
      didn't match because some of the arguments have invalid types: (NoneType)

Do you know how to manage the possibility to get c as option?
(nb. I have swap the if condition according to @Deepali suggestion even if the problem remains)