UNPKG

@tensorflow/tfjs-core

Version:

Hardware-accelerated JavaScript library for machine intelligence

21 lines (20 loc) 751 B
/// <amd-module name="@tensorflow/tfjs-core/dist/ops/clip_by_value" /> import { Tensor } from '../tensor'; import { TensorLike } from '../types'; /** * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)` * * ```js * const x = tf.tensor1d([-1, 2, -3, 4]); * * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) * ``` * @param x The input tensor. * @param clipValueMin Lower bound of range to be clipped to. * @param clipValueMax Upper bound of range to be clipped to. * * @doc {heading: 'Operations', subheading: 'Basic math'} */ declare function clipByValue_<T extends Tensor>(x: T | TensorLike, clipValueMin: number, clipValueMax: number): T; export declare const clipByValue: typeof clipByValue_; export {};