open3d.core.HashSet#
- class open3d.core.HashSet#
A HashSet is an unordered set of keys wrapped by Tensors.
- __init__(self: open3d.core.HashSet, init_capacity: int, key_dtype: open3d.core.Dtype, key_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.
(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.
- active_buf_indices(self: open3d.core.HashSet) open3d.core.Tensor #
Get the buffer indices corresponding to active entries in the hash set.
- capacity(self: open3d.core.HashSet) int #
Get the capacity of the hash set.
- clone(self: open3d.core.HashSet) open3d.core.HashSet #
Clone the hash set, including the data structure and the data buffers.
- cpu(self: open3d.core.HashSet) open3d.core.HashSet #
Transfer the hash set to CPU. If the hash set is already on CPU, no copy will be performed.
- cuda(self: open3d.core.HashSet, device_id: int = 0) open3d.core.HashSet #
Transfer the hash set to a CUDA device. If the hash set 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.HashSet
- erase(self: open3d.core.HashSet, 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.HashSet, 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(self: open3d.core.HashSet, keys: open3d.core.Tensor) tuple #
Insert 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
- key_tensor(self: open3d.core.HashSet) open3d.core.Tensor #
Get the key tensor stored in the buffer.
- static load(file_name: str) open3d.core.HashSet #
Load a hash set from a .npz file.
- Parameters:
file_name (str) – File name of the corresponding .npz file.
- Returns:
open3d.core.HashSet
- reserve(self: open3d.core.HashSet, capacity: int) None #
Reserve the hash set given the capacity.
- Parameters:
capacity (int) – New capacity for rehashing.
- Returns:
None
- save(self: open3d.core.HashSet, file_name: str) None #
Save the hash set into a .npz file.
- Parameters:
file_name (str) – File name of the corresponding .npz file.
- Returns:
None
- size(self: open3d.core.HashSet) int #
Get the size of the hash set.
- to(self: open3d.core.HashSet, device: open3d.core.Device, copy: bool = False) open3d.core.HashSet #
Convert the hash set 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.HashSet
- property device#
- property is_cpu#
- property is_cuda#