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 @@
#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
}
}
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