Put Torch importer implementation under ifdef

pull/953/head
Vladislav Sovrasov 8 years ago
parent 56bea16da8
commit 620d74ab1f
  1. 4
      modules/dnn/src/torch/THFile.h
  2. 10
      modules/dnn/src/torch/torch_importer.cpp

@ -2,6 +2,7 @@
#define TH_FILE_INC
//#include "THStorage.h"
#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#include "THGeneral.h"
typedef struct THFile__ THFile;
@ -84,4 +85,5 @@ TH_API long THFile_position(THFile *self);
TH_API void THFile_close(THFile *self);
TH_API void THFile_free(THFile *self);
#endif
#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#endif //TH_FILE_INC

@ -49,7 +49,7 @@
namespace cv {
namespace dnn {
#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#include "THDiskFile.h"
#ifdef NDEBUG
@ -964,6 +964,14 @@ Blob readTorchBlob(const String &filename, bool isBinary)
return importer->tensors.begin()->second;
}
#else
Ptr<Importer> createTorchImporter(const String &filename, bool isBinary)
{
CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build");
return Ptr<Importer>();
}
#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
}
}

Loading…
Cancel
Save