open3d.core.HashMap#

class open3d.core.HashMap#

A HashMap is an unordered map from key to value wrapped by Tensors.

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: open3d.core.HashMap, init_capacity: int, key_dtype: open3d.core.Dtype, key_element_shape: open3d.core.SizeVector, value_dtype: open3d.core.Dtype, value_element_shape: open3d.core.SizeVector, device: open3d.core.Device = CPU:0) -> None

Parameters:
  • init_capacity (int) – Initial capacity of a hash container.

  • key_dtype (open3d.core.Dtype) – Data type for the input key tensor.

  • key_element_shape (open3d.core.SizeVector) – Element shape for the input key tensor. E.g. (3) for 3D coordinate keys.

  • value_dtype (open3d.core.Dtype) – Data type for the input value tensor.

  • value_element_shape (open3d.core.SizeVector) – Element shape for the input value tensor. E.g. (1) for mapped index.

  • (open3d.core.Device (device) – 0): Compute device to store and operate on the hash container.

  • optional – 0): Compute device to store and operate on the hash container.

  • default=CPU – 0): Compute device to store and operate on the hash container.

  1. __init__(self: open3d.core.HashMap, init_capacity: int, key_dtype: open3d.core.Dtype, key_element_shape: open3d.core.SizeVector, value_dtypes: list[open3d.core.Dtype], value_element_shapes: list[open3d.core.SizeVector], device: open3d.core.Device = CPU:0) -> None

Parameters:
  • init_capacity (int) – Initial capacity of a hash container.

  • key_dtype (open3d.core.Dtype) – Data type for the input key tensor.

  • key_element_shape (open3d.core.SizeVector) – Element shape for the input key tensor. E.g. (3) for 3D coordinate keys.

  • value_dtypes (list[open3d.core.Dtype]) – List of data type for the input value tensors.

  • value_element_shapes (list[open3d.core.SizeVector]) – List of element shapes for the input value tensors. E.g. ((8,8,8,1), (8,8,8,3)) for mapped weights and RGB colors stored in 8^3 element arrays.

  • (open3d.core.Device (device) – 0): Compute device to store and operate on the hash container.

  • optional – 0): Compute device to store and operate on the hash container.

  • default=CPU – 0): Compute device to store and operate on the hash container.

activate(self: open3d.core.HashMap, keys: open3d.core.Tensor) tuple#

Activate an array of keys stored in Tensors without copying values.

Parameters:

keys (open3d.core.Tensor) – Input keys stored in a tensor of shape (N, key_element_shape).

Returns:

tuple

active_buf_indices(self: open3d.core.HashMap) open3d.core.Tensor#

Get the buffer indices corresponding to active entries in the hash map.

capacity(self: open3d.core.HashMap) int#

Get the capacity of the hash map.

clone(self: open3d.core.HashMap) open3d.core.HashMap#

Clone the hash map, including the data structure and the data buffers.

cpu(self: open3d.core.HashMap) open3d.core.HashMap#

Transfer the hash map to CPU. If the hash map is already on CPU, no copy will be performed.

cuda(self: open3d.core.HashMap, device_id: int = 0) open3d.core.HashMap#

Transfer the hash map to a CUDA device. If the hash map is already on the specified CUDA device, no copy will be performed.

Parameters:

device_id (int, optional, default=0) – Target CUDA device ID.

Returns:

open3d.core.HashMap

erase(self: open3d.core.HashMap, keys: open3d.core.Tensor) open3d.core.Tensor#

Erase an array of keys stored in Tensors.

Parameters:

keys (open3d.core.Tensor) – Input keys stored in a tensor of shape (N, key_element_shape).

Returns:

open3d.core.Tensor

find(self: open3d.core.HashMap, keys: open3d.core.Tensor) tuple#

Find an array of keys stored in Tensors.

Parameters:

keys (open3d.core.Tensor) – Input keys stored in a tensor of shape (N, key_element_shape).

Returns:

tuple

insert(*args, **kwargs)#

Overloaded function.

  1. insert(self: open3d.core.HashMap, keys: open3d.core.Tensor, values: open3d.core.Tensor) -> tuple

    Insert an array of keys and an array of values stored in Tensors.

Parameters:
  • keys (open3d.core.Tensor) – Input keys stored in a tensor of shape (N, key_element_shape).

  • values (open3d.core.Tensor) – Input values stored in a tensor of shape (N, value_element_shape).

Returns:

tuple

  1. insert(self: open3d.core.HashMap, keys: open3d.core.Tensor, list_values: list[open3d.core.Tensor]) -> tuple

    Insert an array of keys and a list of value arrays stored in Tensors.

Parameters:
  • keys (open3d.core.Tensor) – Input keys stored in a tensor of shape (N, key_element_shape).

  • list_values (list[open3d.core.Tensor]) – List of input values stored in tensors of corresponding shapes.

Returns:

tuple

key_tensor(self: open3d.core.HashMap) open3d.core.Tensor#

Get the key tensor stored in the buffer.

static load(file_name: str) open3d.core.HashMap#

Load a hash map from a .npz file.

Parameters:

file_name (str) – File name of the corresponding .npz file.

Returns:

open3d.core.HashMap

reserve(self: open3d.core.HashMap, capacity: int) None#

Reserve the hash map given the capacity.

Parameters:

capacity (int) – New capacity for rehashing.

Returns:

None

save(self: open3d.core.HashMap, file_name: str) None#

Save the hash map into a .npz file.

Parameters:

file_name (str) – File name of the corresponding .npz file.

Returns:

None

size(self: open3d.core.HashMap) int#

Get the size of the hash map.

to(self: open3d.core.HashMap, device: open3d.core.Device, copy: bool = False) open3d.core.HashMap#

Convert the hash map to a selected device.

Parameters:
  • device (open3d.core.Device) – Compute device to store and operate on the hash container.

  • copy (bool, optional, default=False) – If true, a new tensor is always created; if false, the copy is avoided when the original tensor already has the targeted dtype.

Returns:

open3d.core.HashMap

value_tensor(*args, **kwargs)#

Overloaded function.

  1. value_tensor(self: open3d.core.HashMap) -> open3d.core.Tensor

    Get the value tensor stored at index 0.

Returns:

open3d.core.Tensor

  1. value_tensor(self: open3d.core.HashMap, value_buffer_id: int) -> open3d.core.Tensor

    Get the value tensor stored at index i

Parameters:

value_buffer_id (int) –

Returns:

open3d.core.Tensor

value_tensors(self: open3d.core.HashMap) list[open3d.core.Tensor]#

Get the list of value tensors stored in the buffer.

property device#
property is_cpu#
property is_cuda#