From d53452b2a68e3778cca90380b64c625724c0408e Mon Sep 17 00:00:00 2001 From: Wanming Lin Date: Fri, 25 Oct 2024 09:52:57 +0800 Subject: [PATCH] Fix inconsistent MLTensor usage in Code example (#291) Fixed #290 --- code/samples/mul_add.js | 1 + code/samples/simple_graph.js | 1 + 2 files changed, 2 insertions(+) diff --git a/code/samples/mul_add.js b/code/samples/mul_add.js index 66cb7fad..6e9e3ecf 100644 --- a/code/samples/mul_add.js +++ b/code/samples/mul_add.js @@ -22,6 +22,7 @@ const tensorC = await context.createTensor({ ...desc, usage: MLTensorUsage.READ, readable: true, + writable: false, }); const inputs = {'A': tensorA, 'B': tensorB}; const outputs = {'C': tensorC}; diff --git a/code/samples/simple_graph.js b/code/samples/simple_graph.js index bd6029af..efb724ea 100644 --- a/code/samples/simple_graph.js +++ b/code/samples/simple_graph.js @@ -62,6 +62,7 @@ const outputTensor = await context.createTensor({ ...desc, usage: MLTensorUsage.READ, readable: true, + writable: false, }); // Execute the compiled graph with the specified inputs.