pan class="sd">        &gt;&gt;&gt; x = torch.tensor([1.5, 0.4, -1.5], requires_grad=True)</span>
<span class="sd">        &gt;&gt;&gt; y = tensor_clamp_ste_(x, torch.tensor([-1.0, -0.5, -0.5]), torch.tensor([1.0, 0.5, 0.5]))</span>
<span class="sd">        &gt;&gt;&gt; y</span>
<span class="sd">        tensor([ 1.0000,  0.4000, -0.5000], grad_fn=&lt;InplaceTensorClampSteFnBackward&gt;)</span>
<span class="sd">        &gt;&gt;&gt; (y == x).all().item()</span>
<span class="sd">        True</span>
<span class