addressing CR comments.
# Conflicts: # Source/CNTK/BrainScript/BrainScriptEvaluator.cpp # Source/Common/ExceptionWithCallStack.cpp # Source/Common/Include/Config.h # Source/Common/Include/Platform.h # Source/Common/Include/latticearchive.h # Source/Common/Include/numahelpers.h # Source/Math/CPUMatrix.cpp # Source/Math/Matrix.cpp # Source/Math/QuantizedMatrix.cpp
This commit is contained in:
Родитель
7f841125b3
Коммит
e686d1f79e
|
@ -18,8 +18,6 @@
|
|||
#define let const auto
|
||||
#endif
|
||||
|
||||
#pragma warning(disable: 4505) // 'function' : unreferenced local function has been removed
|
||||
|
||||
namespace Microsoft { namespace MSR { namespace BS {
|
||||
|
||||
using namespace std;
|
||||
|
@ -1151,6 +1149,9 @@ struct Debug : public Object
|
|||
{
|
||||
}
|
||||
}; // fake class type to get the template below trigger
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4505) // 'function' : unreferenced local function has been removed
|
||||
template <>
|
||||
/*static*/ ConfigurableRuntimeType MakeRuntimeTypeConstructor<Debug>()
|
||||
{
|
||||
|
@ -1173,6 +1174,7 @@ template <>
|
|||
rtInfo.isConfigRecord = false;
|
||||
return rtInfo;
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
||||
// =======================================================================
|
||||
// register ComputationNetwork with the ScriptableObject system
|
||||
|
|
|
@ -8,8 +8,10 @@
|
|||
#include "ExceptionWithCallStack.h"
|
||||
#include "Basics.h"
|
||||
#ifdef _WIN32
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4091) // 'typedef ': ignored on left of '' when no variable is declared
|
||||
#include "DbgHelp.h"
|
||||
#pragma warning(pop)
|
||||
#include <WinBase.h>
|
||||
#endif
|
||||
#include <algorithm>
|
||||
|
|
|
@ -13,7 +13,6 @@ using namespace std;
|
|||
|
||||
#pragma warning(disable : 4996) // Caused by the TODO below (line ~1280)
|
||||
#pragma warning(disable : 4456) // "declaration of '%$I' hides previous local declaration
|
||||
#pragma warning(disable : 4477) // format string '%s' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
|
||||
|
||||
// helper for numeric parameter arguments for multiple layers
|
||||
// This parses arguments of the form a:b*n:c where b gets duplicated n times and c unlimited times.
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
#pragma warning(disable: 4458) // declaration of '%$I' hides class member
|
||||
#pragma warning(disable: 4456) // declaration of '%$I' hides previous local declaration
|
||||
#pragma warning(disable: 4477) // format string '%s' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// TODO: thread_local is supported in VS2015. Remove this macro when we uprade to VS2015
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include "simplesenonehmm.h"
|
||||
#include "Matrix.h"
|
||||
|
||||
#pragma warning(disable: 4477) // format string '%s' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
|
||||
|
||||
namespace msra { namespace math {
|
||||
|
||||
class ssematrixbase;
|
||||
|
@ -876,7 +874,7 @@ public:
|
|||
template <typename HMMLOOKUPFUNCTION>
|
||||
void dump(FILE* f, const HMMLOOKUPFUNCTION& gethmmname) const // dump a lattice in HTK-like format
|
||||
{
|
||||
fprintf(f, "N=%lu L=%lu\n", nodes.size(), edges.size());
|
||||
fprintf(f, "N=%lu L=%lu\n", (unsigned long)nodes.size(), (unsigned long)edges.size());
|
||||
// foreach_index (i, nodes)
|
||||
// fprintf (f, "I=%d\tt=%.2f\n", i, nodes[i].t * 0.01f);
|
||||
foreach_index (j, edges)
|
||||
|
@ -1283,7 +1281,7 @@ public:
|
|||
char c;
|
||||
uint64_t offset;
|
||||
#ifdef _WIN32
|
||||
if (sscanf_s(q, "[%I64u]%c", &offset, &c, sizeof(c)) != 1)
|
||||
if (sscanf_s(q, "[%I64u]%c", &offset, &c, (unsigned int)sizeof(c)) != 1)
|
||||
#else
|
||||
|
||||
if (sscanf(q, "[%" PRIu64 "]%c", &offset, &c) != 1)
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
#include "simple_checked_arrays.h"
|
||||
#include "Basics.h" // for FormatWin32Error
|
||||
|
||||
#pragma warning(disable : 4477) // format string '%s' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
|
||||
|
||||
namespace msra { namespace numa {
|
||||
|
||||
// ... TODO: this can be a 'static', as it should only be set during foreach_node but not outside
|
||||
|
@ -139,7 +137,7 @@ static inline void *malloc(size_t n, size_t align)
|
|||
p = VirtualAllocEx(GetCurrentProcess(), NULL, n, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
||||
}
|
||||
if (p == NULL)
|
||||
fprintf(stderr, "numa::malloc: failed allocating %d bytes with alignment %d\n", n, align);
|
||||
fprintf(stderr, "numa::malloc: failed allocating %lu bytes with alignment %lu\n", (unsigned long)n, (unsigned long)align);
|
||||
if (((size_t) p) % align != 0)
|
||||
LogicError("VirtualAllocExNuma() returned an address that does not match the alignment requirement");
|
||||
return p;
|
||||
|
@ -163,9 +161,9 @@ static inline void showavailablememory(const char *what)
|
|||
BOOL rc = GetNumaAvailableMemoryNode((UCHAR) i, &availbytes);
|
||||
const double availmb = availbytes / (1024.0 * 1024.0);
|
||||
if (rc)
|
||||
fprintf(stderr, "%s: %8.2f MB available on NUMA node %d\n", what, availmb, i);
|
||||
fprintf(stderr, "%s: %8.2f MB available on NUMA node %lu\n", what, availmb, (unsigned long)i);
|
||||
else
|
||||
fprintf(stderr, "%s: error for getting available memory on NUMA node %d\n", what, i);
|
||||
fprintf(stderr, "%s: error for getting available memory on NUMA node %lu\n", what, (unsigned long)i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@ void ComputationNetwork::SetSeqParam(ComputationNetworkPtr net,
|
|||
/*static*/ void ComputationNetwork::SetMaxTempMemSizeForCNN(ComputationNetworkPtr net, const ComputationNodeBasePtr& criterionNode, const size_t maxTempMemSizeInSamples)
|
||||
{
|
||||
if (maxTempMemSizeInSamples > 0)
|
||||
fprintf(stderr, "Setting max temp memory size for Convolution operations to %lu samples.\n", maxTempMemSizeInSamples);
|
||||
fprintf(stderr, "Setting max temp memory size for Convolution operations to %lu samples.\n", (unsigned long)maxTempMemSizeInSamples);
|
||||
list<ComputationNodeBasePtr> convolutionNodes = net->GetNodesWithType(OperationNameOf(ConvolutionNode), criterionNode);
|
||||
if (convolutionNodes.size() == 0 && maxTempMemSizeInSamples != 0)
|
||||
{
|
||||
|
|
|
@ -1080,13 +1080,13 @@ public:
|
|||
auto inputSampleLayout = GetInputSampleLayout(0);
|
||||
|
||||
char str[4096];
|
||||
sprintf(str, "Input[Width:%lu, Height:%lu, Channels:%lu] \n", inputSampleLayout[1], inputSampleLayout[2], inputSampleLayout[0]);
|
||||
sprintf(str, "Input[Width:%lu, Height:%lu, Channels:%lu] \n", (unsigned long)inputSampleLayout[1], (unsigned long)inputSampleLayout[2], (unsigned long)inputSampleLayout[0]);
|
||||
fstream << string(str);
|
||||
sprintf(str, "PoolingWindow[Width:%lu, Height:%lu] SubSampling[Horizontal:%lu, Vertical:%lu]\n", m_windowWidth, m_windowHeight, m_horizontalSubsample, m_verticalSubsample);
|
||||
sprintf(str, "PoolingWindow[Width:%lu, Height:%lu] SubSampling[Horizontal:%lu, Vertical:%lu]\n", (unsigned long)m_windowWidth, (unsigned long)m_windowHeight, (unsigned long)m_horizontalSubsample, (unsigned long)m_verticalSubsample);
|
||||
fstream << string(str);
|
||||
sprintf(str, "Output[Width:%lu, Height:%lu, Channels:%lu] \n", m_sampleLayout[1], m_sampleLayout[2], m_sampleLayout[0]);
|
||||
sprintf(str, "Output[Width:%lu, Height:%lu, Channels:%lu] \n", (unsigned long)m_sampleLayout[1], (unsigned long)m_sampleLayout[2], (unsigned long)m_sampleLayout[0]);
|
||||
fstream << string(str);
|
||||
sprintf(str, "TotalSizePerSample[Input:%lu, Output:%lu] \n", m_inputSizePerSample, m_outputSizePerSample);
|
||||
sprintf(str, "TotalSizePerSample[Input:%lu, Output:%lu] \n", (unsigned long)m_inputSizePerSample, (unsigned long)m_outputSizePerSample);
|
||||
fstream << string(str);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -614,7 +614,7 @@ template <class ElemType>
|
|||
Base::DumpNodeInfo(printValues, printMetadata, fstream);
|
||||
|
||||
char str[4096];
|
||||
sprintf(str, "[%lu,%lu] ", GetAsMatrixNumRows(), GetAsMatrixNumCols());
|
||||
sprintf(str, "[%lu,%lu] ", (unsigned long)GetAsMatrixNumRows(), (unsigned long)GetAsMatrixNumCols());
|
||||
fstream << string(str);
|
||||
sprintf(str, "learningRateMultiplier=%f NeedsGradient=%s", m_learningRateMultiplier, m_learningRateMultiplier>0 ? "true" : "false"); // TODO: update NDL to accept a better matching name as well
|
||||
fstream << string(str);
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#pragma warning(disable : 4127) // conditional expression is constant; "if (sizeof(ElemType)==sizeof(float))" triggers this
|
||||
#pragma warning(disable : 4244) // unreachable code; triggered for unknown reasons
|
||||
#pragma warning(disable : 4702) // conversion from 'double' to 'float'
|
||||
#pragma warning(disable : 4477) // format string '%s' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
|
||||
|
||||
|
||||
#ifdef USE_MKL
|
||||
|
@ -3612,9 +3611,9 @@ void CPUMatrix<ElemType>::Print(const char* matrixName, ptrdiff_t rowFirst, ptrd
|
|||
fprintf(stderr, "\n###### ");
|
||||
if (matrixName != nullptr)
|
||||
fprintf(stderr, "%s ", matrixName);
|
||||
fprintf(stderr, "(%lu, %lu)", GetNumRows(), GetNumCols());
|
||||
fprintf(stderr, "(%lu, %lu)", (unsigned long)GetNumRows(), (unsigned long)GetNumCols());
|
||||
if (rowFirst != 0 || colFirst != 0 || (size_t)(rowLast + 1) != GetNumRows() || (size_t)(colLast + 1) != GetNumCols())
|
||||
fprintf(stderr, " [%ld:%ld, %ld:%ld]", rowFirst, rowLast, colFirst, colLast);
|
||||
fprintf(stderr, " [%ld:%ld, %ld:%ld]", (long)rowFirst, (long)rowLast, (long)colFirst, (long)colLast);
|
||||
fprintf(stderr, " ######\n\n");
|
||||
|
||||
if (IsEmpty())
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
namespace Microsoft { namespace MSR { namespace CNTK {
|
||||
|
||||
#pragma warning(disable: 4477) // format string '%s' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
|
||||
|
||||
template <class ElemType>
|
||||
QuantizedMatrix<ElemType>::QuantizedMatrix(const size_t numRows, const size_t numCols, const size_t nbits, DEVICEID_TYPE deviceId, MemAllocator* allocator /* = nullptr */)
|
||||
: m_numRows(numRows), m_numCols(numCols), m_numBits(nbits), m_allocator(allocator)
|
||||
|
@ -129,11 +127,11 @@ void QuantizedMatrix<ElemType>::Print(const char* matrixName, size_t rowStart, s
|
|||
}
|
||||
|
||||
if (matrixName != nullptr)
|
||||
fprintf(stderr, "\n###### %s (%lu, %lu) ######\n", matrixName, GetNumRows(), GetNumCols());
|
||||
fprintf(stderr, "\n###### %s (%lu, %lu) ######\n", matrixName, (unsigned long)GetNumRows(), (unsigned long)GetNumCols());
|
||||
else
|
||||
fprintf(stderr, "\n###### Unnamed Matrix (%lu, %lu) ######\n", GetNumRows(), GetNumCols());
|
||||
fprintf(stderr, "\n###### Unnamed Matrix (%lu, %lu) ######\n", (unsigned long)GetNumRows(), (unsigned long)GetNumCols());
|
||||
|
||||
fprintf(stderr, "\n------ Print Range (%lu:%lu, %lu:%lu) ------\n", rowStart, rowEnd, colStart, colEnd);
|
||||
fprintf(stderr, "\n------ Print Range (%lu:%lu, %lu:%lu) ------\n", (unsigned long)rowStart, (unsigned long)rowEnd, (unsigned long)colStart, (unsigned long)colEnd);
|
||||
|
||||
for (size_t j = colStart; j <= colEnd; j++)
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ void BinaryFile::SetFilePositionMax(size_t filePositionMax)
|
|||
if (m_filePositionMax > m_mappedSize)
|
||||
{
|
||||
char message[128];
|
||||
sprintf_s(message, "Setting max position larger than mapped file size: %ld > %ld", m_filePositionMax, m_mappedSize);
|
||||
sprintf_s(message, "Setting max position larger than mapped file size: %ld > %ld", (long)m_filePositionMax, (long)m_mappedSize);
|
||||
RuntimeError(message);
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ Section* Section::ReadSection(size_t index, MappingType mapping, size_t sizeElem
|
|||
if (!section->ValidateHeader())
|
||||
{
|
||||
char message[256];
|
||||
sprintf_s(message, "Invalid header in file %ls, in header %s\n", m_file->GetName().c_str(), section->GetName().c_str());
|
||||
sprintf_s(message, "Invalid header in file %ls, in header %ls\n", m_file->GetName().c_str(), section->GetName().c_str());
|
||||
RuntimeError(message);
|
||||
}
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ void HTKMLFReader<ElemType>::PrepareForTrainingOrTesting(const ConfigRecordType&
|
|||
n++;
|
||||
}
|
||||
|
||||
fprintf(stderr, " %lu entries\n", n);
|
||||
fprintf(stderr, " %lu entries\n", (unsigned long)n);
|
||||
|
||||
if (i == 0)
|
||||
numFiles = n;
|
||||
|
|
|
@ -934,7 +934,7 @@ class htkmlfreader : public map<wstring, vector<ENTRY>> // [key][i] the data
|
|||
if (filename.length() < 3 || filename[0] != '"' || filename[filename.length() - 1] != '"')
|
||||
{
|
||||
fprintf(stderr, "warning: filename entry (%s)\n", filename.c_str());
|
||||
fprintf(stderr, "skip current mlf entry from line (%lu) until line (%lu).\n", line + idx, line + lines.size());
|
||||
fprintf(stderr, "skip current mlf entry from line (%lu) until line (%lu).\n", (unsigned long)(line + idx), (unsigned long)(line + lines.size()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ public:
|
|||
malformed("unexpected end in mid-utterance");
|
||||
|
||||
curpath.clear();
|
||||
fprintf(stderr, " total %lu entries\n", this->size());
|
||||
fprintf(stderr, " total %lu entries\n", (unsigned long)this->size());
|
||||
}
|
||||
|
||||
// read state list, index is from 0
|
||||
|
@ -1195,7 +1195,7 @@ public:
|
|||
RuntimeError("readstatelist: lines (%d) not equal to statelistmap size (%d)", (int) index, (int) statelistmap.size());
|
||||
if (statelistmap.size() != issilstatetable.size())
|
||||
RuntimeError("readstatelist: size of statelookuparray (%d) not equal to statelistmap size (%d)", (int) issilstatetable.size(), (int) statelistmap.size());
|
||||
fprintf(stderr, "total %lu state names in state list %ls\n", statelistmap.size(), stateListPath.c_str());
|
||||
fprintf(stderr, "total %lu state names in state list %ls\n", (unsigned long)statelistmap.size(), stateListPath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ static size_t tryfind(const MAPTYPE &map, const KEYTYPE &key, VALTYPE deflt)
|
|||
// TODO: This is sort of redundant now--it gets the symmap from the HMM, i.e. always the same for all archives.
|
||||
writeunitmap(symlistpath, modelsymmap);
|
||||
|
||||
fprintf(stderr, "completed %lu out of %lu lattices (%lu read failures, %.1f%%)\n", infiles.size(), infiles.size() - brokeninputfiles, brokeninputfiles, 100.0f * brokeninputfiles / infiles.size());
|
||||
fprintf(stderr, "completed %lu out of %lu lattices (%lu read failures, %.1f%%)\n", (unsigned long)infiles.size(), (unsigned long)(infiles.size() - brokeninputfiles), (unsigned long)brokeninputfiles, 100.0f * brokeninputfiles / infiles.size());
|
||||
}
|
||||
|
||||
// helper to set a context value (left, right) with checking of uniqueness
|
||||
|
@ -206,7 +206,7 @@ vector<lattice::nodecontext> lattice::determinenodecontexts(const msra::asr::sim
|
|||
// ends with n = position of furthest non-sp
|
||||
if (n < 0) // only sp?
|
||||
RuntimeError("determinenodecontexts: word consists only of /sp/");
|
||||
fprintf(stderr, "determinenodecontexts: word with %lu /sp/ at the end found, edge %d\n", a.size() - 1 - n, j);
|
||||
fprintf(stderr, "determinenodecontexts: word with %lu /sp/ at the end found, edge %d\n", (unsigned long)a.size() - 1 - n, j);
|
||||
multispseen++;
|
||||
Z = a[n].unit;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ vector<lattice::nodecontext> lattice::determinenodecontexts(const msra::asr::sim
|
|||
nodecontexts[E].setleft(Zid);
|
||||
}
|
||||
if (multispseen > 0)
|
||||
fprintf(stderr, "determinenodecontexts: %lu broken edges in %lu with multiple /sp/ at the end seen\n", multispseen, edges.size());
|
||||
fprintf(stderr, "determinenodecontexts: %lu broken edges in %lu with multiple /sp/ at the end seen\n", (unsigned long)multispseen, (unsigned long)edges.size());
|
||||
// check CI conditions and put in 't'
|
||||
// We make the hard assumption that there is only one CI phone, /sil/.
|
||||
const auto &silhmm = hset.gethmm(silunit);
|
||||
|
@ -325,7 +325,7 @@ void lattice::merge(const lattice &other, const msra::asr::simplesenonehmm &hset
|
|||
if (contexts[i].iother != SIZE_MAX)
|
||||
othernodemap[contexts[i].iother] = j - 1;
|
||||
}
|
||||
fprintf(stderr, "merge: joint node space uniq'ed to %d from %d\n", j, contexts.size());
|
||||
fprintf(stderr, "merge: joint node space uniq'ed to %d from %d\n", j, (unsigned long)contexts.size());
|
||||
contexts.resize(j);
|
||||
|
||||
// create a new node array (just copy the contexts[].t fields)
|
||||
|
@ -384,7 +384,7 @@ void lattice::dedup()
|
|||
}
|
||||
edges2[k++] = edges2[j];
|
||||
}
|
||||
fprintf(stderr, "dedup: edges reduced to %d from %d\n", k, edges2.size());
|
||||
fprintf(stderr, "dedup: edges reduced to %lu from %lu\n", (unsigned long)k, (unsigned long)edges2.size());
|
||||
edges2.resize(k);
|
||||
info.numedges = edges2.size();
|
||||
edges.clear(); // (should already be, but isn't; make sure we no longer use it)
|
||||
|
@ -517,13 +517,13 @@ void lattice::dedup()
|
|||
}
|
||||
} // end for (toclines)
|
||||
if (skippedmerges > 0)
|
||||
fprintf(stderr, "convert: %d out of %d merge operations skipped due to secondary lattice missing\n", skippedmerges, toclines.size());
|
||||
fprintf(stderr, "convert: %lu out of %lu merge operations skipped due to secondary lattice missing\n", (unsigned long)skippedmerges, (unsigned long)toclines.size());
|
||||
|
||||
// write out the updated unit map
|
||||
if (f && ftoc)
|
||||
writeunitmap(symlistpath, modelsymmap);
|
||||
|
||||
fprintf(stderr, "converted %d lattices\n", toclines.size());
|
||||
fprintf(stderr, "converted %lu lattices\n", (unsigned long)toclines.size());
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -544,7 +544,7 @@ void lattice::fromhtklattice(const wstring &path, const std::unordered_map<std::
|
|||
for (; iter != lines.end() && strncmp(*iter, "N=", 2); iter++)
|
||||
{
|
||||
if (strncmp(*iter, "lmscale=", 8) == 0) // note: HTK sometimes generates extra garbage space at the end of this line
|
||||
if (sscanf_s(*iter, "lmscale=%f wdpenalty=%f%c", &info.lmf, &info.wp, &dummychar, sizeof(dummychar)) != 2 && dummychar != ' ')
|
||||
if (sscanf_s(*iter, "lmscale=%f wdpenalty=%f%c", &info.lmf, &info.wp, &dummychar, (unsigned int)sizeof(dummychar)) != 2 && dummychar != ' ')
|
||||
RuntimeError("lattice: mal-formed lmscale/wdpenalty line in lattice: %s", *iter);
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ void lattice::fromhtklattice(const wstring &path, const std::unordered_map<std::
|
|||
if (iter != lines.end())
|
||||
{
|
||||
unsigned long N, L;
|
||||
if (sscanf_s(*iter, "N=%lu L=%lu %c", &N, &L, &dummychar, sizeof(dummychar)) != 2)
|
||||
if (sscanf_s(*iter, "N=%lu L=%lu %c", &N, &L, &dummychar, (unsigned int)sizeof(dummychar)) != 2)
|
||||
RuntimeError("lattice: mal-formed N=/L= line in lattice: %s", *iter);
|
||||
info.numnodes = N;
|
||||
info.numedges = L;
|
||||
|
@ -570,7 +570,7 @@ void lattice::fromhtklattice(const wstring &path, const std::unordered_map<std::
|
|||
RuntimeError("lattice: not enough I lines in lattice");
|
||||
unsigned long itest;
|
||||
float t;
|
||||
if (sscanf_s(*iter, "I=%lu t=%f%c", &itest, &t, &dummychar, sizeof(dummychar)) < 2)
|
||||
if (sscanf_s(*iter, "I=%lu t=%f%c", &itest, &t, &dummychar, (unsigned int)sizeof(dummychar)) < 2)
|
||||
RuntimeError("lattice: mal-formed node line in lattice: %s", *iter);
|
||||
if (i != (size_t) itest)
|
||||
RuntimeError("lattice: out-of-sequence node line in lattice: %s", *iter);
|
||||
|
@ -592,7 +592,7 @@ void lattice::fromhtklattice(const wstring &path, const std::unordered_map<std::
|
|||
char d[1024];
|
||||
// example:
|
||||
// J=12 S=1 E=13 a=-326.81 l=-5.090 d=:sil-t:s+k:e,0.03:dh:m-ax:m+sil,0.03:sil,0.02:
|
||||
int nvals = sscanf_s(*iter, "J=%lu S=%lu E=%lu a=%f l=%f d=%s", &jtest, &S, &E, &a, &l, &d, sizeof(d));
|
||||
int nvals = sscanf_s(*iter, "J=%lu S=%lu E=%lu a=%f l=%f d=%s", &jtest, &S, &E, &a, &l, &d, (unsigned int)sizeof(d));
|
||||
if (nvals == 5 && j == info.numedges - 1) // special case: last edge is a !NULL and thus may have the d= record missing
|
||||
strcpy(d, ":");
|
||||
else if (nvals != 6)
|
||||
|
@ -635,7 +635,7 @@ void lattice::fromhtklattice(const wstring &path, const std::unordered_map<std::
|
|||
if (edgeframes != nodes[E].t - (size_t) nodes[S].t)
|
||||
{
|
||||
char msg[128];
|
||||
sprintf(msg, "\n-- where edgeframes=%d != (nodes[E].t - nodes[S].t=%d), the gap is %d.", edgeframes, nodes[E].t - (size_t) nodes[S].t, edgeframes + nodes[S].t - nodes[E].t);
|
||||
sprintf(msg, "\n-- where edgeframes=%lu != (nodes[E].t - nodes[S].t=%lu), the gap is %lu.", (unsigned long)edgeframes, (unsigned long)(nodes[E].t - (size_t) nodes[S].t), (unsigned long)(edgeframes + nodes[S].t - nodes[E].t));
|
||||
RuntimeError("lattice: alignment info duration mismatches edge duration: %s%s", *iter, msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ public:
|
|||
// finish off last block
|
||||
flushlastblock();
|
||||
fflushOrDie(f);
|
||||
fprintf(stderr, "biggrowablevectorarray: disk backup store created, %d frames, %lu bytes\n", (int) n, fgetpos(f));
|
||||
fprintf(stderr, "biggrowablevectorarray: disk backup store created, %d frames, %lu bytes\n", (int) n, (unsigned long)fgetpos(f));
|
||||
fclose(f);
|
||||
foreach_index (i, blocks)
|
||||
assert(!blocks[i]); // ensure we flushed
|
||||
|
|
|
@ -88,7 +88,7 @@ void LMSequenceWriter<ElemType>::ReadLabelInfo(const wstring& vocfile,
|
|||
b = 0;
|
||||
while (!feof(vin))
|
||||
{
|
||||
fscanf_s(vin, "%s\n", stmp, _countof(stmp));
|
||||
fscanf_s(vin, "%s\n", stmp, (unsigned int)_countof(stmp));
|
||||
word4idx[stmp] = b;
|
||||
idx4word[b++] = stmp;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ void LUSequenceWriter<ElemType>::ReadLabelInfo(const wstring& vocfile,
|
|||
b = 0;
|
||||
while (!feof(vin))
|
||||
{
|
||||
fscanf_s(vin, "%s\n", stmp, _countof(stmp));
|
||||
fscanf_s(vin, "%s\n", stmp, (int)_countof(stmp));
|
||||
word4idx[stmp] = b;
|
||||
idx4word[b++] = stmp;
|
||||
}
|
||||
|
|
|
@ -679,7 +679,7 @@ long UCIParser<NumType, LabelType>::Parse(size_t recordsRequested, std::vector<N
|
|||
long TickDelta = TickStop - TickStart;
|
||||
|
||||
if (m_traceLevel > 2)
|
||||
fprintf(stderr, "\n%ld ms, %ld numbers parsed\n\n", TickDelta, m_totalNumbersConverted);
|
||||
fprintf(stderr, "\n%ld ms, %ld numbers parsed\n\n", TickDelta, (long)m_totalNumbersConverted);
|
||||
return recordCount;
|
||||
}
|
||||
|
||||
|
|
|
@ -741,7 +741,7 @@ void SGD<ElemType>::TrainOrAdaptModel(int startEpoch, ComputationNetworkPtr net,
|
|||
for (int j = 1; j < m_learnRateAdjustInterval; j++)
|
||||
{
|
||||
int epochToDelete = i - j;
|
||||
LOGPRINTF(stderr, "SGD: removing model and checkpoint files for epoch %d after rollback to epoch %lu\n", epochToDelete + 1, (size_t)(i - m_learnRateAdjustInterval) + 1); // report 1 based epoch number
|
||||
LOGPRINTF(stderr, "SGD: removing model and checkpoint files for epoch %d after rollback to epoch %lu\n", epochToDelete + 1, (unsigned long)(i - m_learnRateAdjustInterval) + 1); // report 1 based epoch number
|
||||
_wunlink(GetModelNameForEpoch(epochToDelete).c_str());
|
||||
_wunlink(GetCheckPointFileNameForEpoch(epochToDelete).c_str());
|
||||
}
|
||||
|
@ -1548,7 +1548,7 @@ bool SGD<ElemType>::PreCompute(ComputationNetworkPtr net,
|
|||
}
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
LOGPRINTF(stderr, "Precomputing --> %lu PreCompute nodes found.\n\n", nodes.size());
|
||||
LOGPRINTF(stderr, "Precomputing --> %lu PreCompute nodes found.\n\n", (unsigned long)nodes.size());
|
||||
if (m_traceLevel > 0)
|
||||
{
|
||||
for (const auto & node : nodes)
|
||||
|
|
|
@ -290,7 +290,7 @@ protected:
|
|||
void DisplayEvalStatistics(const size_t startMBNum, const size_t endMBNum, const size_t numSamplesLastLogged, const vector<ComputationNodeBasePtr>& evalNodes,
|
||||
const vector<EpochCriterion>& evalResults, const vector<EpochCriterion>& evalResultsLastLogged, bool displayConvertedValue = false, bool isFinal = false)
|
||||
{
|
||||
LOGPRINTF(stderr, "%sMinibatch[%lu-%lu]: ", isFinal ? "Final Results: " : "", startMBNum, endMBNum);
|
||||
LOGPRINTF(stderr, "%sMinibatch[%lu-%lu]: ", isFinal ? "Final Results: " : "", (unsigned long)startMBNum, (unsigned long)endMBNum);
|
||||
|
||||
for (size_t i = 0; i < evalResults.size(); i++)
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
}
|
||||
|
||||
if (m_verbosity > 0)
|
||||
fprintf(stderr, "Total Samples Evaluated = %lu\n", totalEpochSamples);
|
||||
fprintf(stderr, "Total Samples Evaluated = %lu\n", (unsigned long)totalEpochSamples);
|
||||
|
||||
// clean up
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ public:
|
|||
}
|
||||
totalEpochSamples += actualMBSize;
|
||||
|
||||
fprintf(stderr, "Minibatch[%lu]: ActualMBSize = %lu\n", numMBsRun, actualMBSize);
|
||||
fprintf(stderr, "Minibatch[%lu]: ActualMBSize = %lu\n", (unsigned long)numMBsRun, (unsigned long)actualMBSize);
|
||||
if (outputPath == L"-") // if we mush all nodes together on stdout, add some visual separator
|
||||
fprintf(stdout, "\n");
|
||||
|
||||
|
@ -285,7 +285,7 @@ public:
|
|||
fprintfOrDie(f, "%s", formattingOptions.epilogue.c_str());
|
||||
}
|
||||
|
||||
fprintf(stderr, "Written to %ls*\nTotal Samples Evaluated = %lu\n", outputPath.c_str(), totalEpochSamples);
|
||||
fprintf(stderr, "Written to %ls*\nTotal Samples Evaluated = %lu\n", outputPath.c_str(), (unsigned long)totalEpochSamples);
|
||||
|
||||
// flush all files (where we can catch errors) so that we can then destruct the handle cleanly without error
|
||||
for (auto & iter : outputStreams)
|
||||
|
|
Загрузка…
Ссылка в новой задаче