importGraphfrom'../../src/graph/graph';importGraphExecutorfrom'../../src/executor/executor';importopInfofrom'../../test/data/model.test.fc.json';importUtilsfrom'../../src/utils/utils';import{webgl}from'./common';import{nchwShape2nhwcShape,getOutputShape,deepCopy}from'./common/utils';constmodelType='fc';constoutput=deepCopy(opInfo);constexpected=output.vars.find(item=>item.name==='fc_0.tmp_1').data;constop=opInfo.ops[0];constgraphExecutor=newGraphExecutor(op);constgraph=newGraph({options:{test:true,gl:webgl}});graph.data=opInfo;graph.buildOpData(graphExecutor);asyncfunctionrun(){graph.execute_(graphExecutor);letresult=awaitgraph.inst.read();// 获取 NHWC -> NCHW 的 输出constoutputNCHWShape=getOutputShape(output,modelType);constoutputNHWCShape=nchwShape2nhwcShape(outputNCHWShape);letnchwResult=Utils.nhwc2nchw(result,outputNHWCShape);constformatData=Utils.formatReadData(nchwResult,outputNCHWShape);console.log(formatData);expect(JSON.stringify(formatData)).toBe(JSON.stringify(expected));}test('test op fc ==============>',async()=>{awaitrun();});