Cuda

This series of commits adds a number of missing operations for cuda tensors. Additionally it extends the logicals for non-cuda tensors to allow writing the results into a non-ByteTensor.