Commit 10aee918 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

Fix DNN module build without torch

parent 503b00f1
......@@ -971,6 +971,22 @@ Mat readTorchBlob(const String &filename, bool isBinary)
return importer->tensors.begin()->second;
}
#else
Ptr<Importer> createTorchImporter(const String&, bool)
{
CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build");
return Ptr<Importer>();
}
Mat readTorchBlob(const String&, bool)
{
CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build");
return Mat();
}
#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
Net readNetFromTorch(const String &model, bool isBinary)
{
Ptr<Importer> importer;
......@@ -988,20 +1004,5 @@ Net readNetFromTorch(const String &model, bool isBinary)
return net;
}
#else
Ptr<Importer> createTorchImporter(const String&, bool)
{
CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build");
return Ptr<Importer>();
}
Mat readTorchBlob(const String&, bool)
{
CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build");
return Mat();
}
#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