oneflow.clamp_min¶
-
oneflow.
clamp_min
()¶ Clamp all elements in
input
which are less thanmin
tomin
and return a resulting tensor:\[y_i = \max(min, x_i)\]If
input
is of type FloatTensor or DoubleTensor, argsmin
must be real numbers, otherwise they should be integers.- Parameters
For example:
>>> import oneflow as flow >>> input = flow.Tensor([0.2, 0.6, -1.5, -0.3]) >>> output = flow.clamp_min(input, min=-0.5) >>> output tensor([ 0.2000, 0.6000, -0.5000, -0.3000], dtype=oneflow.float32) >>> input = flow.Tensor([0.2, 0.6, -1.5, -0.3]) >>> output = flow.clamp_min(input, min=-2) >>> output tensor([ 0.2000, 0.6000, -1.5000, -0.3000], dtype=oneflow.float32) >>> input = flow.Tensor([0.2, 0.6, -1.5, -0.3]) >>> output = flow.clamp_min(input, min=1) >>> output tensor([1., 1., 1., 1.], dtype=oneflow.float32)