(args: {backend: BackendWasm, inputs: UnaryInputs})
| 34 | } |
| 35 | |
| 36 | function kernelFunc(args: {backend: BackendWasm, inputs: UnaryInputs}): |
| 37 | TensorInfo { |
| 38 | const {backend, inputs: {x}} = args; |
| 39 | const xId = backend.dataIdMap.get(x.dataId).id; |
| 40 | const out = backend.makeOutput(x.shape, outType || x.dtype); |
| 41 | const outId = backend.dataIdMap.get(out.dataId).id; |
| 42 | |
| 43 | // Short-circuit zero-sized tensors. |
| 44 | if (util.sizeFromShape(out.shape) === 0) { |
| 45 | return out; |
| 46 | } |
| 47 | |
| 48 | wasmFunc(xId, CppDType[x.dtype], outId); |
| 49 | return out; |
| 50 | } |
| 51 | |
| 52 | return {kernelName, backendName: 'wasm', setupFunc, kernelFunc}; |
| 53 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…