Open3D (C++ API)  0.11.0
Data Structures | Enumerations | Functions
open3d::ml::impl Namespace Reference

Data Structures

class  Accumulator
 
class  AccumulatorBackprop
 
class  Adaptor
 Adaptor for nanoflann. More...
 
struct  InterpolationVec
 Class for computing interpolation weights. More...
 
struct  InterpolationVec< T, VECSIZE, InterpolationMode::LINEAR >
 Implementation for LINEAR (uses coordinate clamping) More...
 
struct  InterpolationVec< T, VECSIZE, InterpolationMode::LINEAR_BORDER >
 Implementation for LINEAR_BORDER (uses zero border instead of clamping) More...
 
struct  InterpolationVec< T, VECSIZE, InterpolationMode::NEAREST_NEIGHBOR >
 Implementation for NEAREST_NEIGHBOR. More...
 
class  MemoryAllocation
 A class for managing memory segments within a memory allocation. More...
 
struct  SelectNanoflannAdaptor
 
struct  SelectNanoflannAdaptor< L1, T >
 
struct  SelectNanoflannAdaptor< L2, T >
 

Enumerations

enum  InterpolationMode { InterpolationMode::LINEAR, InterpolationMode::LINEAR_BORDER, NEAREST_NEIGHBOR }
 
enum  CoordinateMapping { CoordinateMapping::BALL_TO_CUBE_RADIAL, CoordinateMapping::BALL_TO_CUBE_VOLUME_PRESERVING, CoordinateMapping::IDENTITY }
 
enum  Metric { L1, L2, Linf }
 Supported metrics. More...
 
enum  AccumulationFn {
  AVERAGE = 0, NEAREST_NEIGHBOR, NEAREST_NEIGHBOR, MAX,
  CENTER
}
 

Functions

template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE>
void _CConvComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, bool normalize)
 
template<class TReal , class TIndex >
void CConvComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE>
void _CConvBackropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient, bool normalize)
 
template<class TReal , class TIndex >
void CConvBackpropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class TReal , class TIndex >
void FillColumn (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class TReal , class TIndex >
void FillColumnTranspose (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_neighbors_importance_sum, const int64_t *const __restrict__ inp_neighbors_prefix_sum, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class T >
void MultiplyColumns (const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ col_major_matrix, const T *const __restrict__ vector)
 
template<class T >
void MultiplyAndCopyColumns (const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ out_ptr, const T *const __restrict__ col_major_matrix, const T *const __restrict__ vector)
 
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void _CConvTransposeComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets)
 
template<class TReal , class TIndex >
void CConvTransposeComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void _CConvTransposeBackpropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient)
 
template<class TReal , class TIndex >
void CConvTransposeBackpropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class T , int VECSIZE>
void MapSphereToCylinder (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z)
 
template<class T , int VECSIZE>
void MapCylinderToCube (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z)
 
template<bool ALIGN_CORNERS, CoordinateMapping MAPPING, class T , int VECSIZE>
void ComputeFilterCoordinates (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z, const Eigen::Array< int, 3, 1 > &filter_size, const Eigen::Array< T, VECSIZE, 3 > &inv_extents, const Eigen::Array< T, 3, 1 > &offset)
 
template<class T , class OUTPUT_ALLOCATOR >
void FixedRadiusSearchCPU (int64_t *query_neighbors_row_splits, const size_t num_points, const T *const points, const size_t num_queries, const T *const queries, const T radius, const size_t points_row_splits_size, const int64_t *const points_row_splits, const size_t queries_row_splits_size, const int64_t *const queries_row_splits, const uint32_t *const hash_table_splits, const size_t hash_table_cell_splits_size, const uint32_t *const hash_table_cell_splits, const uint32_t *const hash_table_index, const Metric metric, const bool ignore_query_point, const bool return_distances, OUTPUT_ALLOCATOR &output_allocator)
 
template<class TIndex , class TAttr >
void InvertNeighborsListCPU (const TIndex *const inp_neighbors_index, const TAttr *const inp_neighbors_attributes, const int num_attributes_per_neighbor, const int64_t *const inp_neighbors_row_splits, const size_t inp_num_queries, TIndex *out_neighbors_index, TAttr *out_neighbors_attributes, const size_t index_size, int64_t *out_neighbors_row_splits, const size_t out_num_queries)
 
template<class T , class OUTPUT_ALLOCATOR >
void KnnSearchCPU (int64_t *query_neighbors_row_splits, size_t num_points, const T *const points, size_t num_queries, const T *const queries, const int k, const Metric metric, const bool ignore_query_point, const bool return_distances, OUTPUT_ALLOCATOR &output_allocator)
 
HOST_DEVICE size_t SpatialHash (int x, int y, int z)
 Spatial hashing function for integer coordinates. More...
 
HOST_DEVICE size_t SpatialHash (const utility::MiniVec< int, 3 > &xyz)
 
template<class TVecf >
HOST_DEVICE utility::MiniVec< int, 3 > ComputeVoxelIndex (const TVecf &pos, const typename TVecf::Scalar_t &inv_voxel_size)
 
template<class T , class OUTPUT_ALLOCATOR >
void RadiusSearchCPU (int64_t *query_neighbors_row_splits, size_t num_points, const T *const points, size_t num_queries, const T *const queries, const T *radii, const Metric metric, const bool ignore_query_point, const bool return_distances, const bool normalize_distances, OUTPUT_ALLOCATOR &output_allocator)
 
template<class T >
void ReduceSubarraysSumCPU (const T *const values, const size_t values_size, const int64_t *const row_splits, const size_t num_arrays, T *out_sums)
 
template<class T >
bool CheckVoxelSize (std::string &err, const size_t num_positions, const T *const positions, const T voxel_size)
 Function for debugging. Checks if the voxel size is too small. More...
 
template<class TDerived >
Eigen::Vector3i ComputeVoxelIndex (const Eigen::ArrayBase< TDerived > &pos, const typename TDerived::Scalar &inv_voxel_size)
 
template<class TReal , class TFeat , class ACCUMULATOR , class OUTPUT_ALLOCATOR >
void _VoxelPooling (size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *inp_features, TReal voxel_size, OUTPUT_ALLOCATOR &output_allocator)
 
template<class TReal , class TFeat , class ACCUMULATOR , AccumulationFn FEAT_FN>
void _VoxelPoolingBackprop (TFeat *features_backprop, size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *const inp_features, size_t num_pooled, const TReal *const pooled_positions, const TFeat *const pooled_features_gradient, TReal voxel_size)
 
template<class TReal , class TFeat , class OUTPUT_ALLOCATOR >
void VoxelPooling (size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *inp_features, TReal voxel_size, OUTPUT_ALLOCATOR &output_allocator, AccumulationFn position_fn, AccumulationFn feature_fn)
 
template<class TReal , class TFeat >
void VoxelPoolingBackprop (TFeat *features_backprop, size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *const inp_features, size_t num_pooled, const TReal *const pooled_positions, const TFeat *const pooled_features_gradient, TReal voxel_size, AccumulationFn position_fn, AccumulationFn feature_fn)
 

Enumeration Type Documentation

◆ AccumulationFn

Enumerator
AVERAGE 
NEAREST_NEIGHBOR 
NEAREST_NEIGHBOR 
MAX 
CENTER 

◆ CoordinateMapping

Coordinate Mapping functions

  • BALL_TO_CUBE_RADIAL uses radial stretching to map a sphere to a cube.
  • BALL_TO_CUBE_VOLUME_PRESERVING is using a more expensive volume preserving mapping to map a sphere to a cube.
  • IDENTITY no mapping is applied to the coordinates.
Enumerator
BALL_TO_CUBE_RADIAL 
BALL_TO_CUBE_VOLUME_PRESERVING 
IDENTITY 

◆ InterpolationMode

Interpolation modes LINEAR is a standard trilinear interpolation with coordinate clamping LINEAR_BORDER uses a zero border instead of clamping NEAREST_NEIGHBOR no interpolation, use nearest neighbor

Enumerator
LINEAR 
LINEAR_BORDER 
NEAREST_NEIGHBOR 

◆ Metric

Supported metrics.

Enumerator
L1 
L2 
Linf 

Function Documentation

◆ _CConvBackropFilterCPU()

template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE>
void open3d::ml::impl::_CConvBackropFilterCPU ( TReal *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TReal *  out_positions,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_importance,
size_t  num_indices,
const TIndex *  neighbors_index,
const TReal *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TReal *  out_features_gradient,
bool  normalize 
)

◆ _CConvComputeFeaturesCPU()

template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE>
void open3d::ml::impl::_CConvComputeFeaturesCPU ( TReal *  out_features,
const std::vector< int > &  filter_dims,
const TReal *  filter,
size_t  num_out,
const TReal *  out_positions,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbor_index,
const TReal *  neighbor_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
bool  normalize 
)

Implementation of CConvComputeFeatures with template parameters for configuration.

◆ _CConvTransposeBackpropFilterCPU()

template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void open3d::ml::impl::_CConvTransposeBackpropFilterCPU ( TReal *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TReal *  out_positions,
const TReal *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  num_indices,
const TIndex *  neighbors_index,
const TReal *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TReal *  out_features_gradient 
)

Implementation of CConvTransposeBackpropFilterCPU with template parameters for configuration.

◆ _CConvTransposeComputeFeaturesCPU()

template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void open3d::ml::impl::_CConvTransposeComputeFeaturesCPU ( TReal *  out_features,
const std::vector< int > &  filter_dims,
const TReal *  filter,
size_t  num_out,
const TReal *  out_positions,
const TReal *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  neighbors_index_size,
const TIndex *  neighbor_index,
const TReal *  neighbor_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets 
)

Implementation of CConvComputeFeatures with template parameters for configuration.

◆ _VoxelPooling()

template<class TReal , class TFeat , class ACCUMULATOR , class OUTPUT_ALLOCATOR >
void open3d::ml::impl::_VoxelPooling ( size_t  num_inp,
const TReal *const  inp_positions,
int  in_channels,
const TFeat *  inp_features,
TReal  voxel_size,
OUTPUT_ALLOCATOR &  output_allocator 
)

◆ _VoxelPoolingBackprop()

template<class TReal , class TFeat , class ACCUMULATOR , AccumulationFn FEAT_FN>
void open3d::ml::impl::_VoxelPoolingBackprop ( TFeat *  features_backprop,
size_t  num_inp,
const TReal *const  inp_positions,
int  in_channels,
const TFeat *const  inp_features,
size_t  num_pooled,
const TReal *const  pooled_positions,
const TFeat *const  pooled_features_gradient,
TReal  voxel_size 
)

◆ CConvBackpropFilterCPU()

template<class TReal , class TIndex >
void open3d::ml::impl::CConvBackpropFilterCPU ( TReal *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TReal *  out_positions,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_importance,
size_t  num_indices,
const TIndex *  neighbors_index,
const TReal *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TReal *  out_features_gradient,
InterpolationMode  interpolation,
CoordinateMapping  coordinate_mapping,
bool  align_corners,
bool  individual_extent,
bool  isotropic_extent,
bool  normalize 
)

Computes the backprop for the filter of a continuous convolution.

Parameters
tempPointer to temporary memory. If nullptr then the required size of temporary memory will be written to temp_size and no work is done. This function can make use of more memory and returns the maximum size that can be used in max_temp_size.
temp_sizeThe size of the temporary memory in bytes. This is used as an output if temp is nullptr and returns the minimum temp size required.
max_temp_sizeThis is used as an output if temp is nullptr and returns the maximum temp size that can be used.
texture_alignmentThe texture alignment in bytes. This is used for allocating segments within the temporary memory.
filter_backropOutput array for the computed filter gradient with shape [depth,height,witdth, inp channels, out channels]
filter_dimsThe sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels].
num_outThe number of output points.
out_positionsThe positions of the output points. The shape is [num_out, 3].
num_inpThe number of input points.
inp_positionsThe positions of the input points. The shape is [num_inp, 3].
inp_featuresThe input features with shape [num_inp, in_channels].
inp_importanceOptional importance for each input point with shape [num_inp]. Set to null to disable.
neighbors_index_sizeThe size of the neighbors_index array.
neighbors_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_importanceOptional importance for each entry in neighbors_index. Set to null to disable.
neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in neighbors_index. The size of the array is num_out + 1.
extentsThe spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent.
offsetsA single 3D vector used in the filter coordinate computation. The shape is [3].
interpolationThe interpolation mode. Either LINEAR or NEAREST_NEIGHBOR.
coordinate_mappingThe coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING.
align_cornersIf true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape.
individual_extentIf true each output point has an individual extent.
isotropic_extentIf true each then the extent is isotropic for each output point.
normalizeIf true then the output features are normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance.

◆ CConvComputeFeaturesCPU()

template<class TReal , class TIndex >
void open3d::ml::impl::CConvComputeFeaturesCPU ( TReal *  out_features,
const std::vector< int > &  filter_dims,
const TReal *  filter,
size_t  num_out,
const TReal *  out_positions,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbor_index,
const TReal *  neighbor_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
InterpolationMode  interpolation,
CoordinateMapping  coordinate_mapping,
bool  align_corners,
bool  individual_extent,
bool  isotropic_extent,
bool  normalize 
)

Computes the output features of a continuous convolution.

Parameters
out_featuresOutput array for the computed features with shape [num_out, out channels]
filter_dimsThe sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels].
filterPointer to the filter values.
num_outThe number of output points.
out_positionsThe positions of the output points. The shape is [num_out, 3].
num_inpThe number of input points.
inp_positionsThe positions of the input points. The shape is [num_inp, 3].
inp_featuresThe input features with shape [num_inp, in_channels].
inp_importanceOptional importance for each input point with shape [num_inp]. Set to null to disable.
neighbors_index_sizeThe size of the neighbors_index array.
neighbors_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_importanceOptional importance for each entry in neighbors_index. Set to null to disable.
neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in neighbors_index. The size of the array is num_out + 1.
extentsThe spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent.
offsetsA single 3D vector used in the filter coordinate computation. The shape is [3].
interpolationThe interpolation mode. Either LINEAR or NEAREST_NEIGHBOR.
coordinate_mappingThe coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING.
align_cornersIf true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape.
individual_extentIf true each output point has an individual extent.
isotropic_extentIf true each then the extent is isotropic for each output point.
normalizeIf true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance.

◆ CConvTransposeBackpropFilterCPU()

template<class TReal , class TIndex >
void open3d::ml::impl::CConvTransposeBackpropFilterCPU ( TReal *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TReal *  out_positions,
const TReal *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  num_indices,
const TIndex *  neighbors_index,
const TReal *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TReal *  out_features_gradient,
InterpolationMode  interpolation,
CoordinateMapping  coordinate_mapping,
bool  align_corners,
bool  individual_extent,
bool  isotropic_extent,
bool  normalize 
)

Computes the backprop for the filter of a transpose continuous convolution.

Parameters
filter_backropOutput array for the computed filter gradient with shape [depth,height,witdth, inp channels, out channels]
filter_dimsThe sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels].
filterPointer to the filter values.
num_outThe number of output points.
out_positionsThe positions of the output points. The shape is [num_out, 3].
out_importanceOptional importance for each output point with shape [num_out]. Set to null to disable.
num_inpThe number of input points.
inp_positionsThe positions of the input points. The shape is [num_inp, 3].
inp_featuresThe input features with shape [num_inp, in_channels].
inp_neighbors_importance_sumThe sum of the neighbors_importance values for each input with shape [num_inp].
inp_neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in inp_neighbors_index. The size of the array is num_inp + 1.
neighbors_index_sizeThe size of the neighbors_index array.
neighbors_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_importanceOptional importance for each entry in neighbors_index. Set to null to disable.
neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in neighbors_index. The size of the array is num_out + 1.
extentsThe spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent.
offsetsA single 3D vector used in the filter coordinate computation. The shape is [3].
out_features_gradientThe gradient from the features with shape [num_out, out_channels]
interpolationThe interpolation mode. Either LINEAR or NEAREST_NEIGHBOR.
coordinate_mappingThe coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING.
align_cornersIf true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape.
individual_extentIf true each output point has an individual extent.
isotropic_extentIf true each then the extent is isotropic for each output point.
normalizeIf true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance.

◆ CConvTransposeComputeFeaturesCPU()

template<class TReal , class TIndex >
void open3d::ml::impl::CConvTransposeComputeFeaturesCPU ( TReal *  out_features,
const std::vector< int > &  filter_dims,
const TReal *  filter,
size_t  num_out,
const TReal *  out_positions,
const TReal *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TReal *  inp_features,
const TReal *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  neighbors_index_size,
const TIndex *  neighbor_index,
const TReal *  neighbor_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
InterpolationMode  interpolation,
CoordinateMapping  coordinate_mapping,
bool  align_corners,
bool  individual_extent,
bool  isotropic_extent,
bool  normalize 
)

Computes the output features of a transpose continuous convolution.

Parameters
out_featuresOutput array for the computed features with shape [num_out, out channels]
filter_dimsThe sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels].
filterPointer to the filter values.
num_outThe number of output points.
out_positionsThe positions of the output points. The shape is [num_out, 3].
out_importanceOptional importance for each output point with shape [num_out]. Set to null to disable.
num_inpThe number of input points.
inp_positionsThe positions of the input points. The shape is [num_inp, 3].
inp_featuresThe input features with shape [num_inp, in_channels].
inp_neighbors_importance_sumThe sum of the neighbors_importance values for each input with shape [num_inp].
inp_neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in inp_neighbors_index. The size of the array is num_inp + 1.
neighbors_index_sizeThe size of the neighbors_index array.
neighbors_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_importanceOptional importance for each entry in neighbors_index. Set to null to disable.
neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in neighbors_index. The size of the array is num_out + 1.
extentsThe spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent.
offsetsA single 3D vector used in the filter coordinate computation. The shape is [3].
interpolationThe interpolation mode. Either LINEAR or NEAREST_NEIGHBOR.
coordinate_mappingThe coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING.
align_cornersIf true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape.
individual_extentIf true each output point has an individual extent.
isotropic_extentIf true each then the extent is isotropic for each output point.
normalizeIf true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance.

◆ CheckVoxelSize()

template<class T >
bool open3d::ml::impl::CheckVoxelSize ( std::string &  err,
const size_t  num_positions,
const T *const  positions,
const T  voxel_size 
)

Function for debugging. Checks if the voxel size is too small.

◆ ComputeFilterCoordinates()

template<bool ALIGN_CORNERS, CoordinateMapping MAPPING, class T , int VECSIZE>
void open3d::ml::impl::ComputeFilterCoordinates ( Eigen::Array< T, VECSIZE, 1 > &  x,
Eigen::Array< T, VECSIZE, 1 > &  y,
Eigen::Array< T, VECSIZE, 1 > &  z,
const Eigen::Array< int, 3, 1 > &  filter_size,
const Eigen::Array< T, VECSIZE, 3 > &  inv_extents,
const Eigen::Array< T, 3, 1 > &  offset 
)
inline

Computes the filter coordinates. The input to this function are coordinates relative to the point where the convolution is evaluated. Coordinates are usually in the range [-extent/2,extent/2] with extent as the edge length of the bounding box of the filter shape. The output is a coordinate within the filter array, i.e. the range is [0, filter_size.xyz], if the point was inside the filter shape.

The simplest filter shape is a cuboid (MAPPING=IDENTITY) and the transformation is simply [-extent/2,extent/2] -> [0, filter_size.xyz]. The other type of shape that is implemented is a sphere with MAPPING=BALL_TO_CUBE_RADIAL or MAPPING=BALL_TO_CUBE_VOLUME_PRESERVING.

Template Parameters
ALIGN_CORNERSIf true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape.
MAPPINGThe mapping that is applied to the input coordinates.
  • BALL_TO_CUBE_RADIAL uses radial stretching to map a sphere to a cube.
  • BALL_TO_CUBE_VOLUME_PRESERVING is using a more expensive volume preserving mapping to map a sphere to a cube.
  • IDENTITY no mapping is applied to the coordinates.
Parameters
xx coordinates. Input and output variable.
yy coordinates. Input and output variable.
zz coordinates. Input and output variable.
filter_sizeThe spatial size of the filter array in voxels.
inv_extentsThe reciproval of the spatial extent of the filter in coordinate units.
offsetAn offset for shifting the center. Can be used to implement discrete filters with even filter size.

◆ ComputeVoxelIndex() [1/2]

template<class TVecf >
HOST_DEVICE utility::MiniVec<int, 3> open3d::ml::impl::ComputeVoxelIndex ( const TVecf &  pos,
const typename TVecf::Scalar_t &  inv_voxel_size 
)
inline

Computes an integer voxel index for a 3D position.

Parameters
posA 3D position.
inv_voxel_sizeThe reciprocal of the voxel size

◆ ComputeVoxelIndex() [2/2]

template<class TDerived >
Eigen::Vector3i open3d::ml::impl::ComputeVoxelIndex ( const Eigen::ArrayBase< TDerived > &  pos,
const typename TDerived::Scalar &  inv_voxel_size 
)

Computes an integer voxel index for a 3D position.

Parameters
posA 3D position.
inv_voxel_sizeThe reciprocal of the voxel size

◆ FillColumn()

template<class TReal , class TIndex >
void open3d::ml::impl::FillColumn ( const cudaStream_t &  stream,
TReal *  columns,
int  in_channels,
TIndex  begin_idx,
TIndex  end_idx,
TIndex  num_out,
const TReal *const __restrict__  out_positions,
TIndex  num_inp,
const TReal *const __restrict__  inp_positions,
const TReal *const __restrict__  inp_features,
const TReal *const __restrict__  inp_importance,
size_t  neighbors_index_size,
const TIndex *const __restrict__  neighbors_index,
const TReal *const __restrict__  neighbors_importance,
const int64_t *const __restrict__  neighbors_row_splits,
const TReal *const __restrict__  extents,
const TReal *const __restrict__  offsets,
const std::vector< int > &  filter_dims,
InterpolationMode  interpolation,
CoordinateMapping  coordinate_mapping,
bool  align_corners,
bool  individual_extent,
bool  isotropic_extent,
bool  normalize 
)

Copies and transforms the features to a column, which can be multiplied with the filter matrix.

Template Parameters
TRealType for positions and features.
TIndexType for addressing neighbors.
Parameters
columnsOutput array with shape
in_channelsNumber of input channels.
begin_idxIndex of the first output point to process.
end_idxIndex after the last output point to process.
num_outThe number of output points.
out_positionsThe positions of the output points. The shape is [num_out, 3].
num_inpThe number of input points.
inp_positionsThe positions of the input points. The shape is [num_inp, 3].
inp_featuresThe input features with shape [num_inp, in_channels].
inp_importanceOptional importance for each input point with shape [num_inp]. Set to null to disable.
neighbors_index_sizeThe size of the neighbors_index array.
neighbors_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_importanceOptional importance for each entry in neighbors_index. Set to null to disable.
neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in neighbors_index. The size of the array is num_out + 1.
extentsThe spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent.
offsetsA single 3D vector used in the filter coordinate computation. The shape is [3].
filter_dimsThe spatial filter size in voxels. (The filter resolution) with shape [3].
interpolationThe interpolation mode. Either LINEAR or NEAREST_NEIGHBOR.
coordinate_mappingThe coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING.
align_cornersIf true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape.
individual_extentIf true each output point has an individual extent.
isotropic_extentIf true each then the extent is isotropic for each output point.
normalizeIf true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance.

◆ FillColumnTranspose()

template<class TReal , class TIndex >
void open3d::ml::impl::FillColumnTranspose ( const cudaStream_t &  stream,
TReal *  columns,
int  in_channels,
TIndex  begin_idx,
TIndex  end_idx,
TIndex  num_out,
const TReal *const __restrict__  out_positions,
TIndex  num_inp,
const TReal *const __restrict__  inp_positions,
const TReal *const __restrict__  inp_features,
const TReal *const __restrict__  inp_neighbors_importance_sum,
const int64_t *const __restrict__  inp_neighbors_prefix_sum,
size_t  neighbors_index_size,
const TIndex *const __restrict__  neighbors_index,
const TReal *const __restrict__  neighbors_importance,
const int64_t *const __restrict__  neighbors_row_splits,
const TReal *const __restrict__  extents,
const TReal *const __restrict__  offsets,
const std::vector< int > &  filter_dims,
InterpolationMode  interpolation,
CoordinateMapping  coordinate_mapping,
bool  align_corners,
bool  individual_extent,
bool  isotropic_extent,
bool  normalize 
)

◆ FixedRadiusSearchCPU()

template<class T , class OUTPUT_ALLOCATOR >
void open3d::ml::impl::FixedRadiusSearchCPU ( int64_t *  query_neighbors_row_splits,
const size_t  num_points,
const T *const  points,
const size_t  num_queries,
const T *const  queries,
const T  radius,
const size_t  points_row_splits_size,
const int64_t *const  points_row_splits,
const size_t  queries_row_splits_size,
const int64_t *const  queries_row_splits,
const uint32_t *const  hash_table_splits,
const size_t  hash_table_cell_splits_size,
const uint32_t *const  hash_table_cell_splits,
const uint32_t *const  hash_table_index,
const Metric  metric,
const bool  ignore_query_point,
const bool  return_distances,
OUTPUT_ALLOCATOR &  output_allocator 
)

Fixed radius search. This function computes a list of neighbor indices for each query point. The lists are stored linearly and an exclusive prefix sum defines the start and end of list in the array. In addition the function optionally can return the distances for each neighbor in the same format as the indices to the neighbors.

Template Parameters
TFloating-point data type for the point positions.
OUTPUT_ALLOCATORType of the output_allocator. See output_allocator for more information.
Parameters
query_neighbors_row_splitsThis is the output pointer for the prefix sum. The length of this array is num_queries + 1.
num_pointsThe number of points.
pointsArray with the 3D point positions. This must be the array that was used for building the spatial hash table.
num_queriesThe number of query points.
queriesArray with the 3D query positions. This may be the same array as points.
radiusThe search radius.
points_row_splits_sizeThe size of the points_row_splits array. The size of the array is batch_size+1.
points_row_splitsDefines the start and end of the points in each batch item. The size of the array is batch_size+1. If there is only 1 batch item then this array is [0, num_points]
queries_row_splits_sizeThe size of the queries_row_splits array. The size of the array is batch_size+1.
queries_row_splitsDefines the start and end of the queries in each batch item. The size of the array is batch_size+1. If there is only 1 batch item then this array is [0, num_queries]
hash_table_splitsArray defining the start and end the hash table for each batch item. This is [0, number of cells] if there is only 1 batch item or [0, hash_table_cell_splits_size-1] which is the same.
hash_table_cell_splits_sizeThis is the length of the hash_table_cell_splits array.
hash_table_cell_splitsThis is an output of the function BuildSpatialHashTableCPU. The row splits array describing the start and end of each cell.
hash_table_indexThis is an output of the function BuildSpatialHashTableCPU. This is array storing the values of the hash table, which are the indices to the points. The size of the array must be equal to the number of points.
metricOne of L1, L2, Linf. Defines the distance metric for the search.
ignore_query_pointIf true then points with the same position as the query point will be ignored.
return_distancesIf true then this function will return the distances for each neighbor to its query point in the same format as the indices. Note that for the L2 metric the squared distances will be returned!!
output_allocatorAn object that implements functions for allocating the output arrays. The object must implement functions AllocIndices(int32_t** ptr, size_t size) and AllocDistances(T** ptr, size_t size). Both functions should allocate memory and return a pointer to that memory in ptr. Argument size specifies the size of the array as the number of elements. Both functions must accept the argument size==0. In this case ptr does not need to be set.

◆ InvertNeighborsListCPU()

template<class TIndex , class TAttr >
void open3d::ml::impl::InvertNeighborsListCPU ( const TIndex *const  inp_neighbors_index,
const TAttr *const  inp_neighbors_attributes,
const int  num_attributes_per_neighbor,
const int64_t *const  inp_neighbors_row_splits,
const size_t  inp_num_queries,
TIndex *  out_neighbors_index,
TAttr *  out_neighbors_attributes,
const size_t  index_size,
int64_t *  out_neighbors_row_splits,
const size_t  out_num_queries 
)

Inverts a neighbors list, which is a tuple of the form (neighbors_index, neighbors_row_splits, neighbors_attributes). neighbors_index is a nested list of indices to the neighbors. Each entry defines an edge between two indices (points). The neighbors_row_splits defines the start and end of each sublist. neighbors_attributes is an optional array of attributes for each entry in neighbors_index.

Example: The neighbors for point cloud A (3 points) in point cloud B (2 points) is defined by:

  • neighbors_index [0 1 0 0]
  • neighbors_row_splits [0 2 3 4]
  • optional neighbors_attributes [0.1 0.2 0.3 0.4] (1 scalar attribute)

The inverted neighbors list is then the neighbors for point cloud B in A

  • neighbors_index [0 1 2 0]
  • neighbors_row_splits [0 3 4]
  • optional neighbors_attributes [0.1 0.3 0.4 0.2]
Parameters
inp_neighbors_indexThe nested list of neighbor indices.
inp_neighbors_attributesThe array of attributes for each entry in inp_neighbors_index. This is optional and can be set to null.
num_attributes_per_neighborThe number of scalar attributes for each entry in inp_neighbors_index.
inp_neighbors_row_splitsDefines the start and end of the sublists in inp_neighbors_index. This is an exclusive prefix sum with 0 as the first element and the length of inp_neighbors_index as last element. The size is inp_num_queries + 1
inp_num_queriesThe number of queries.
out_neighbors_indexThe inverted neighbors_index list with the same size as inp_neighbors_index .
out_neighbors_attributesThe inverted array of attributes with the same size as inp_neighbors_attributes .
index_sizeThis is the size of inp_neighbors_index and out_neighbors_index, both have the same size.
out_neighbors_row_splitsThe prefix sum which defines the start and end of the sublists in out_neighbors_index.
out_num_queriesThe number of queries with respect to the inverted neighbors list.

◆ KnnSearchCPU()

template<class T , class OUTPUT_ALLOCATOR >
void open3d::ml::impl::KnnSearchCPU ( int64_t *  query_neighbors_row_splits,
size_t  num_points,
const T *const  points,
size_t  num_queries,
const T *const  queries,
const int  k,
const Metric  metric,
const bool  ignore_query_point,
const bool  return_distances,
OUTPUT_ALLOCATOR &  output_allocator 
)

KNN search. This function computes a list of neighbor indices for each query point. The lists are stored linearly and an exclusive prefix sum defines the start and end of each list in the array. In addition the function optionally can return the distances for each neighbor in the same format as the indices to the neighbors.

Template Parameters
TFloating-point data type for the point positions.
OUTPUT_ALLOCATORType of the output_allocator. See output_allocator for more information.
Parameters
query_neighbors_row_splitsThis is the output pointer for the prefix sum. The length of this array is num_queries + 1.
num_pointsThe number of points.
pointsArray with the 3D point positions. This may be the same array as queries.
num_queriesThe number of query points.
queriesArray with the 3D query positions. This may be the same array as points.
kThe number of neighbors to search.
metricOne of L1, L2, Linf. Defines the distance metric for the search.
ignore_query_pointIf true then points with the same position as the query point will be ignored.
return_distancesIf true then this function will return the distances for each neighbor to its query point in the same format as the indices. Note that for the L2 metric the squared distances will be returned!!
output_allocatorAn object that implements functions for allocating the output arrays. The object must implement functions AllocIndices(int32_t** ptr, size_t size) and AllocDistances(T** ptr, size_t size). Both functions should allocate memory and return a pointer to that memory in ptr. Argument size specifies the size of the array as the number of elements. Both functions must accept the argument size==0. In this case ptr does not need to be set.

◆ MapCylinderToCube()

template<class T , int VECSIZE>
void open3d::ml::impl::MapCylinderToCube ( Eigen::Array< T, VECSIZE, 1 > &  x,
Eigen::Array< T, VECSIZE, 1 > &  y,
Eigen::Array< T, VECSIZE, 1 > &  z 
)
inline

Maps coordinates in a cylinder with radius 1 to a cube. The input and output range of the coordinates is [-1,1]. The cylinder axis is along z.

◆ MapSphereToCylinder()

template<class T , int VECSIZE>
void open3d::ml::impl::MapSphereToCylinder ( Eigen::Array< T, VECSIZE, 1 > &  x,
Eigen::Array< T, VECSIZE, 1 > &  y,
Eigen::Array< T, VECSIZE, 1 > &  z 
)
inline

Maps coordinates in a sphere with radius 1 to a cylinder. The input and output range of the coordinates is [-1,1]. The cylinder axis is along z.

◆ MultiplyAndCopyColumns()

template<class T >
void open3d::ml::impl::MultiplyAndCopyColumns ( const cudaStream_t &  stream,
size_t  rows,
size_t  cols,
T *__restrict__  out_ptr,
const T *const __restrict__  col_major_matrix,
const T *const __restrict__  vector 
)

Multiplies each column with a scalar.

Parameters
out_ptrOutput pointer
col_major_matrixMatrix with shape [rows, cols] in column major storage oder.
vectorA vector with shape [cols].

◆ MultiplyColumns()

template<class T >
void open3d::ml::impl::MultiplyColumns ( const cudaStream_t &  stream,
size_t  rows,
size_t  cols,
T *__restrict__  col_major_matrix,
const T *const __restrict__  vector 
)

Multiplies each column with a scalar in-place.

Parameters
col_major_matrixMatrix with shape [rows, cols] in column major storage oder.
vectorA vector with shape [cols].

◆ RadiusSearchCPU()

template<class T , class OUTPUT_ALLOCATOR >
void open3d::ml::impl::RadiusSearchCPU ( int64_t *  query_neighbors_row_splits,
size_t  num_points,
const T *const  points,
size_t  num_queries,
const T *const  queries,
const T *  radii,
const Metric  metric,
const bool  ignore_query_point,
const bool  return_distances,
const bool  normalize_distances,
OUTPUT_ALLOCATOR &  output_allocator 
)

Radius search. This function computes a list of neighbor indices for each query point. The lists are stored linearly and an exclusive prefix sum defines the start and end of each list in the array. In addition the function optionally can return the distances for each neighbor in the same format as the indices to the neighbors.

Template Parameters
TFloating-point data type for the point positions.
OUTPUT_ALLOCATORType of the output_allocator. See output_allocator for more information.
Parameters
query_neighbors_row_splitsThis is the output pointer for the prefix sum. The length of this array is num_queries + 1.
num_pointsThe number of points.
pointsArray with the 3D point positions. This may be the same array as queries.
num_queriesThe number of query points.
queriesArray with the 3D query positions. This may be the same array as points.
radiiA vector of search radii with length num_queries.
metricOne of L1, L2, Linf. Defines the distance metric for the search.
ignore_query_pointIf true then points with the same position as the query point will be ignored.
return_distancesIf true then this function will return the distances for each neighbor to its query point in the same format as the indices. Note that for the L2 metric the squared distances will be returned!!
normalize_distancesIf true then the returned distances are normalized in the range [0,1]. Note that for L2 the normalized distance is squared.
output_allocatorAn object that implements functions for allocating the output arrays. The object must implement functions AllocIndices(int32_t** ptr, size_t size) and AllocDistances(T** ptr, size_t size). Both functions should allocate memory and return a pointer to that memory in ptr. Argument size specifies the size of the array as the number of elements. Both functions must accept the argument size==0. In this case ptr does not need to be set.

◆ ReduceSubarraysSumCPU()

template<class T >
void open3d::ml::impl::ReduceSubarraysSumCPU ( const T *const  values,
const size_t  values_size,
const int64_t *const  row_splits,
const size_t  num_arrays,
T *  out_sums 
)

Reduces subarrays in linear memory with the sum operation. The sum for empty subarrays is 0.

Parameters
valuesThe linear array with all values
values_sizeNumber of elements of values
row_splitsDefines the start and end of each subarray. This is an exclusive prefix sum with 0 as the first element and the length of values as last element. The size is num_arrays + 1
num_arraysThe number of subarrays
out_sumsThe preallocated output array with size num_arrays

◆ SpatialHash() [1/2]

HOST_DEVICE size_t open3d::ml::impl::SpatialHash ( int  x,
int  y,
int  z 
)
inline

Spatial hashing function for integer coordinates.

◆ SpatialHash() [2/2]

HOST_DEVICE size_t open3d::ml::impl::SpatialHash ( const utility::MiniVec< int, 3 > &  xyz)
inline

◆ VoxelPooling()

template<class TReal , class TFeat , class OUTPUT_ALLOCATOR >
void open3d::ml::impl::VoxelPooling ( size_t  num_inp,
const TReal *const  inp_positions,
int  in_channels,
const TFeat *  inp_features,
TReal  voxel_size,
OUTPUT_ALLOCATOR &  output_allocator,
AccumulationFn  position_fn,
AccumulationFn  feature_fn 
)

Pooling operation for point clouds. Aggregates points that are inside the same voxel.

Template Parameters
TRealScalar type for point positions.
TFeatScalar type for the features.
OUTPUT_ALLOCATORType of the output_allocator. See output_allocator for more information.
Parameters
num_inpThe number of input points.
inp_positionsArray with 3D point positions.
in_channelsThe number of input feature channels.
inp_featuresThe array with the point features. The shape is [num_inp, in_channels].
voxel_sizeThe voxel size (voxel edge length) used for pooling.
output_allocatorAn object that implements functions for allocating the output arrays. The object must implement functions AllocPooledPositions(TReal** ptr, size_t num) and AllocPooledFeatures(TFeat** ptr, size_t num, channels), with 'num' as the number of output points and 'channels' as in_channels . Both functions should allocate memory and return a pointer to that memory in ptr. Both functions must accept the argument num==0. In this case ptr does not need to be set. Note that AllocPooledPositions must allocate memory for num*3*sizeof(TReal) bytes.
position_fnDefines how the new point positions will be computed. AVERAGE computes the center of gravity for the points within one voxel. NEAREST_NEIGHBOR selects the point closest to the voxel center. CENTER uses the voxel center for the position of the generated point.
feature_fnDefines how the new features will be computed. AVERAGE computes the average feature vector. NEAREST_NEIGHBOR selects the feature vector of the point closest to the voxel center. MAX uses the maximum feature among all points within the voxel.

◆ VoxelPoolingBackprop()

template<class TReal , class TFeat >
void open3d::ml::impl::VoxelPoolingBackprop ( TFeat *  features_backprop,
size_t  num_inp,
const TReal *const  inp_positions,
int  in_channels,
const TFeat *const  inp_features,
size_t  num_pooled,
const TReal *const  pooled_positions,
const TFeat *const  pooled_features_gradient,
TReal  voxel_size,
AccumulationFn  position_fn,
AccumulationFn  feature_fn 
)

Backpropagation to the features for VoxelPooling.

Parameters
features_backpropThe output array with the gradients for the features.
num_pooledThe number of points after pooling with VoxelPooling.
pooled_positionsArray with the 3D positions after pooling.
pooled_features_gradientArray with the point features after pooling.

See VoxelPooling for the description of the remaining parameters.