(
args: {inputs: ComplexAbsInputs, backend: WebGPUBackend})
| 33 | } |
| 34 | |
| 35 | export function complexAbs( |
| 36 | args: {inputs: ComplexAbsInputs, backend: WebGPUBackend}): TensorInfo { |
| 37 | const {inputs, backend} = args; |
| 38 | const {x} = inputs; |
| 39 | |
| 40 | const xData = backend.tensorMap.get(x.dataId); |
| 41 | |
| 42 | const program = new ComplexAbsProgram(x.shape); |
| 43 | const programInputs = [ |
| 44 | makeComplexComponentTensorInfo(x, xData.complexTensorInfos.real), |
| 45 | makeComplexComponentTensorInfo(x, xData.complexTensorInfos.imag), |
| 46 | ]; |
| 47 | |
| 48 | return backend.runWebGPUProgram( |
| 49 | program, programInputs, programInputs[0].dtype); |
| 50 | } |
| 51 | |
| 52 | export const complexAbsConfig: KernelConfig = { |
| 53 | kernelName: ComplexAbs, |
nothing calls this directly
no test coverage detected
searching dependent graphs…