Skip to content

Commit 1b55643

Browse files
committed
fix torch_npu adpater
1 parent 2e523a0 commit 1b55643

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mmcv/ops/csrc/common/pytorch_npu_helper.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@
2626

2727
#define NPU_NAME_SPACE at_npu::native
2828

29+
c10::SmallVector<int64_t, SIZE> array_to_small_vector(c10::IntArrayRef shape)
30+
{
31+
c10::SmallVector<int64_t, SIZE> shape_small_vec;
32+
for (int i = 0; i < shape.size(); i++)
33+
{
34+
shape_small_vec.emplace_back(shape[i]);
35+
}
36+
37+
return shape_small_vec;
38+
}
39+
2940
#ifdef MMCV_WITH_XLA
3041
#define REGISTER_NPU_IMPL(key, value) REGISTER_DEVICE_IMPL(key, XLA, value)
3142
#else

0 commit comments

Comments
 (0)