Comparing version
{ | ||
"name": "menoh", | ||
"version": "1.0.0", | ||
"description": "MKL-DNN for NodeJS (a wrapper for Menoh).", | ||
"version": "1.0.1", | ||
"description": "NodeJS binding for Menoh DNN inference library.", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
# menoh | ||
DNN interface library for NodeJS (powered by Menoh(c/c++) and MKL-DNN) | ||
NodeJS binding for Menoh DNN inference library. | ||
@@ -4,0 +4,0 @@ ## Requirements |
@@ -439,2 +439,38 @@ 'use strict'; | ||
}); | ||
it('should throw if input data is too short', function () { | ||
return menoh.create(ONNX_FILE_PATH) | ||
.then((builder) => { | ||
builder.addInput(MNIST_IN_NAME, [ batchSize, 1, 28, 28 ]); | ||
builder.addOutput(MNIST_OUT_NAME); | ||
const model = builder.buildModel({ | ||
backendName: 'mkldnn' | ||
}); | ||
const tooShort = [0, 1, 2]; | ||
model.setInputData(MNIST_IN_NAME, tooShort); // should throw | ||
}) | ||
.then(assert.fail, (err) => { | ||
assert.ok(err instanceof Error); | ||
assert.ok(err.message.includes('too short')); | ||
}); | ||
}); | ||
it('should throw if input data is too long', function () { | ||
return menoh.create(ONNX_FILE_PATH) | ||
.then((builder) => { | ||
builder.addInput(MNIST_IN_NAME, [ batchSize, 1, 28, 28 ]); | ||
builder.addOutput(MNIST_OUT_NAME); | ||
const model = builder.buildModel({ | ||
backendName: 'mkldnn' | ||
}); | ||
const tooLong = data.concat([0.666]); | ||
model.setInputData(MNIST_IN_NAME, tooLong); // should throw | ||
}) | ||
.then(assert.fail, (err) => { | ||
assert.ok(err instanceof Error); | ||
assert.ok(err.message.includes('too long')); | ||
}); | ||
}); | ||
}); | ||
@@ -441,0 +477,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
7285839
0.03%762
4.38%