Source/Readers/LMSequenceReader/: also build SequenceWriter on Linux
This commit is contained in:
Родитель
edbecc4213
Коммит
02d0405118
1
Makefile
1
Makefile
|
@ -309,6 +309,7 @@ LMSEQUENCEREADER_SRC =\
|
|||
$(SOURCEDIR)/Readers/LMSequenceReader/Exports.cpp \
|
||||
$(SOURCEDIR)/Readers/LMSequenceReader/SequenceParser.cpp \
|
||||
$(SOURCEDIR)/Readers/LMSequenceReader/SequenceReader.cpp \
|
||||
$(SOURCEDIR)/Readers/LMSequenceReader/SequenceWriter.cpp \
|
||||
|
||||
LMSEQUENCEREADER_OBJ := $(patsubst %.cpp, $(OBJDIR)/%.o, $(LMSEQUENCEREADER_SRC))
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
// </copyright>
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#ifdef _WIN32
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
#include "Basics.h"
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
|
|
@ -12,21 +12,6 @@
|
|||
|
||||
namespace Microsoft { namespace MSR { namespace CNTK {
|
||||
|
||||
template<class ElemType>
|
||||
void DATAWRITER_API GetWriter(IDataWriter<ElemType>** pwriter)
|
||||
{
|
||||
*pwriter = new LMSequenceWriter<ElemType>();
|
||||
}
|
||||
|
||||
extern "C" DATAWRITER_API void GetWriterF(IDataWriter<float>** pwriter)
|
||||
{
|
||||
GetWriter(pwriter);
|
||||
}
|
||||
extern "C" DATAWRITER_API void GetWriterD(IDataWriter<double>** pwriter)
|
||||
{
|
||||
GetWriter(pwriter);
|
||||
}
|
||||
|
||||
template<class ElemType>
|
||||
class LMSequenceWriter : public IDataWriter<ElemType>
|
||||
{
|
||||
|
@ -65,8 +50,10 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
}
|
||||
|
||||
public:
|
||||
using LabelType = typename IDataWriter<ElemType>::LabelType;
|
||||
using LabelIdType = typename IDataWriter<ElemType>::LabelIdType;
|
||||
void GetSections(std::map<std::wstring, SectionType, nocase_compare>& /*sections*/){}
|
||||
void SaveMapping(std::wstring saveId, const std::map<typename LabelIdType, typename LabelType>& /*labelMapping*/){}
|
||||
void SaveMapping(std::wstring saveId, const std::map<LabelIdType, LabelType>& /*labelMapping*/){}
|
||||
|
||||
public:
|
||||
template<class ConfigRecordType>
|
||||
|
@ -77,4 +64,21 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
virtual bool SaveData(size_t recordStart, const std::map<std::wstring, void*, nocase_compare>& matrices, size_t numRecords, size_t datasetSize, size_t byteVariableSized);
|
||||
};
|
||||
|
||||
template<class ElemType>
|
||||
void DATAWRITER_API GetWriter(IDataWriter<ElemType>** pwriter)
|
||||
{
|
||||
assert(pwriter != nullptr);
|
||||
*pwriter = new LMSequenceWriter<ElemType>();
|
||||
assert(*pwriter != nullptr);
|
||||
}
|
||||
|
||||
extern "C" DATAWRITER_API void GetWriterF(IDataWriter<float>** pwriter)
|
||||
{
|
||||
GetWriter(pwriter);
|
||||
}
|
||||
extern "C" DATAWRITER_API void GetWriterD(IDataWriter<double>** pwriter)
|
||||
{
|
||||
GetWriter(pwriter);
|
||||
}
|
||||
|
||||
}}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче