UNPKG

943 BTypeScriptView Raw
1/// <amd-module name="@tensorflow/tfjs-core/dist/ops/complex" />
2import { Tensor } from '../tensor';
3import { TensorLike } from '../types';
4/**
5 * Converts two real numbers to a complex number.
6 *
7 * Given a tensor `real` representing the real part of a complex number, and a
8 * tensor `imag` representing the imaginary part of a complex number, this
9 * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],
10 * where r represents the real part and i represents the imag part.
11 *
12 * The input tensors real and imag must have the same shape.
13 *
14 * ```js
15 * const real = tf.tensor1d([2.25, 3.25]);
16 * const imag = tf.tensor1d([4.75, 5.75]);
17 * const complex = tf.complex(real, imag);
18 *
19 * complex.print();
20 * ```
21 *
22 * @doc {heading: 'Tensors', subheading: 'Creation'}
23 */
24declare function complex_<T extends Tensor>(real: T | TensorLike, imag: T | TensorLike): T;
25export declare const complex: typeof complex_;
26export {};