File tree Expand file tree Collapse file tree 5 files changed +1
-37
lines changed Expand file tree Collapse file tree 5 files changed +1
-37
lines changed Original file line number Diff line number Diff line change 1
-
2
1
#include " Video.h"
3
2
#include < c10/util/Logging.h>
4
3
#include < torch/script.h>
9
8
using namespace std ;
10
9
using namespace ffmpeg ;
11
10
12
- // If we are in a Windows environment, we need to define
13
- // initialization functions for the _custom_ops extension
14
- // #ifdef _WIN32
15
- // #if PY_MAJOR_VERSION < 3
16
- // PyMODINIT_FUNC init_video_reader(void) {
17
- // // No need to do anything.
18
- // return NULL;
19
- // }
20
- // #else
21
- // PyMODINIT_FUNC PyInit_video_reader(void) {
22
- // // No need to do anything.
23
- // return NULL;
24
- // }
25
- // #endif
26
- // #endif
27
-
28
11
const size_t decoderTimeoutMs = 600000 ;
29
12
const AVPixelFormat defaultVideoPixelFormat = AV_PIX_FMT_RGB24;
30
13
const AVSampleFormat defaultAudioSampleFormat = AV_SAMPLE_FMT_FLT;
Original file line number Diff line number Diff line change 6
6
#include < vector>
7
7
8
8
#include < ATen/ATen.h>
9
- #include < Python.h>
10
9
#include < c10/util/Logging.h>
11
10
#include < torch/script.h>
12
11
Original file line number Diff line number Diff line change @@ -12,18 +12,11 @@ using namespace ffmpeg;
12
12
// If we are in a Windows environment, we need to define
13
13
// initialization functions for the _custom_ops extension
14
14
#ifdef _WIN32
15
- #if PY_MAJOR_VERSION < 3
16
- PyMODINIT_FUNC init_video_reader (void ) {
17
- // No need to do anything.
18
- return NULL ;
19
- }
20
- #else
21
15
PyMODINIT_FUNC PyInit_video_reader (void ) {
22
16
// No need to do anything.
23
17
return NULL ;
24
18
}
25
19
#endif
26
- #endif
27
20
28
21
namespace video_reader {
29
22
Original file line number Diff line number Diff line change 2
2
3
3
// All pure C++ headers for the C++ frontend.
4
4
#include < torch/all.h>
5
- // Python bindings for the C++ frontend (includes Python.h).
6
- #include < torch/python.h>
7
5
8
6
class NewEmptyTensorOp : public torch ::autograd::Function<NewEmptyTensorOp> {
9
7
public:
Original file line number Diff line number Diff line change 17
17
#include " nms.h"
18
18
19
19
// If we are in a Windows environment, we need to define
20
- // initialization functions for the _C extension
20
+ // initialization functions for the _custom_ops extension
21
21
#ifdef _WIN32
22
- #if PY_MAJOR_VERSION < 3
23
- PyMODINIT_FUNC init_C (void ) {
24
- // No need to do anything.
25
- // extension.py will run on load
26
- return NULL ;
27
- }
28
- #else
29
22
PyMODINIT_FUNC PyInit__C (void ) {
30
23
// No need to do anything.
31
- // extension.py will run on load
32
24
return NULL ;
33
25
}
34
26
#endif
35
- #endif
36
27
37
28
namespace vision {
38
29
int64_t cuda_version () noexcept {
You can’t perform that action at this time.
0 commit comments