def as_sparse_or_tensor_variable(x, name=None):
 try:
  return as_sparse_variable(x, name)
 except (ValueError, TypeError):
  return theano.tensor.as_tensor_variable(x, name)

def as_sparse_or_tensor_variable ( x , name = None ) : try : return as_sparse_variable ( x , name ) except ( ValueError , TypeError ) : return theano . tensor . as_tensor_variable ( x , name )
same as as_sparse_variable but if we cant make a sparse variable .