UNPKG

@tensorflow/tfjs-core

Version:

Hardware-accelerated JavaScript library for machine intelligence

27 lines (26 loc) 943 B
/// <amd-module name="@tensorflow/tfjs-core/dist/ops/complex" /> import { Tensor } from '../tensor'; import { TensorLike } from '../types'; /** * Converts two real numbers to a complex number. * * Given a tensor `real` representing the real part of a complex number, and a * tensor `imag` representing the imaginary part of a complex number, this * operation returns complex numbers elementwise of the form [r0, i0, r1, i1], * where r represents the real part and i represents the imag part. * * The input tensors real and imag must have the same shape. * * ```js * const real = tf.tensor1d([2.25, 3.25]); * const imag = tf.tensor1d([4.75, 5.75]); * const complex = tf.complex(real, imag); * * complex.print(); * ``` * * @doc {heading: 'Tensors', subheading: 'Creation'} */ declare function complex_<T extends Tensor>(real: T | TensorLike, imag: T | TensorLike): T; export declare const complex: typeof complex_; export {};