@tensorflow/tfjs-core
Version:
Hardware-accelerated JavaScript library for machine intelligence
20 lines (19 loc) • 680 B
TypeScript
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 {};