def get_scalar_constant_value(v):
 if (('sparse' in globals()) and isinstance(v.type, sparse.SparseType)):
  if ((v.owner is not None) and isinstance(v.owner.op, sparse.CSM)):
   data = v.owner.inputs[0]
   return tensor.get_scalar_constant_value(data)
 return tensor.get_scalar_constant_value(v)

def get_scalar_constant_value ( v ) : if ( ( 'sparse' in globals ( ) ) and isinstance ( v . type , sparse . SparseType ) ) : if ( ( v . owner is not None ) and isinstance ( v . owner . op , sparse . CSM ) ) : data = v . owner . inputs [ 0 ] return tensor . get_scalar_constant_value ( data ) return tensor . get_scalar_constant_value ( v )
return the constant scalar value underlying variable v if v is the output of dimshuffles .