Commit 44071d78 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #953 from sovrasov:hide_torch_import_api

parents ce4c4eae 620d74ab
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define TH_FILE_INC #define TH_FILE_INC
//#include "THStorage.h" //#include "THStorage.h"
#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#include "THGeneral.h" #include "THGeneral.h"
typedef struct THFile__ THFile; typedef struct THFile__ THFile;
...@@ -84,4 +85,5 @@ TH_API long THFile_position(THFile *self); ...@@ -84,4 +85,5 @@ TH_API long THFile_position(THFile *self);
TH_API void THFile_close(THFile *self); TH_API void THFile_close(THFile *self);
TH_API void THFile_free(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 @@ ...@@ -49,7 +49,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#include "THDiskFile.h" #include "THDiskFile.h"
#ifdef NDEBUG #ifdef NDEBUG
...@@ -964,6 +964,14 @@ Blob readTorchBlob(const String &filename, bool isBinary) ...@@ -964,6 +964,14 @@ Blob readTorchBlob(const String &filename, bool isBinary)
return importer->tensors.begin()->second; 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
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment