Open3D (C++ API)  0.17.0
Data Structures | Macros | Functions
VoxelPoolingOps.cpp File Reference

(9238339 (Tue Mar 14 18:49:09 2023 -0700))

#include <vector>
#include "open3d/ml/impl/misc/VoxelPooling.h"
#include "open3d/ml/pytorch/TorchHelper.h"
#include "torch/script.h"

Data Structures

class  VoxelPoolingFunction
 

Macros

#define FN_PARAMETERS    positions, features, voxel_size, position_fn, feature_fn, debug
 
#define CALL(real_t, feat_t, fn)
 
#define FN_PARAMETERS
 
#define CALL(real_t, feat_t, fn)
 

Functions

template<class TReal , class TFeat >
std::tuple< torch::Tensor, torch::Tensor > VoxelPoolingCPU (const torch::Tensor &positions, const torch::Tensor &features, const double voxel_size, const AccumulationFn position_fn, const AccumulationFn feature_fn, const bool debug)
 
template<class TReal , class TFeat >
void VoxelPoolingGradCPU (torch::Tensor &features_backprop, const torch::Tensor &positions, const torch::Tensor &features, const torch::Tensor &pooled_positions, const torch::Tensor &pooled_features_gradient, const double voxel_size, const AccumulationFn position_fn, const AccumulationFn feature_fn)
 
std::tuple< torch::Tensor, torch::Tensor > VoxelPooling (const torch::Tensor &positions, const torch::Tensor &features, const double voxel_size, const std::string &position_fn_str, const std::string &feature_fn_str, const bool debug)
 

Macro Definition Documentation

◆ CALL [1/2]

#define CALL (   real_t,
  feat_t,
  fn 
)
Value:
if (CompareTorchDtype<real_t>(positions_type) && \
CompareTorchDtype<feat_t>(features_type)) { \
auto ans = fn<real_t, feat_t>(FN_PARAMETERS); \
ctx->save_for_backward({positions, features, std::get<0>(ans)}); \
return {std::get<0>(ans), std::get<1>(ans)}; \
}
#define FN_PARAMETERS

◆ CALL [2/2]

#define CALL (   real_t,
  feat_t,
  fn 
)
Value:
if (CompareTorchDtype<real_t>(positions_type) && \
CompareTorchDtype<feat_t>(features_type)) { \
fn<real_t, feat_t>(FN_PARAMETERS); \
dispatch_success = true; \
}

◆ FN_PARAMETERS [1/2]

#define FN_PARAMETERS    positions, features, voxel_size, position_fn, feature_fn, debug

◆ FN_PARAMETERS [2/2]

#define FN_PARAMETERS
Value:
features_backprop, positions, features, pooled_positions, \
pooled_features_gradient, voxel_size, position_fn, feature_fn

Function Documentation

◆ VoxelPooling()

std::tuple<torch::Tensor, torch::Tensor> VoxelPooling ( const torch::Tensor &  positions,
const torch::Tensor &  features,
const double  voxel_size,
const std::string &  position_fn_str,
const std::string &  feature_fn_str,
const bool  debug 
)

◆ VoxelPoolingCPU()

template<class TReal , class TFeat >
std::tuple<torch::Tensor, torch::Tensor> VoxelPoolingCPU ( const torch::Tensor &  positions,
const torch::Tensor &  features,
const double  voxel_size,
const AccumulationFn  position_fn,
const AccumulationFn  feature_fn,
const bool  debug 
)

◆ VoxelPoolingGradCPU()

template<class TReal , class TFeat >
void VoxelPoolingGradCPU ( torch::Tensor &  features_backprop,
const torch::Tensor &  positions,
const torch::Tensor &  features,
const torch::Tensor &  pooled_positions,
const torch::Tensor &  pooled_features_gradient,
const double  voxel_size,
const AccumulationFn  position_fn,
const AccumulationFn  feature_fn 
)