Skip to content

Commit 0f506f1

Browse files
authored
[ROCm][Windows] Fix compile torchvision image for ROCm (#8897)
1 parent 501a2c9 commit 0f506f1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

torchvision/csrc/io/image/common.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
#include "common.h"
33
#include <torch/torch.h>
44

5+
// If we are in a Windows environment, we need to define
6+
// initialization functions for the _custom_ops extension
7+
#ifdef _WIN32
8+
void* PyInit_image(void) {
9+
return nullptr;
10+
}
11+
#endif
12+
13+
514
namespace vision {
615
namespace image {
716

torchvision/csrc/io/image/image.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
#include <ATen/core/op_registration/op_registration.h>
44

5-
// If we are in a Windows environment, we need to define
6-
// initialization functions for the _custom_ops extension
7-
#ifdef _WIN32
8-
void* PyInit_image(void) {
9-
return nullptr;
10-
}
11-
#endif
12-
135
namespace vision {
146
namespace image {
157

0 commit comments

Comments
 (0)