code: def _hash(arr, M):
      if isinstance(arr, np.ndarray):
          N, D = arr.shape
      else:
          N, D = len(arr[0]), len(arr)
  
      hash_vec = np.zeros(N, dtype=np.int64)
      for d in range(D):
          if isinstance(arr, np.ndarray):
              hash_vec += arr[:, d] * M**d
          else:
              hash_vec += arr[d] * M**d
      return hash_vec
  
file_path: torch-points3d/torch_points3d/core/losses/metric_losses.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _hash(arr, M) and returns: hash_vec