Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
momo609 committed Aug 31, 2023
1 parent ee2f601 commit 9ec4e2b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions mmcv/ops/csrc/pytorch/npu/focal_loss_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ void sigmoid_focal_loss_forward_npu(Tensor input, Tensor target, Tensor weight,
} else {
target_y = at::one_hot(target, n_class);
}
// target_y =
// at_npu::native::NPUNativeFunctions::npu_dtype_cast(target_y, at::kInt);
target_y = target_y.to(at::kInt);
int64_t weight_size = weight.size(0);
at::Tensor weight_y = at::ones_like(input);
Expand Down
3 changes: 1 addition & 2 deletions mmcv/ops/csrc/pytorch/npu/voxelization_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ int hard_voxelize_forward_npu(const at::Tensor &points, at::Tensor &voxels,
const int max_points, const int max_voxels,
const int NDim = 3) {
at::Tensor voxel_num_tmp = OpPreparation::ApplyTensor(points, {1});
at::Tensor voxel_num = at_npu::native::NPUNativeFunctions::npu_dtype_cast(
voxel_num_tmp, at::kInt);
at::Tensor voxel_num = voxel_num_tmp.to(at::kInt);

at::Tensor voxel_size_cpu = at::from_blob(
const_cast<float *>(voxel_size.data()), {3}, dtype(at::kFloat));
Expand Down

0 comments on commit 9ec4e2b

Please sign in to comment.