I think data is templated member so I would suggest using .data<int>()
auto temp_tensor = torch::randn({ 3, 4 }).to(torch::kInt32);

int* temp_arr = temp_tensor.data<int>();
		
// alternative
//int* temp_arr = (int*)temp_tensor.data_ptr();

for (int y = 0; y < temp_tensor.sizes()[0]; ++y)
{
	for (int x = 0; x < temp_tensor.sizes()[1]; ++x)
	{
	    std::cout << (*temp_arr++) << " ";
	}

	std::cout << std::endl;
}

std::cout << temp_tensor << std::endl;