Skip to content

Commit

Permalink
Solve PyTorch Ops compilation error in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lumurillo committed Jan 17, 2025
1 parent 81201f9 commit ef8df4b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions cpp/open3d/ml/impl/continuous_conv/ContinuousConv.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ void _CConvComputeFeaturesCPU(TOut* out_features,

memset(out_features, 0, sizeof(TOut) * num_out * out_channels);

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
typedef Eigen::Array<TReal, VECSIZE, 3> Matrix3C;

tbb::parallel_for(
tbb::blocked_range<size_t>(0, num_out, 32),
[&](const tbb::blocked_range<size_t>& r) {
Expand All @@ -72,13 +75,12 @@ void _CConvComputeFeaturesCPU(TOut* out_features,
in_channels * spatial_filter_size, range_length);
B.setZero();

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
Matrix infeat(VECSIZE, in_channels);

Eigen::Array<TReal, 3, 1> offsets_(offsets[0], offsets[1],
offsets[2]);

Eigen::Array<TReal, VECSIZE, 3> inv_extents;
Matrix3C inv_extents;
if (INDIVIDUAL_EXTENT == false) {
if (ISOTROPIC_EXTENT) {
inv_extents = 1 / extents[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ void _CConvBackropFilterCPU(TOut* filter_backprop,
memset(filter_backprop, 0, sizeof(TOut) * total_filter_size);
std::mutex filter_backprop_mutex;

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
typedef Eigen::Array<TReal, VECSIZE, 3> Matrix3C;

tbb::parallel_for(
tbb::blocked_range<size_t>(0, num_out, 32),
[&](const tbb::blocked_range<size_t>& r) {
Expand All @@ -74,13 +77,12 @@ void _CConvBackropFilterCPU(TOut* filter_backprop,
Eigen::Matrix<TFeat, Eigen::Dynamic, Eigen::Dynamic> C(
out_channels, range_length);

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
Matrix infeat(VECSIZE, in_channels);

Eigen::Array<TReal, 3, 1> offsets_(offsets[0], offsets[1],
offsets[2]);

Eigen::Array<TReal, VECSIZE, 3> inv_extents;
Matrix3C inv_extents;
if (INDIVIDUAL_EXTENT == false) {
if (ISOTROPIC_EXTENT) {
inv_extents = 1 / extents[0];
Expand Down
6 changes: 4 additions & 2 deletions cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ void _CConvTransposeComputeFeaturesCPU(

memset(out_features, 0, sizeof(TOut) * num_out * out_channels);

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
typedef Eigen::Array<TReal, VECSIZE, 3> Matrix3C;

tbb::parallel_for(
tbb::blocked_range<size_t>(0, num_out, 32),
[&](const tbb::blocked_range<size_t>& r) {
Expand All @@ -70,13 +73,12 @@ void _CConvTransposeComputeFeaturesCPU(
in_channels * spatial_filter_size, range_length);
B.setZero();

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
Matrix infeat(VECSIZE, in_channels);

Eigen::Array<TReal, 3, 1> offsets_(offsets[0], offsets[1],
offsets[2]);

Eigen::Array<TReal, VECSIZE, 3> inv_extents;
Matrix3C inv_extents;
if (INDIVIDUAL_EXTENT == false) {
if (ISOTROPIC_EXTENT) {
inv_extents = 1 / extents[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void _CConvTransposeBackpropFilterCPU(TOut* filter_backprop,
sizeof(TOut) * spatial_filter_size * in_channels * out_channels);
std::mutex filter_backprop_mutex;

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
typedef Eigen::Array<TReal, VECSIZE, 3> Matrix3C;

tbb::parallel_for(
tbb::blocked_range<size_t>(0, num_out, 32),
[&](const tbb::blocked_range<size_t>& r) {
Expand All @@ -75,13 +78,12 @@ void _CConvTransposeBackpropFilterCPU(TOut* filter_backprop,
Eigen::Matrix<TFeat, Eigen::Dynamic, Eigen::Dynamic> C(
out_channels, range_length);

typedef Eigen::Array<TFeat, VECSIZE, Eigen::Dynamic> Matrix;
Matrix infeat(VECSIZE, in_channels);

Eigen::Array<TReal, 3, 1> offsets_(offsets[0], offsets[1],
offsets[2]);

Eigen::Array<TReal, VECSIZE, 3> inv_extents;
Matrix3C inv_extents;
if (INDIVIDUAL_EXTENT == false) {
if (ISOTROPIC_EXTENT) {
inv_extents = 1 / extents[0];
Expand Down

0 comments on commit ef8df4b

Please sign in to comment.