Skip to content

Commit

Permalink
Fixed the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivannp committed Oct 5, 2016
1 parent cb7722f commit 38329dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tests/UnitTests/V2LibraryTests/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ static inline FILE *_wfopen(const wchar_t *path, const wchar_t *mode)

#endif

extern std::wstring s_tempModelPath;

template <typename ElementType>
inline void SaveAndReloadModel(CNTK::FunctionPtr& functionPtr, const std::vector<CNTK::Variable*>& variables, const CNTK::DeviceDescriptor& device)
{
Expand All @@ -91,8 +93,8 @@ inline void SaveAndReloadModel(CNTK::FunctionPtr& functionPtr, const std::vector
std::runtime_error("SaveAndReloadModel: Multiple variables having same name cannot be restored after save and reload");
}

CNTK::SaveAsLegacyModel<ElementType>(functionPtr, s_tempModelPath);
functionPtr = CNTK::LoadLegacyModel<ElementType>(functionPtr->Outputs()[0].GetDataType(), s_tempModelPath, device);
CNTK::SaveAsLegacyModel(functionPtr, s_tempModelPath);
functionPtr = CNTK::LoadLegacyModel(functionPtr->Outputs()[0].GetDataType(), s_tempModelPath, device);

if (_wunlink(tempModelPath.c_str()) != 0)
std::runtime_error("Error deleting temp model file 'feedForward.net'");
Expand Down

0 comments on commit 38329dc

Please sign in to comment.