Returns a tensor with its size changed.