UNPKG

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