UNPKG

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