From af02c9c39288160bd114c3ca1ad9c6225daca1fd Mon Sep 17 00:00:00 2001 From: GreyZzzzzzXh Date: Wed, 5 Dec 2018 12:36:20 +0800 Subject: [PATCH] [WebGL] improve RESHAPE --- src/nn/webgl/WebGLModel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nn/webgl/WebGLModel.js b/src/nn/webgl/WebGLModel.js index 905d93600..26ebe4f8d 100644 --- a/src/nn/webgl/WebGLModel.js +++ b/src/nn/webgl/WebGLModel.js @@ -244,7 +244,10 @@ export default class WebGLModel { const input = operands[inputs[0]]; const targetShape = operands[inputs[1]]; const output = operands[outputs[0]]; - output.assign(input.reshape(targetShape.dataSync())); + if (targetShape.value === undefined) { + targetShape.value = targetShape.dataSync(); + } + output.assign(input.reshape(targetShape.value)); } break; case OperationCode.CONCATENATION: { const numInputTensors = inputs.length - 1;