MCPcopy Index your code
hub / github.com/tensorflow/tfjs / complex

Function complex

tfjs-backend-webgpu/src/kernels/Complex.ts:31–46  ·  view source on GitHub ↗
(args: {inputs: ComplexInputs, backend: WebGPUBackend})

Source from the content-addressed store, hash-verified

29 * components by calling disposeData on each.
30 */
31export 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
48export const complexConfig: KernelConfig = {
49 kernelName: Complex,

Callers 6

binaryKernelFuncFunction · 0.90
concatImplFunction · 0.90
zerosLikeFunction · 0.90
onesLikeFunction · 0.90
fftImplFunction · 0.90
castFunction · 0.90

Calls 3

identityFunction · 0.90
makeTensorInfoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…