threshold_(input: Tensor, threshold: float, value: float, inplace: bool = True)In-place threshold — replace entries <= threshold with value.
Parameters
inputTensorInput; modified in place.
thresholdfloatCutoff; positions where
input <= threshold are reset.valuefloatReplacement value for clipped positions.
inplacebool= TrueFalse returns threshold's fresh result instead.
Default True.Returns
TensorThe same input tensor, with sub-threshold positions set to
value and the rest unchanged.