Fixed Tensor::dimensions() for CUDA.
Fixed "dynamic initialization is not supported for a function-scope static device variable within a device/global function" in tensor by reverting the changes in commit 19e6496c. Tensors may be used in CUDA once again.
@lambdaknight Please refrain from changes which break existing code.