"docs/tutorials/implicitron_config_system.ipynb" did not exist on "89d8eebc5a57e639220eaf4caad20f73886d88e3"
image.cpp 492 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#include "image.h"
#include <ATen/ATen.h>
#include <Python.h>

// If we are in a Windows environment, we need to define
// initialization functions for the _custom_ops extension
#ifdef _WIN32
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_image(void) {
  // No need to do anything.
  return NULL;
}
#else
PyMODINIT_FUNC PyInit_image(void) {
  // No need to do anything.
  return NULL;
}
#endif
#endif

static auto registry =
    torch::RegisterOperators().op("image::decode_png", &decodePNG);