Cannot convert tensor_hash code to any integer

The following program was generated by googles AI:

#include <torch/torch.h>
#include <iostream>

int main() {
    // Create a dummy tensor
    torch::Tensor a = torch::randn({1, 3});
    
    // Hash the elements of the tensor
    torch::Tensor hashed = torch::hash_tensor(a);
    
    // Extract the hash value as a 64-bit unsigned integer
    uint64_t hash_value = hashed.item<uint64_t>();
    
    std::cout << "Tensor Hash: " << hash_value << std::endl;
}

When I try to compile and link it I get

undefined reference to `unsigned long at::Tensor::item<unsigned long>() const'

If I change uint64_t to int64_t in the program above it compiles and links fine but I get the error

terminate called after throwing an instance of 'std::runtime_error'
  what():  value cannot be converted to type int64_t without overflow

The following program demonstrates one possible solution:

#include <torch/torch.h>
#include <iostream>

int main() {
    // a_ten
    at::Tensor  a_ten          = torch::tensor( { 1.0, 2.0 } );
    at::Tensor  a_hash         = torch::hash_tensor(a_ten);
    uint64_t*   a_hash_ptr     = a_hash.data_ptr<uint64_t>();
    std::cout << "a_hash scalar type = " << c10::toString( a_hash.scalar_type() ) << "\n";
    std::cout << "a_hash_value = " << *a_hash_ptr << std::endl;
    //
    // b_ten
    at::Tensor  b_ten          = torch::tensor( { 1.0, 2.0, 3.0 } );
    at::Tensor  b_hash         = torch::hash_tensor(b_ten);
    uint64_t*   b_hash_ptr     = b_hash.data_ptr<uint64_t>();
    std::cout << "b_hash_value = " << *b_hash_ptr << std::endl;
    //
    // c_ten
    at::Tensor  c_ten          = torch::tensor( { 1.0, 2.0, 3.0 } );
    at::Tensor  c_hash         = torch::hash_tensor(c_ten);
    uint64_t*   c_hash_ptr     = c_hash.data_ptr<uint64_t>();
    std::cout << "c_hash_value = " << *c_hash_ptr << std::endl;
    //
}

The output I get for this program is

a_hash scalar type = UInt64
a_hash_value = 9218868437227405312
b_hash_value = 4609434218613702656
c_hash_value = 4609434218613702656