Added tensor::max and tensor::min to extract the maximum and minimum elements