Skip to content

Commit

Permalink
normalized inconsistent commenting style from "//text" to "// text"
Browse files Browse the repository at this point in the history
  • Loading branch information
frankseide committed Jan 22, 2016
1 parent 27641d8 commit a4cf445
Show file tree
Hide file tree
Showing 143 changed files with 1,883 additions and 1,884 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,7 @@ void DoCommand(const ConfigParameters& config)

\begin_layout Plain Layout

//get the configuration parameters that match the command
// get the configuration parameters that match the command
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -3207,7 +3207,7 @@ unctionValues().GetNumCols());

\begin_layout Plain Layout

//left Node must be a scalar
// left Node must be a scalar
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -3420,12 +3420,12 @@ virtual void BackpropTo(const size_t inputIndex)

\begin_layout Plain Layout

//left Node must be a scalar
// left Node must be a scalar
\end_layout

\begin_layout Plain Layout

if (inputIndex == 0) //left derivative
if (inputIndex == 0) // left derivative
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -3504,12 +3504,12 @@ Seq)

\begin_layout Plain Layout

//left Node must be a scalar
// left Node must be a scalar
\end_layout

\begin_layout Plain Layout

if (inputIndex == 0) //left derivative
if (inputIndex == 0) // left derivative
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -3863,7 +3863,7 @@ ComputationNodePtr CreateComputationNode(const std::wstring nodeType, const

\begin_layout Plain Layout

//other node types
// other node types
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -3927,7 +3927,7 @@ ComputationNode<ElemType>* CreateNodeFromFile(const std::wstring nodeType,

\begin_layout Plain Layout

//other node types
// other node types
\end_layout

\begin_layout Plain Layout
Expand All @@ -3943,7 +3943,7 @@ ComputationNode<ElemType>* CreateNodeFromFile(const std::wstring nodeType,

\begin_layout Plain Layout

//other node types
// other node types
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -4103,7 +4103,7 @@ bool CheckFunction(std::string& p_nodeType, bool* allowUndeterminedVariable)

\begin_layout Plain Layout

//other node types
// other node types
\end_layout

\begin_layout Plain Layout
Expand All @@ -4118,7 +4118,7 @@ bool CheckFunction(std::string& p_nodeType, bool* allowUndeterminedVariable)

\begin_layout Plain Layout

//other node types and codes
// other node types and codes
\end_layout

\begin_layout Plain Layout
Expand Down Expand Up @@ -4632,7 +4632,7 @@ while (trainSetDataReader->GetMinibatch(inputMatrices))

\begin_layout Plain Layout

//update the time stamp of the input nodes for re-evaluation
// update the time stamp of the input nodes for re-evaluation
\end_layout

\begin_layout Plain Layout
Expand Down
10 changes: 5 additions & 5 deletions Source/ActionsLib/EvalActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void DoEvalBase(const ConfigParameters& config, IDataReader<ElemType>& re
template <typename ElemType>
void DoEval(const ConfigParameters& config)
{
//test
// test
ConfigParameters readerConfig(config(L"reader"));
readerConfig.Insert("traceLevel", config(L"traceLevel", "0"));

Expand All @@ -93,7 +93,7 @@ template void DoEval<float>(const ConfigParameters& config);
template <typename ElemType>
void DoCrossValidate(const ConfigParameters& config)
{
//test
// test
ConfigParameters readerConfig(config(L"reader"));
readerConfig.Insert("traceLevel", config(L"traceLevel", "0"));

Expand Down Expand Up @@ -156,7 +156,7 @@ void DoCrossValidate(const ConfigParameters& config)
::Sleep(1000 * sleepSecondsBetweenRuns);
}

//find best model
// find best model
if (cvErrorResults.size() == 0)
{
LogicError("No model is evaluated.");
Expand Down Expand Up @@ -204,7 +204,7 @@ void DoWriteOutput(const ConfigParameters& config)
{
ConfigParameters readerConfig(config(L"reader"));
readerConfig.Insert("traceLevel", config(L"traceLevel", "0"));
readerConfig.Insert("randomize", "None"); //we don't want randomization when output results
readerConfig.Insert("randomize", "None"); // we don't want randomization when output results

DataReader<ElemType> testDataReader(readerConfig);

Expand Down Expand Up @@ -242,7 +242,7 @@ void DoWriteOutput(const ConfigParameters& config)
wstring outputPath = config(L"outputPath"); // crashes if no default given?
writer.WriteOutput(testDataReader, mbSize[0], outputPath, outputNodeNamesVector, epochSize);
}
//writer.WriteOutput(testDataReader, mbSize[0], testDataWriter, outputNodeNamesVector, epochSize);
// writer.WriteOutput(testDataReader, mbSize[0], testDataWriter, outputNodeNamesVector, epochSize);
}

template void DoWriteOutput<float>(const ConfigParameters& config);
Expand Down
10 changes: 5 additions & 5 deletions Source/ActionsLib/OtherActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void DoWriteWordAndClassInfo(const ConfigParameters& config)
Matrix<ElemType> wrd2cls(deviceId);
Matrix<ElemType> cls2idx(deviceId);

//FILE *fp = fopen(inputFile.c_str(), "rt");
// FILE *fp = fopen(inputFile.c_str(), "rt");
ifstream fp(inputFile.c_str());
if (!fp)
{
Expand All @@ -278,8 +278,8 @@ void DoWriteWordAndClassInfo(const ConfigParameters& config)
string token;
while (getline(fp, str))
{
str.erase(0, str.find_first_not_of(' ')); //prefixing spaces
str.erase(str.find_last_not_of(' ') + 1); //surfixing spaces
str.erase(0, str.find_first_not_of(' ')); // prefixing spaces
str.erase(str.find_last_not_of(' ') + 1); // surfixing spaces
int sposition = str.find("</s> ");
int eposition = str.find(" </s>");
if (sposition == str.npos)
Expand Down Expand Up @@ -474,9 +474,9 @@ void DoTopologyPlot(const ConfigParameters& config)
// e.g. "d:\Tools\graphviz\bin\dot.exe -Tpng -x <IN> -o<OUT>"
// where <IN> and <OUT> are two special placeholders

//========================================
// ========================================
// Sec. 1 option check
//========================================
// ========================================
if (outdot.empty())
{
outdot = modelPath + L".dot";
Expand Down
12 changes: 6 additions & 6 deletions Source/CNTK/CNTK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void DumpNodeInfo(const ConfigParameters& config)
wstring outputFile = config(L"outputFile", defOutFilePath);
bool printValues = config(L"printValues", true);

ComputationNetwork net(-1); //always use CPU
ComputationNetwork net(-1); // always use CPU
net.Load<ElemType>(modelPath);
net.DumpNodeInfoToFile(nodeName, printValues, outputFile, nodeNameRegexStr);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ void DoCommands(const ConfigParameters& config)
size_t fullTotalMaxEpochs = 0;
for (int i = 0; i < command.size(); i++)
{
//get the configuration parameters that match the command
// get the configuration parameters that match the command
ConfigParameters commandParams(config(command[i]));
ConfigArray action = commandParams("action", "train");

Expand Down Expand Up @@ -202,7 +202,7 @@ void DoCommands(const ConfigParameters& config)
// execute the commands
for (int i = 0; i < command.size(); i++)
{
//get the configuration parameters that match the command
// get the configuration parameters that match the command
ConfigParameters commandParams(config(command[i]));
ConfigArray action = commandParams("action", "train");

Expand Down Expand Up @@ -472,7 +472,7 @@ int wmainWithBS(int argc, wchar_t* argv[]) // called from wmain which is a wrapp
PrintBuiltInfo();

// execute the actions
//std::string type = config(L"precision", "float");
// std::string type = config(L"precision", "float");
int numCPUThreads = config(L"numCPUThreads", 0);
numCPUThreads = CPUMatrix<float /*any will do*/>::SetNumThreads(numCPUThreads);
if (numCPUThreads > 0)
Expand Down Expand Up @@ -564,7 +564,7 @@ int wmainOldCNTKConfig(int argc, wchar_t* argv[]) // called from wmain which is
PrintBuiltInfo(); // this one goes to log file
std::string timestamp = TimeDateStamp();

//dump config info
// dump config info
fprintf(stderr, "running on %s at %s\n", GetHostName().c_str(), timestamp.c_str());
fprintf(stderr, "command line: \n");
for (int i = 0; i < argc; i++)
Expand Down Expand Up @@ -596,7 +596,7 @@ int wmainOldCNTKConfig(int argc, wchar_t* argv[]) // called from wmain which is
fprintf(stderr, "%s ", command[i].c_str());
}

//run commands
// run commands
std::string type = config(L"precision", "float");
// accept old precision key for backward compatibility
if (config.Exists("type"))
Expand Down
10 changes: 5 additions & 5 deletions Source/CNTK/ModelEditLanguage.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class MELScript : public ConfigParser
wstring name = msra::strfun::utf16(search);
vector<ComputationNodeBasePtr> nodes = netNdlIn->cn->GetNodesFromName(name);

if (!nodes.size()) //found
if (!nodes.size()) // found
RuntimeError("GenerateNames: Node name does not exist %ls.", name.c_str());

size_t firstStartOut, firstCountOut, secondStartOut, secondCountOut;
Expand Down Expand Up @@ -399,7 +399,7 @@ class MELScript : public ConfigParser
found->second.Clear();
}

m_mapNameToNetNdl[modelName] = NetNdl<ElemType>(cn); //newly loaded model will be the new default if none has been set yet
m_mapNameToNetNdl[modelName] = NetNdl<ElemType>(cn); // newly loaded model will be the new default if none has been set yet
if (m_netNdlDefault == nullptr)
{
m_netNdlDefault = &m_mapNameToNetNdl[modelName];
Expand Down Expand Up @@ -439,7 +439,7 @@ class MELScript : public ConfigParser
}
wstring GetOptionalModelFormat(const ConfigParamList& params, const size_t numFixedParams)
{
wstring modelFormat = L"cntk"; //default
wstring modelFormat = L"cntk"; // default
for (size_t paramNumber = params.size(); paramNumber > numFixedParams; paramNumber--)
{
// process optional parameter if it exists
Expand Down Expand Up @@ -498,7 +498,7 @@ class MELScript : public ConfigParser

CopyNodeFlags GetOptionalCopyNodeFlags(const ConfigParamList& params, const size_t numFixedParams)
{
CopyNodeFlags copyFlags = CopyNodeFlags::copyNodeAll; //by default copy both values and link structure
CopyNodeFlags copyFlags = CopyNodeFlags::copyNodeAll; // by default copy both values and link structure

for (size_t paramNumber = params.size(); paramNumber > numFixedParams; paramNumber--)
{
Expand Down Expand Up @@ -655,7 +655,7 @@ class MELScript : public ConfigParser
RuntimeError("NDL Command cannot be executed until default model is established, cannot set '%s' without a default mode\n Try calling SetDefaultModel(model) before any NDL statement are embedded\n", key.c_str());
HandleNDLInline(stringParse, tokenStart, tokenEnd);
}
else //createModel, loadModel, or loadNDL
else // createModel, loadModel, or loadNDL
{
// model1=[...] - Embedded NDL script
if (0 == foundBrace)
Expand Down
2 changes: 1 addition & 1 deletion Source/CNTK/NDLNetworkBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class NDLBuilder

virtual ComputationNetworkPtr BuildNetworkFromDescription(ComputationNetwork* = nullptr)
{
if (m_net->GetTotalNumberOfNodes() < 1) //not built yet
if (m_net->GetTotalNumberOfNodes() < 1) // not built yet
LoadNetworkFromConfig(m_networkConfig);
else
m_net->ResetEvalTimeStamps();
Expand Down
4 changes: 2 additions & 2 deletions Source/CNTK/NDLUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class NDLUtil
{
NDLNode<ElemType>* nodeArray = script->FindSymbol(symbolName);
bool valid = m_net->FeatureNodes().size() > 0; // see if it's already valid
if (!valid && nodeArray) //otherwise, see if we found a symbol
if (!valid && nodeArray) // otherwise, see if we found a symbol
{
NDLType outputType = nodeArray->GetType();
// accept either an array of nodes, or a single node
Expand Down Expand Up @@ -165,7 +165,7 @@ class NDLUtil
CheckOutputNodes(script, "FeatureNodes", m_net->FeatureNodes());
CheckOutputNodes(script, "LabelNodes", m_net->LabelNodes());
CheckOutputNodes(script, "CriterionNodes", m_net->FinalCriterionNodes());
CheckOutputNodes(script, "CriteriaNodes", m_net->FinalCriterionNodes()); //legacy
CheckOutputNodes(script, "CriteriaNodes", m_net->FinalCriterionNodes()); // legacy
CheckOutputNodes(script, "EvalNodes", m_net->EvaluationNodes());
CheckOutputNodes(script, "OutputNodes", m_net->OutputNodes());
}
Expand Down
4 changes: 2 additions & 2 deletions Source/CNTK/NetworkDescriptionLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ NDLNode<ElemType>::NDLNode(const NDLNode<ElemType>& copyMe)
m_name = copyMe.m_name; // value on the left of the equals
m_value = copyMe.m_value; // value on the right of the equals (CN node name, or value)
m_parent = copyMe.m_parent; // parent script
m_type = copyMe.m_type; //type of node
m_type = copyMe.m_type; // type of node
m_paramString = copyMe.m_paramString; // parameter of a function/array
m_paramMacro = copyMe.m_paramMacro; // parameter of a macro (the variables used in the macro definition)
// don't copy over the parameters, they will be reparsed after the copy
//m_parameters = copyMe.m_parameters; // copy over the parameters straight
// m_parameters = copyMe.m_parameters; // copy over the parameters straight

m_eval = nullptr; // pointer to an arbitrary eval structure
// script for macro calls, need to expand the macro for each call
Expand Down
12 changes: 6 additions & 6 deletions Source/CNTK/NetworkDescriptionLanguage.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class NDLNode
std::string m_name; // value on the left of the equals
ConfigValue m_value; // value on the right of the equals (CN node name, or value)
NDLScript<ElemType>* m_parent; // parent script
NDLType m_type; //type of node
NDLType m_type; // type of node
ConfigArray m_paramString; // parameter of a function/array
ConfigArray m_paramMacro; // parameter of a macro (the variables used in the macro definition)
vector<NDLNode*> m_parameters; // parameters as nodes/array elements
Expand Down Expand Up @@ -202,7 +202,7 @@ class NDLNode
// copy constructor, creates a new disconnected copy of this node for macro expansion
NDLNode(const NDLNode& copyMe);

NDLNode& operator=(NDLNode& /*copyMe*/) //this is just a place holder implementation which is not functioning but prevent callers to use it.
NDLNode& operator=(NDLNode& /*copyMe*/) // this is just a place holder implementation which is not functioning but prevent callers to use it.
{
LogicError("'NDLNode& operator=(NDLNode& copyMe)' should never be called.");
}
Expand Down Expand Up @@ -403,7 +403,7 @@ class NDLNode
m_script->AddSymbol(paramName, nodeParam);
continue;
}
//else assign the value below
// else assign the value below
}

// assign the parameter symbols in the script we will call with the values passed to the call
Expand Down Expand Up @@ -445,7 +445,7 @@ class NDLScript : public ConfigParser
std::map<std::string, NDLNode<ElemType>*, nocase_compare> m_symbols; // symbol table
NDLNode<ElemType>* m_macroNode; // set when interpretting a macro definition
bool m_noDefinitions; // no definitions can be made in this script, interpret all macro/function names as calls
static NDLScript<ElemType> s_global; //("global"); // global script for storing macros and global nodes
static NDLScript<ElemType> s_global; // ("global"); // global script for storing macros and global nodes
std::vector<NDLNode<ElemType>*> m_children; // child nodes. Note that m_script nodes may not be children of this object, they include macro nodes
ComputationNetworkPtr m_cn; // computation network to use for backup symbol lookup. Used for MEL where NDL and network nodes are mixed
bool m_definingMacro; // currently defining a macro, flag to determine if we are defining or interpretting a macro call
Expand Down Expand Up @@ -615,7 +615,7 @@ class NDLScript : public ConfigParser
// returns - node this symbol references
NDLNode<ElemType>* FindSymbol(const std::string& symbol, bool searchForDotNames = true)
{
auto found = m_symbols.find(symbol); //search symbol directly first
auto found = m_symbols.find(symbol); // search symbol directly first
if (found != m_symbols.end())
return found->second;

Expand Down Expand Up @@ -1075,7 +1075,7 @@ class NDLScript : public ConfigParser
AddSymbol(key, ndlNode);

ndlNode->SetName(key);
if (newNode) //only need to add nodes that are new (not renames)
if (newNode) // only need to add nodes that are new (not renames)
{
m_script.push_back(ndlNode);
}
Expand Down
Loading

0 comments on commit a4cf445

Please sign in to comment.