update to repeatTensor to do in-place creation of the result tensor

1. extend repeat tensor to allow in-place create of the result tensor.

2. make repeat tensor more efficient by creating a view to the input
data if it is contiguous, instead of copying the data.