MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / parseArgs

Function parseArgs

quantization/eval_mnist.js:27–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25let tf;
26
27function parseArgs() {
28 const parser = new argparse.ArgumentParser({
29 description:
30 'TensorFlow.js Quantization Example: Evaluating an MNIST Model',
31 addHelp: true
32 });
33 parser.addArgument('dataset', {
34 type: 'string',
35 help: 'Name of the dataset ({mnist, fashion-mnist}).'
36 });
37 parser.addArgument('modelSavePath', {
38 type: 'string',
39 help: 'Path at which the model to be evaluated is saved.'
40 });
41 parser.addArgument('--batchSize', {
42 type: 'int',
43 defaultValue: 128,
44 help: 'Batch size to be used during model training.'
45 });
46 parser.addArgument('--gpu', {
47 action: 'storeTrue',
48 help: 'Use tfjs-node-gpu for evaluation (requires CUDA-enabled ' +
49 'GPU and supporting drivers and libraries.'
50 });
51 return parser.parseArgs();
52}
53
54async function main() {
55 const args = parseArgs();

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected