(args: {inputs: ComplexInputs, backend: WebGPUBackend})
| 29 | * components by calling disposeData on each. |
| 30 | */ |
| 31 | export function complex(args: {inputs: ComplexInputs, backend: WebGPUBackend}): |
| 32 | TensorInfo { |
| 33 | const {inputs, backend} = args; |
| 34 | const {real, imag} = inputs; |
| 35 | |
| 36 | const complexInfo = backend.makeTensorInfo(real.shape, 'complex64'); |
| 37 | const complex = backend.tensorMap.get(complexInfo.dataId); |
| 38 | |
| 39 | const realTensorInfo = identity({inputs: {x: real}, backend}); |
| 40 | |
| 41 | const imagTensorInfo = identity({inputs: {x: imag}, backend}); |
| 42 | |
| 43 | complex.complexTensorInfos = {real: realTensorInfo, imag: imagTensorInfo}; |
| 44 | |
| 45 | return complexInfo; |
| 46 | } |
| 47 | |
| 48 | export const complexConfig: KernelConfig = { |
| 49 | kernelName: Complex, |
no test coverage detected
searching dependent graphs…