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

Data Structures

struct  InterpolationVec
 Class for computing interpolation weights. More...
 
struct  InterpolationVec< T, VECSIZE, InterpolationMode::NEAREST_NEIGHBOR >
 Implementation for NEAREST_NEIGHBOR. 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...
 
class  MemoryAllocation
 A class for managing memory segments within a memory allocation. More...
 
class  Adaptor
 Adaptor for nanoflann. More...
 
struct  SelectNanoflannAdaptor
 
struct  SelectNanoflannAdaptor< L2, T >
 
struct  SelectNanoflannAdaptor< L1, T >
 
class  Accumulator
 
class  AccumulatorBackprop
 

Enumerations

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

Functions

template<class TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE>
void _CConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, bool normalize)
 
template<class TFeat , class TOut , class TReal , class TIndex >
void CConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_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 TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE>
void _CConvBackropFilterCPU (TOut *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 TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient, bool normalize)
 
template<class TFeat , class TOut , class TReal , class TIndex >
void CConvBackpropFilterCPU (TOut *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 TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
 
template<class TFeat , class TReal , class TIndex >
void FillColumn (const cudaStream_t &stream, TFeat *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 TFeat *const __restrict__ inp_features, const TFeat *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TFeat *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 TFeat , class TReal , class TIndex >
void FillColumnTranspose (const cudaStream_t &stream, TFeat *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 TFeat *const __restrict__ inp_features, const TFeat *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 TFeat *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 TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void _CConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets)
 
template<class TFeat , class TOut , class TReal , class TIndex >
void CConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_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 TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void _CConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient)
 
template<class TFeat , class TOut , class TReal , class TIndex >
void CConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *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 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)
 
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 >
void RaggedToDenseCPU (const T *const values, const int64_t *const row_splits, const size_t row_splits_size, const size_t out_col_size, const T *const default_value, const size_t default_value_size, T *out_values)
 
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 , int NDIM, class OUTPUT_ALLOCATOR >
void VoxelizeCPU (const size_t num_points, const T *const points, const size_t batch_size, const int64_t *const row_splits, const T *const voxel_size, const T *const points_range_min, const T *const points_range_max, const int64_t max_points_per_voxel, const int64_t max_voxels, OUTPUT_ALLOCATOR &output_allocator)
 
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)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool POINT_IMPORTANCE>
void _SparseConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, bool normalize)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void SparseConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, bool normalize)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool POINT_IMPORTANCE>
void _SparseConvBackropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient, bool normalize)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void SparseConvBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient, bool normalize)
 
template<class TReal , class TIndex , class TKernelIndex >
void FillColumn (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, TIndex num_inp, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TKernelIndex *const __restrict__ neighbors_kernel_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const int num_kernel_elements, bool normalize)
 
template<class TReal , class TIndex , class TKernelIndex >
void FillColumnTranspose (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, TIndex num_inp, 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 TKernelIndex *const __restrict__ neighbors_kernel_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const int num_kernel_elements, bool normalize)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool NORMALIZE>
void _SparseConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbor_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbor_importance, const int64_t *neighbors_row_splits)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void SparseConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbor_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbor_importance, const int64_t *neighbors_row_splits, bool normalize)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool NORMALIZE>
void _SparseConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient)
 
template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void SparseConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient, bool normalize)
 

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 TFeat , class TOut , 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 ( TOut *  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 TFeat *  inp_features,
const TFeat *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TFeat *  out_features_gradient,
bool  normalize 
)

◆ _CConvComputeFeaturesCPU()

template<class TFeat , class TOut , 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 ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
const TReal *  out_positions,
size_t  num_inp,
const TReal *  inp_positions,
const TFeat *  inp_features,
const TFeat *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_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 TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE>
void open3d::ml::impl::_CConvTransposeBackpropFilterCPU ( TOut *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TReal *  out_positions,
const TFeat *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TFeat *  out_features_gradient 
)

Implementation of CConvTransposeBackpropFilterCPU with template parameters for configuration.

◆ _CConvTransposeComputeFeaturesCPU()

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

Implementation of CConvComputeFeatures with template parameters for configuration.

◆ _SparseConvBackropFilterCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool POINT_IMPORTANCE>
void open3d::ml::impl::_SparseConvBackropFilterCPU ( TOut *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_importance,
const TIndex *  neighbors_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TFeat *  out_features_gradient,
bool  normalize 
)

◆ _SparseConvComputeFeaturesCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool POINT_IMPORTANCE>
void open3d::ml::impl::_SparseConvComputeFeaturesCPU ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
bool  normalize 
)

Implementation of SparseConvComputeFeatures with template parameters for configuration.

◆ _SparseConvTransposeBackpropFilterCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool NORMALIZE>
void open3d::ml::impl::_SparseConvTransposeBackpropFilterCPU ( TOut *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TFeat *  out_importance,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
const TIndex *  neighbors_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TFeat *  out_features_gradient 
)

Implementation of SparseConvTransposeBackpropFilterCPU with template parameters for configuration.

◆ _SparseConvTransposeComputeFeaturesCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool NORMALIZE>
void open3d::ml::impl::_SparseConvTransposeComputeFeaturesCPU ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
const TFeat *  out_importance,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
const TIndex *  neighbor_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbor_importance,
const int64_t *  neighbors_row_splits 
)

Implementation of SparseConvTransposeComputeFeatures 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 TFeat , class TOut , class TReal , class TIndex >
void open3d::ml::impl::CConvBackpropFilterCPU ( TOut *  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 TFeat *  inp_features,
const TFeat *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TFeat *  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.

Template Parameters
TFeatType for the features and weights
TOutType for the output features
TRealType for point positions and extents
TIndexType for neighbor indexing
Parameters
filter_backpropOutput array for the computed filter gradient with shape [depth,height,width, 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 TFeat , class TOut , class TReal , class TIndex >
void open3d::ml::impl::CConvComputeFeaturesCPU ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
const TReal *  out_positions,
size_t  num_inp,
const TReal *  inp_positions,
const TFeat *  inp_features,
const TFeat *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_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.

Template Parameters
TFeatType for the features and weights
TOutType for the output features
TRealType for point positions and extents
TIndexType for neighbor indexing
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 TFeat , class TOut , class TReal , class TIndex >
void open3d::ml::impl::CConvTransposeBackpropFilterCPU ( TOut *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TReal *  out_positions,
const TFeat *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TReal *  extents,
const TReal *  offsets,
const TFeat *  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.

Template Parameters
TFeatType for the features and weights
TOutType for the output features
TRealType for point positions and extents
TIndexType for neighbor indexing
Parameters
filter_backpropOutput array for the computed filter gradient with shape [depth,height,width, 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].
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 TFeat , class TOut , class TReal , class TIndex >
void open3d::ml::impl::CConvTransposeComputeFeaturesCPU ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
const TReal *  out_positions,
const TFeat *  out_importance,
size_t  num_inp,
const TReal *  inp_positions,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TFeat *  neighbors_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.

Template Parameters
TFeatType for the features and weights
TOutType for the output features
TRealType for point positions and extents
TIndexType for neighbor indexing
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 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

◆ ComputeVoxelIndex() [2/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

◆ FillColumn() [1/2]

template<class TFeat , class TReal , class TIndex >
void open3d::ml::impl::FillColumn ( const cudaStream_t &  stream,
TFeat *  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 TFeat *const __restrict__  inp_features,
const TFeat *const __restrict__  inp_importance,
size_t  neighbors_index_size,
const TIndex *const __restrict__  neighbors_index,
const TFeat *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
TFeatType for the features
TOutType for the output features
TRealType for point positions and extents
TIndexType for neighbor indexing
Parameters
columnsOutput array with shape [num_out, spatial filter dims, in_channels].
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.

◆ FillColumn() [2/2]

template<class TReal , class TIndex , class TKernelIndex >
void open3d::ml::impl::FillColumn ( const cudaStream_t &  stream,
TReal *  columns,
int  in_channels,
TIndex  begin_idx,
TIndex  end_idx,
TIndex  num_out,
TIndex  num_inp,
const TReal *const __restrict__  inp_features,
const TReal *const __restrict__  inp_importance,
size_t  neighbors_index_size,
const TIndex *const __restrict__  neighbors_index,
const TKernelIndex *const __restrict__  neighbors_kernel_index,
const TReal *const __restrict__  neighbors_importance,
const int64_t *const __restrict__  neighbors_row_splits,
const int  num_kernel_elements,
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.
TKernelIndexType for addressing the spatial dimension in a kernel.
Parameters
columnsOutput array with shape [num_out, spatial filter dims, in_channels].
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.
num_inpThe number of input points.
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_kernel_indexDefines which kernel element to use for each neighbor. This array has the same length as neighbors_index.
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.
num_kernel_elementsThe number of kernel elements. This is the size of the first dimension of the filter, i.e., The filter shape is [num_kernel_elements, in_channels, out_channels]
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() [1/2]

template<class TFeat , class TReal , class TIndex >
void open3d::ml::impl::FillColumnTranspose ( const cudaStream_t &  stream,
TFeat *  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 TFeat *const __restrict__  inp_features,
const TFeat *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 TFeat *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 
)

◆ FillColumnTranspose() [2/2]

template<class TReal , class TIndex , class TKernelIndex >
void open3d::ml::impl::FillColumnTranspose ( const cudaStream_t &  stream,
TReal *  columns,
int  in_channels,
TIndex  begin_idx,
TIndex  end_idx,
TIndex  num_out,
TIndex  num_inp,
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 TKernelIndex *const __restrict__  neighbors_kernel_index,
const TReal *const __restrict__  neighbors_importance,
const int64_t *const __restrict__  neighbors_row_splits,
const int  num_kernel_elements,
bool  normalize 
)

Similar as FillColumn but used in the transpose convolution to create the patch matrix.

◆ 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.

◆ 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 order.
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 order.
vectorA vector with shape [cols].

◆ RaggedToDenseCPU()

template<class T >
void open3d::ml::impl::RaggedToDenseCPU ( const T *const  values,
const int64_t *const  row_splits,
const size_t  row_splits_size,
const size_t  out_col_size,
const T *const  default_value,
const size_t  default_value_size,
T *  out_values 
)

Creates a dense tensor from a ragged tensor.

Example where each value has size 2: values = [[0,0],[1,1],[2,2],[3,3],[4,4]] row_splits = [0,2,5] out_col_size=3 default_value=[-1,-1] default_value_size = 2

will return

out_values = [[[0,0],[1,1],[-1,-1]], [[2,2],[3,3],[4,4]]]

Parameters
valuesLinear memory with all values.
row_splitsDefines the start and end of each entry in the ragged tensor. This is an exclusive prefix sum with 0 as the first element and the length of all values as the last element.
row_splits_sizeThe length of the row_splits vector.
out_col_sizeThe output column size. This is the second dim of the dense output tensor.
default_valueThe default value to use if there are not enough values for filling the row.
default_value_sizeThe size of the default value.
out_valuesThis is the output array. The size of the array must be [row_splits_size-1, out_col_size, default_value_size].

◆ 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

◆ SparseConvBackpropFilterCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void open3d::ml::impl::SparseConvBackpropFilterCPU ( TOut *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_importance,
const TIndex *  neighbors_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TFeat *  out_features_gradient,
bool  normalize 
)

Computes the backprop for the filter of a sparse 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,width, inp channels, out channels]
filter_dimsThe sizes of the filter dimensions. The size of filter_dims must be >=3. The order is [num kernel elements, inp channels, out channels].
num_outThe number of output points.
num_inpThe number of input points.
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_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_kernel_indexDefines which kernel element to use for each neighbor. This array has the same length as neighbors_index.
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.
out_features_gradientThe gradient signal from the features.
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.

◆ SparseConvComputeFeaturesCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void open3d::ml::impl::SparseConvComputeFeaturesCPU ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_importance,
size_t  neighbors_index_size,
const TIndex *  neighbors_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
bool  normalize 
)

Computes the output features of a sparse 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 >=3. The order is [num kernel elements, inp channels, out channels].
filterPointer to the filter values.
num_outThe number of output points.
num_inpThe number of input points.
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_kernel_indexDefines which kernel element to use for each neighbor. This array has the same length as neighbors_index.
neighbors_importanceArray of the same length as neighbors_importance. Defines which of the kernel elements to use in the matrix multiplication.
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.
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.

◆ SparseConvTransposeBackpropFilterCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void open3d::ml::impl::SparseConvTransposeBackpropFilterCPU ( TOut *  filter_backprop,
const std::vector< int > &  filter_dims,
size_t  num_out,
const TFeat *  out_importance,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
const TIndex *  neighbors_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbors_importance,
const int64_t *  neighbors_row_splits,
const TFeat *  out_features_gradient,
bool  normalize 
)

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

Parameters
filter_backropOutput array for the computed filter gradient with shape [depth,height,width, inp channels, out channels]
filter_dimsThe sizes of the filter dimensions. The size of filter_dims must be >=3. The order is [num kernel elements, inp channels, out channels].
filterPointer to the filter values.
num_outThe number of output points.
out_importanceOptional importance for each output point with shape [num_out]. Set to null to disable.
num_inpThe number of input points.
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_kernel_indexDefines which kernel element to use for each neighbor. This array has the same length as neighbors_index.
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.
out_features_gradientThe gradient from the features with shape [num_out, out_channels]
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.

◆ SparseConvTransposeComputeFeaturesCPU()

template<class TFeat , class TOut , class TIndex , class TKernelIndex >
void open3d::ml::impl::SparseConvTransposeComputeFeaturesCPU ( TOut *  out_features,
const std::vector< int > &  filter_dims,
const TFeat *  filter,
size_t  num_out,
const TFeat *  out_importance,
size_t  num_inp,
const TFeat *  inp_features,
const TFeat *  inp_neighbors_importance_sum,
const int64_t *  inp_neighbors_row_splits,
const TIndex *  neighbor_index,
const TKernelIndex *  neighbors_kernel_index,
const TFeat *  neighbor_importance,
const int64_t *  neighbors_row_splits,
bool  normalize 
)

Computes the output features of a transpose sparse 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 >=3. The order is [num kernel elements, inp channels, out channels].
filterPointer to the filter values.
num_outThe number of output points.
out_importanceOptional importance for each output point with shape [num_out]. Set to null to disable.
num_inpThe number of input points.
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_indexThe array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits.
neighbors_kernel_indexDefines which kernel element to use for each neighbor. This array has the same length as neighbors_index.
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.
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.

◆ SpatialHash() [1/2]

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

◆ SpatialHash() [2/2]

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

Spatial hashing function for integer coordinates.

◆ VoxelizeCPU()

template<class T , int NDIM, class OUTPUT_ALLOCATOR >
void open3d::ml::impl::VoxelizeCPU ( const size_t  num_points,
const T *const  points,
const size_t  batch_size,
const int64_t *const  row_splits,
const T *const  voxel_size,
const T *const  points_range_min,
const T *const  points_range_max,
const int64_t  max_points_per_voxel,
const int64_t  max_voxels,
OUTPUT_ALLOCATOR &  output_allocator 
)

This function voxelizes a point cloud. The function returns the integer coordinates of the voxels that contain points and a compact list of the indices that associate the voxels to the points.

Template Parameters
TFloating-point data type for the point positions.
NDIMThe number of dimensions of the points.
OUTPUT_ALLOCATORType of the output_allocator. See output_allocator for more information.
Parameters
num_pointsThe number of points.
pointsArray with the point positions. The shape is [num_points,NDIM].
batch_sizeThe batch size of points.
row_splitsrow_splits for defining batches.
voxel_sizeThe edge lengths of the voxel. The shape is [NDIM]. This pointer points to host memory!
points_range_minThe lower bound of the domain to be voxelized. The shape is [NDIM]. This pointer points to host memory!
points_range_maxThe upper bound of the domain to be voxelized. The shape is [NDIM]. This pointer points to host memory!
max_points_per_voxelThis parameter limits the number of points that are recorderd for each voxel.
max_voxelsThis parameter limits the number of voxels that will be generated.
output_allocatorAn object that implements functions for allocating the output arrays. The object must implement functions AllocVoxelCoords(int32_t** ptr, int64_t rows, int64_t cols), AllocVoxelPointIndices(int64_t** ptr, int64_t size), AllocVoxelPointRowSplits(int64_t** ptr, int64_t size) and AllocVoxelBatchSplits(int64_t** ptr, int64_t size). All functions should allocate memory and return a pointer to that memory in ptr. The arguments size, rows, and cols define the size of the array as the number of elements. All functions must accept zero size arguments. In this case ptr does not need to be set.

◆ 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.