Make element-wise unary operators more consistent with Torch.

Added versions with two arguments of many unary operators to allow not-in-place
operations.
Made 'sign' and 'pow' operator resize the target tensor if necessary.
Added tests for all operators.