Use clamp_min !
#include <torch/torch.h>
#include <iostream>

int main(){
	torch::Tensor features = torch::randn({2, 3});
	std::cout << "Tensor before clipping: " << std::endl << features << std::endl;
	features.clamp_min_(0);
	std::cout << "Tensor after clipping: " << std::endl << features << std::endl;
	return 0;
}