UNPKG

680 BTypeScriptView Raw
1import { Tensor } from '../tensor';
2import { TensorLike } from '../types';
3/**
4 * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`
5 *
6 * ```js
7 * const x = tf.tensor1d([-1, 2, -3, 4]);
8 *
9 * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)
10 * ```
11 * @param x The input tensor.
12 * @param clipValueMin Lower-bound of range to be clipped to.
13 * @param clipValueMax Upper-bound of range to be clipped to.
14 *
15 * @doc {heading: 'Operations', subheading: 'Basic math'}
16 */
17declare function clipByValue_<T extends Tensor>(x: T | TensorLike, clipValueMin: number, clipValueMax: number): T;
18export declare const clipByValue: typeof clipByValue_;
19export {};