For all the wprint related stuff, we should avoid use %s because wstring is the internal representation (no conversion needed). Replaced it with %ls.

This commit is contained in:
Yu 2015-04-15 21:02:55 -04:00
Родитель 34ce3e2b0a
Коммит 2cde42df29
3 изменённых файлов: 18 добавлений и 18 удалений

Просмотреть файл

@ -2,7 +2,7 @@
command=Simple_Demo:Simple_Demo_Output
# deviceId=-1 for CPU, >=0 for GPU devices
DeviceNumber=0
DeviceNumber=-1
#stderr=Demo
precision=float
@ -45,14 +45,14 @@ Simple_Demo=[
learningRatesPerMB=0.5:0.2*20:0.1
momentumPerMB=0.9
dropoutRate=0.0
maxEpochs=500
maxEpochs=50
]
# Parameter values for the reader
reader=[
# reader to use
readerType=UCIFastReader
file=SimpleDataTrain.txt
file=../Demos/Simple/SimpleDataTrain.txt
miniBatchMode=Partial
randomize=Auto
@ -67,7 +67,7 @@ Simple_Demo=[
start=2 # Skip two elements
dim=1 # One label dimension
labelDim=2 # Two labels possible
labelMappingFile=SimpleMapping.txt
labelMappingFile=../Demos/Simple/SimpleMapping.txt
]
]
]
@ -84,7 +84,7 @@ Simple_Demo_Output=[
reader=[
# reader to use
readerType=UCIFastReader
file=SimpleDataTest.txt
file=../Demos/Simple/SimpleDataTest.txt
features=[
dim=2
start=0
@ -93,7 +93,7 @@ Simple_Demo_Output=[
start=2
dim=1
labelDim=2
labelMappingFile=SimpleMapping.txt
labelMappingFile=../Demos/Simple/SimpleMapping.txt
]
]
outputPath=SimpleOutput # Dump output as text

Просмотреть файл

@ -172,7 +172,7 @@ private: // [erw] added for Toplological Plot only
}
wstring str = style;
for (auto x : specialNodes){
str = str + msra::strfun::wstrprintf(L"\"%S\" ", x->GetName().c_str());
str = str + msra::strfun::wstrprintf(L"\"%ls\" ", x->GetName().c_str());
}
return str + L"; \n";
}
@ -243,10 +243,10 @@ public:
line.clear();
size_t nrows = x->FunctionValues().GetNumRows();
size_t ncols = x->FunctionValues().GetNumCols();
line = msra::strfun::wstrprintf(L" \"%S\" [ label = \"%S [%d,%d]\\n%S\" ] ;\n",
line = msra::strfun::wstrprintf(L" \"%ls\" [ label = \"%ls [%d,%d]\\n%ls\" ] ;\n",
x->GetName().c_str(), x->GetName().c_str(), nrows, ncols, x->OperationName().c_str());
/*fprintf(stderr, "%S\n", line.c_str());
line += L" \"%s\" [ label = \"%s [%d,%d]\\n%s\" ] ;\n";
//fprintf(stderr, "%ls\n", line.c_str());
/* line += L" \"%s\" [ label = \"%s [%d,%d]\\n%s\" ] ;\n";
line += x->GetName().c_str();
line += x->GetName().c_str();
line += L" \"%s\" [ label = \"%s [%d,%d]\\n%s\" ] ;\n";*/
@ -263,7 +263,7 @@ public:
line.clear();
for (auto x : m_features)
{
line = line + msra::strfun::wstrprintf(L"\"%S\" ", x->GetName().c_str());
line = line + msra::strfun::wstrprintf(L"\"%ls\" ", x->GetName().c_str());
}
fstream << line << L"\n}\n";
// subgraph eval/output/criteria
@ -272,15 +272,15 @@ public:
line.clear();
for (auto x : m_finalCriteria)
{
line = line + msra::strfun::wstrprintf(L"\"%S\" ", x->GetName().c_str());
line = line + msra::strfun::wstrprintf(L"\"%ls\" ", x->GetName().c_str());
}
for (auto x : m_outputNodes)
{
line = line + msra::strfun::wstrprintf(L"\"%S\" ", x->GetName().c_str());
line = line + msra::strfun::wstrprintf(L"\"%ls\" ", x->GetName().c_str());
}
for (auto x : m_evalNodes)
{
line = line + msra::strfun::wstrprintf(L"\"%S\" ", x->GetName().c_str());
line = line + msra::strfun::wstrprintf(L"\"%ls\" ", x->GetName().c_str());
}
fstream << line << L"\n}\n";
@ -302,14 +302,14 @@ public:
// create a dummy node
ComputationNodePtr delayedNode = des;
wstring dummyName = des->GetName() + L".dummy";
wstring out = msra::strfun::wstrprintf(L"node [ shape = box3d , color = lightgray, style = \"filled\" , label = \"%S\" ] ; \"%S\"\n",
wstring out = msra::strfun::wstrprintf(L"node [ shape = box3d , color = lightgray, style = \"filled\" , label = \"%ls\" ] ; \"%ls\"\n",
(delayedNode->GetName() + L"\\n(delayed)").c_str(), dummyName.c_str());
line = out;
line += msra::strfun::wstrprintf(L"\"%S\" -> \"%S\" ; \n", dummyName.c_str(), srcname.c_str());
line += msra::strfun::wstrprintf(L"\"%ls\" -> \"%ls\" ; \n", dummyName.c_str(), srcname.c_str());
}
else
{
line = msra::strfun::wstrprintf(L"\"%S\" -> \"%S\" ; \n", desname.c_str(), srcname.c_str());
line = msra::strfun::wstrprintf(L"\"%ls\" -> \"%ls\" ; \n", desname.c_str(), srcname.c_str());
}

Просмотреть файл

@ -35,7 +35,7 @@ BUILDTYPE = release
#MATHLIB = acml
MATHLIB = mkl
# modify relevant path below for your system
MKL_PATH = /usr/users/chiaying/intel/composer_xe_2013.2.146
MKL_PATH = /usr/users/yzhang87/tools/composer_xe_2015.2.164
ACML_PATH = /usr/users/yzhang87/code/acml/gfortran64
#######