CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

What are reserved keywords

Open mhng1580 opened this issue 10 years ago • 3 comments

I happened to name a variable contextWindow without knowing that it's a reserved keywords, which took me quite a while to figure out what actually resulted in the error InputValue operation had its row dimension 1411 changed by the reader to 9877. Is there anyway to know which words are reserved? Thanks!

mhng1580 avatar Mar 06 '16 03:03 mhng1580

Not currently, although it would be a good idea to create an index that simply lists any and all parameters across all modules, sorted by parameter name and listing all modules that consume that parameter.

'contextWindow' is not a reserved word in the classic programming-language sense. Parameter names are defined by each individual code module, by the line of C++ that reads out a specific parameter; there is no declaration section at present. Particularly for the readers, different reader implementations may even differ in their parameters.

The problem you ran into is that parameters can be defined at the scope they are used, but also in outer scopes. It is like scoping in most programming languages, except that you cannot see from the config what variables are used.

frankseide avatar Mar 06 '16 03:03 frankseide

Thanks. I misused the term reserved word.

I guess the problem is that HTKMLFReader uses the variable of the same name. However, the point is that I don't know this variable name is already used in some cntk modules and it's not documented in CNTK book either.

mhng1580 avatar Mar 06 '16 03:03 mhng1580

Yes, 'contextWindow' is a config parameter in HTKMLFReader. We will document this in wiki.

dongyu888 avatar Mar 06 '16 05:03 dongyu888