if x is a Tensor, then x > 0 will return a ByteTensor with value 1 where x[i] > 0 and value 0 where x[i] <= 0.

x if (x > 0).numpy() else x-1

In this case, is x a Tensor? If x is part of the graph, it has to be a Variable.
Can you elaborate a bit more on what exactly you are trying to do?