Clip

Description

Clips the input tensor value between the specified minimum and maximum values. This means that the value is limited within an interval. When min is greater than max, the Clip operator sets all input tensors to the value of max.

Input

  • x: input tensor of type float16, float, or int32.
  • min (optional): a scalar. The minimum value of x is not clipped if the scalar is missing.
  • max (optional): a scalar. The maximum value of x is not clipped if the scalar is missing.

Output

y: output tensor after clipping. The data type and shape are the same as those of the input.

Constraints

The min and max parameters cannot be left blank at the same time.

ONNX Opset Support

Opset v11/v12/v13/v14/v15/v16