MCPcopy Create free account
hub / github.com/tensorflow/tfjs / complexWithEvenIndex

Function complexWithEvenIndex

tfjs-core/src/backends/complex_util.ts:77–87  ·  view source on GitHub ↗
(complex: Float32Array)

Source from the content-addressed store, hash-verified

75 * @param complex The complex tensor values
76 */
77export function complexWithEvenIndex(complex: Float32Array):
78 {real: Float32Array, imag: Float32Array} {
79 const len = Math.ceil(complex.length / 4);
80 const real = new Float32Array(len);
81 const imag = new Float32Array(len);
82 for (let i = 0; i < complex.length; i += 4) {
83 real[Math.floor(i / 4)] = complex[i];
84 imag[Math.floor(i / 4)] = complex[i + 1];
85 }
86 return {real, imag};
87}
88
89/**
90 * Extracts odd indexed complete values in the given array.

Callers

nothing calls this directly

Calls 2

ceilMethod · 0.80
floorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…