Skip to content

Commit

Permalink
[Enhance] Do not use deprecated .type().scalarType() (#3195)
Browse files Browse the repository at this point in the history
`at::Tensor::type()` method is deprecated and `tensor.scalar_type()` is a recommended way to replace `tensor.type().scalarType()` invocation
  • Loading branch information
malfet authored Nov 4, 2024
1 parent 1393257 commit 71437a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmcv/ops/csrc/pytorch/spconv_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct TorchGPU : public tv::GPU {

template <typename scalar_t>
void check_torch_dtype(const torch::Tensor &tensor) {
switch (tensor.type().scalarType()) {
switch (tensor.scalar_type()) {
case at::ScalarType::Double: {
auto val = std::is_same<std::remove_const_t<scalar_t>, double>::value;
TV_ASSERT_RT_ERR(val, "error");
Expand Down

0 comments on commit 71437a3

Please sign in to comment.